esm.sh
esm.sh copied to clipboard
Different inferred type when importing - fp-ts
Failing module
- GitHub: https://github.com/gcanti/fp-ts
- npm: https://www.npmjs.com/package/fp-ts
Inferred type of result
is different when using esm.sh
& Deno
:
import { sequenceT } from "fp-ts/Apply";
import { getApplicativeValidation, right } from "fp-ts/Either";
import { getSemigroup } from "fp-ts/NonEmptyArray";
const f = getApplicativeValidation(getSemigroup<string>());
const result = sequenceT(f)(right(""));
Error message
Inferred type (esm.sh
& Deno
):
const result: Kind4<F, S, R, E, { [K in keyof T]: [T[K]] extends [Kind4<F, S, R, E, infer A>] ? A : never; }>
Inferred type (tsc
):
const result: Either<NonEmptyArray<string>, [string]>
Additional info
- esm.sh version: V76
-
Deno version:
deno 1.20.4 (release, aarch64-apple-darwin)
It seems d.ts files are addressing wrong path to HKT.
// https://esm.sh/v86/[email protected]/lib/Apply.d.ts
import { HKT, ... } from './HKT/HKT.d.ts'
Currently it is pointing ./HKT/HKT.d.ts
, which gives /* fake(empty) types */
.
It should be ../HKT.d.ts