diff --git a/__tests__/ArraySeq.ts b/__tests__/ArraySeq.ts index 1068acb93e..0ab2148d37 100644 --- a/__tests__/ArraySeq.ts +++ b/__tests__/ArraySeq.ts @@ -30,7 +30,7 @@ describe('ArraySequence', () => { it('efficiently chains iteration methods', () => { const i = Seq('abcdefghijklmnopqrstuvwxyz'.split('')); - function studly(letter, index) { + function studly(letter: string, index: number): string { return index % 2 === 0 ? letter : letter.toUpperCase(); } const result = i diff --git a/__tests__/Conversion.ts b/__tests__/Conversion.ts index 5a008e7e55..c996fc48fb 100644 --- a/__tests__/Conversion.ts +++ b/__tests__/Conversion.ts @@ -1,5 +1,13 @@ import { describe, expect, it } from '@jest/globals'; -import { fromJS, is, List, Map, OrderedMap, Record } from 'immutable'; +import { + type Collection, + fromJS, + is, + List, + Map, + OrderedMap, + Record, +} from 'immutable'; import fc, { type JsonValue } from 'fast-check'; describe('Conversion', () => { @@ -113,15 +121,26 @@ describe('Conversion', () => { }); it('Converts deep JSON with custom conversion', () => { - const seq = fromJS(js, function (key, sequence) { - if (key === 'point') { - // @ts-expect-error -- to convert to real typing - return new Point(sequence); + const seq = fromJS( + js, + function ( + this: typeof js, + key: PropertyKey, + sequence: + | Collection.Keyed + | Collection.Indexed + ) { + if (key === 'point') { + // @ts-expect-error -- to convert to real typing + return new Point(sequence); + } + + // @ts-expect-error -- any type for too complex object + return Array.isArray(this[key]) + ? sequence.toList() + : sequence.toOrderedMap(); } - return Array.isArray(this[key]) - ? sequence.toList() - : sequence.toOrderedMap(); - }); + ); expect(seq).toEqual(immutableOrderedData); expect(seq.toString()).toEqual(immutableOrderedDataString); }); @@ -129,13 +148,19 @@ describe('Conversion', () => { it('Converts deep JSON with custom conversion including keypath if requested', () => { const paths: Array | undefined> = []; // eslint-disable-next-line @typescript-eslint/no-unused-vars - const seq1 = fromJS(js, function (key, sequence, keypath) { - expect(arguments.length).toBe(3); - paths.push(keypath); - return Array.isArray(this[key]) - ? sequence.toList() - : sequence.toOrderedMap(); - }); + const seq1 = fromJS( + js, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function (this: typeof js, key: any, sequence, keypath) { + expect(arguments.length).toBe(3); + paths.push(keypath); + + // @ts-expect-error -- any type for too complex object + return Array.isArray(this[key]) + ? sequence.toList() + : sequence.toOrderedMap(); + } + ); expect(paths).toEqual([ [], ['deepList'], diff --git a/__tests__/Equality.ts b/__tests__/Equality.ts index ae95ef4a12..0623877dc1 100644 --- a/__tests__/Equality.ts +++ b/__tests__/Equality.ts @@ -3,14 +3,14 @@ import { is, List, Map, Seq, Set } from 'immutable'; import fc from 'fast-check'; describe('Equality', () => { - function expectIs(left, right) { + function expectIs(left: unknown, right: unknown): void { const comparison = is(left, right); expect(comparison).toBe(true); const commutative = is(right, left); expect(commutative).toBe(true); } - function expectIsNot(left, right) { + function expectIsNot(left: unknown, right: unknown): void { const comparison = is(left, right); expect(comparison).toBe(false); const commutative = is(right, left); diff --git a/__tests__/KeyedSeq.ts b/__tests__/KeyedSeq.ts index 528c28f523..d9997afbc5 100644 --- a/__tests__/KeyedSeq.ts +++ b/__tests__/KeyedSeq.ts @@ -1,11 +1,12 @@ import { describe, expect, it } from '@jest/globals'; import { Range, Seq } from 'immutable'; import fc from 'fast-check'; +import invariant from '../src/utils/invariant'; describe('KeyedSeq', () => { it('iterates equivalently', () => { fc.assert( - fc.property(fc.array(fc.integer()), (ints) => { + fc.property(fc.array(fc.integer()), (ints: Array) => { const seq = Seq(ints); const keyed = seq.toKeyedSeq(); @@ -24,7 +25,7 @@ describe('KeyedSeq', () => { }); it('maintains keys', () => { - const isEven = (x) => x % 2 === 0; + const isEven = (x: number): boolean => x % 2 === 0; const seq = Range(0, 100); // This is what we expect for IndexedSequences @@ -39,6 +40,10 @@ describe('KeyedSeq', () => { const [indexed0, indexed1] = seq .partition(isEven) .map((part) => part.skip(10).take(5)); + + invariant(indexed0, 'indexed0 is not undefined'); + invariant(indexed1, 'indexed0 is not undefined'); + expect(indexed0.entrySeq().toArray()).toEqual([ [0, 21], [1, 23], @@ -67,6 +72,10 @@ describe('KeyedSeq', () => { const [keyed0, keyed1] = keyed .partition(isEven) .map((part) => part.skip(10).take(5)); + + invariant(keyed0, 'keyed0 is not undefined'); + invariant(keyed1, 'keyed1 is not undefined'); + expect(keyed0.entrySeq().toArray()).toEqual([ [21, 21], [23, 23], diff --git a/__tests__/List.ts b/__tests__/List.ts index da2e9d996b..bbad78d61c 100644 --- a/__tests__/List.ts +++ b/__tests__/List.ts @@ -2,6 +2,7 @@ import { describe, expect, it } from '@jest/globals'; import { fromJS, List, Map, Range, Seq, Set } from 'immutable'; import fc from 'fast-check'; import { create as createSeed } from 'random-seed'; +import invariant from '../src/utils/invariant'; function arrayOfSize(s: number) { const a = new Array(s); @@ -480,6 +481,8 @@ describe('List', () => { }); it.each(['remove', 'delete'])('remove removes any index', (fn) => { + invariant(fn === 'remove' || fn === 'delete', 'Invalid function name'); + let v = List.of('a', 'b', 'c')[fn](2)[fn](0); expect(v.size).toBe(1); expect(v.get(0)).toBe('b'); @@ -732,7 +735,7 @@ describe('List', () => { expect(v5.toJS().filter((item) => item === 0)).toHaveLength(0); // execute the same test as `v` but for the 2000 first integers - const isOkV1 = (v) => + const isOkV1 = (v: number): boolean => List.of() .set(v, v) .push('pushed-value') @@ -763,7 +766,7 @@ describe('List', () => { it('forEach iteration terminates when callback returns false', () => { const a: Array = []; - function count(x) { + function count(x: number): void | false { if (x > 2) { return false; } @@ -984,7 +987,7 @@ describe('List', () => { // Note: NaN is the only value not equal to itself. The isNaN() built-in // function returns true for any non-numeric value, not just the NaN value. - function isNaNValue(value) { + function isNaNValue(value: unknown): boolean { return value !== value; } diff --git a/__tests__/Map.ts b/__tests__/Map.ts index d8ae8b16ca..ad96b32d41 100644 --- a/__tests__/Map.ts +++ b/__tests__/Map.ts @@ -471,7 +471,7 @@ describe('Map', () => { it('uses toString on keys and values', () => { class A extends Record({ x: null as number | null }) { - toString() { + override toString() { return this.x; } } diff --git a/__tests__/OrderedSet.ts b/__tests__/OrderedSet.ts index 12c958072d..d493a27c0d 100644 --- a/__tests__/OrderedSet.ts +++ b/__tests__/OrderedSet.ts @@ -63,7 +63,7 @@ describe('OrderedSet', () => { * @see https://github.com/immutable-js/immutable-js/issues/1716 */ it('handles `subtract` when Set contains >=32 elements', () => { - const fillArray = (nb) => + const fillArray = (nb: number) => Array(nb) .fill(1) .map((el, i) => i + 1); diff --git a/__tests__/Predicates.ts b/__tests__/Predicates.ts index 0ab282205b..3f5c8fae16 100644 --- a/__tests__/Predicates.ts +++ b/__tests__/Predicates.ts @@ -43,7 +43,7 @@ describe('isValueObject', () => { this.v = val; } - equals(other) { + equals(other: MyValueType) { return Boolean(other && this.v === other.v); } diff --git a/__tests__/Seq.ts b/__tests__/Seq.ts index cbb048eb8b..6c2c5d236b 100644 --- a/__tests__/Seq.ts +++ b/__tests__/Seq.ts @@ -31,7 +31,7 @@ describe('Seq', () => { }); it('accepts an object with a next property', () => { - expect(Seq({ a: 1, b: 2, next: (_) => _ }).size).toBe(3); + expect(Seq({ a: 1, b: 2, next: (_: unknown) => _ }).size).toBe(3); }); it('accepts a collection string', () => { @@ -39,10 +39,11 @@ describe('Seq', () => { }); it('accepts arbitrary objects', () => { - function Foo() { + function Foo(this: { bar: string; baz: string }) { this.bar = 'bar'; this.baz = 'baz'; } + // @ts-expect-error -- any type for too complex object expect(Seq(new Foo()).size).toBe(2); }); diff --git a/__tests__/Set.ts b/__tests__/Set.ts index 5e8f1fe5d7..d10701bc54 100644 --- a/__tests__/Set.ts +++ b/__tests__/Set.ts @@ -305,7 +305,7 @@ describe('Set', () => { Symbol('a'), Symbol('b'), Symbol('c'), - ]; + ] as const; const symbolSet = Set(manySymbols); expect(symbolSet.size).toBe(12); diff --git a/__tests__/Stack.ts b/__tests__/Stack.ts index f3fc3d9326..f4e0a0fbf7 100644 --- a/__tests__/Stack.ts +++ b/__tests__/Stack.ts @@ -2,7 +2,7 @@ import { describe, expect, it } from '@jest/globals'; import { Seq, Stack } from 'immutable'; import fc from 'fast-check'; -function arrayOfSize(s) { +function arrayOfSize(s: number): Array { const a = new Array(s); for (let ii = 0; ii < s; ii++) { a[ii] = ii; diff --git a/__tests__/functional/get.ts b/__tests__/functional/get.ts index 901724f1c3..223d19ca8e 100644 --- a/__tests__/functional/get.ts +++ b/__tests__/functional/get.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from '@jest/globals'; import { get, Map, List, Range } from 'immutable'; +import invariant from '../../src/utils/invariant'; describe('get', () => { it('for immutable structure', () => { @@ -26,8 +27,10 @@ describe('get', () => { { x: 'xx', y: 'yy', - get: function (key: string) { - return `${this[key].toUpperCase()}`; + get: function (this, key: string) { + invariant(typeof this[key] === 'string', 'this[key] is a string'); + + return this[key].toUpperCase(); }, }, 'x' diff --git a/__tests__/groupBy.ts b/__tests__/groupBy.ts index bfaba132df..fa80a5ddf3 100644 --- a/__tests__/groupBy.ts +++ b/__tests__/groupBy.ts @@ -32,7 +32,7 @@ describe('groupBy', () => { isObject ? objectConstructor : iterableConstructor ); - const grouped = col.groupBy((v) => v); + const grouped = col.groupBy((v: unknown) => v); // all groupBy should be instance of Map expect(grouped).toBeInstanceOf(Map); diff --git a/__tests__/issues.ts b/__tests__/issues.ts index e283378cfc..78b3e27d2e 100644 --- a/__tests__/issues.ts +++ b/__tests__/issues.ts @@ -42,6 +42,7 @@ describe('Issue #1220 : Seq.rest() throws an exception when invoked on a single (typeof Symbol === 'function' && Symbol.iterator) || '@@iterator'; const r = Seq([1]).rest(); + // @ts-expect-error -- any type for too complex object const i = r[ITERATOR_SYMBOL](); expect(i.next()).toEqual({ value: undefined, done: true }); }); diff --git a/__tests__/merge.ts b/__tests__/merge.ts index 14e934b4c0..ac4a30d5b3 100644 --- a/__tests__/merge.ts +++ b/__tests__/merge.ts @@ -242,15 +242,18 @@ describe('merge', () => { ).toBe(true); }); - const map = { type: 'Map', value: Map({ b: 5, c: 9 }) }; - const object = { type: 'object', value: { b: 7, d: 12 } }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + type TypeValue = { type: any; value: any }; + + const map: TypeValue = { type: 'Map', value: Map({ b: 5, c: 9 }) }; + const object: TypeValue = { type: 'object', value: { b: 7, d: 12 } }; const RecordFactory = Record({ a: 1, b: 2 }); - const record = { type: 'Record', value: RecordFactory({ b: 3 }) }; - const list = { type: 'List', value: List(['5']) }; - const array = { type: 'array', value: ['9'] }; - const set = { type: 'Set', value: Set('3') }; + const record: TypeValue = { type: 'Record', value: RecordFactory({ b: 3 }) }; + const list: TypeValue = { type: 'List', value: List(['5']) }; + const array: TypeValue = { type: 'array', value: ['9'] }; + const set: TypeValue = { type: 'Set', value: Set('3') }; - const incompatibleTypes = [ + const incompatibleTypes: Array<[TypeValue, TypeValue]> = [ [map, list], [map, array], [map, set], diff --git a/__tests__/slice.ts b/__tests__/slice.ts index 07b763ff58..f527118dea 100644 --- a/__tests__/slice.ts +++ b/__tests__/slice.ts @@ -234,8 +234,9 @@ describe('slice', () => { (valuesLen, args) => { const a = Range(0, valuesLen).toArray(); const v = List(a); - const slicedV = v.slice.apply(v, args); - const slicedA = a.slice.apply(a, args); + + const slicedV = v.slice(...args); + const slicedA = a.slice(...args); expect(slicedV.toArray()).toEqual(slicedA); } ) @@ -251,8 +252,8 @@ describe('slice', () => { const a: Array = []; entries.forEach((entry) => (a[entry[0]] = entry[1])); const s = Seq(a); - const slicedS = s.slice.apply(s, args); - const slicedA = a.slice.apply(a, args); + const slicedS = s.slice(...args); + const slicedA = a.slice(...args); expect(slicedS.toArray()).toEqual(slicedA); } ) diff --git a/__tests__/splice.ts b/__tests__/splice.ts index cb90281016..0cd63e2d8f 100644 --- a/__tests__/splice.ts +++ b/__tests__/splice.ts @@ -51,12 +51,15 @@ describe('splice', () => { fc.assert( fc.property( fc.array(fc.integer()), - fc.array(fc.sparseArray(fc.integer())), - (values, args) => { + fc.integer(), + fc.integer(), + fc.array(fc.integer()), + (values, index, removeNum, insertValues) => { const v = List(values); const a = values.slice(); // clone - const splicedV = v.splice.apply(v, args); // persistent - a.splice.apply(a, args); // mutative + + const splicedV = v.splice(index, removeNum, ...insertValues); // persistent + a.splice(index, removeNum, ...insertValues); // mutative expect(splicedV.toArray()).toEqual(a); } ) diff --git a/__tests__/transformerProtocol.ts b/__tests__/transformerProtocol.ts index c3cedb3577..d0506b20e1 100644 --- a/__tests__/transformerProtocol.ts +++ b/__tests__/transformerProtocol.ts @@ -6,9 +6,10 @@ describe('Transformer Protocol', () => { it('transduces Stack without initial values', () => { const s = Stack.of(1, 2, 3, 4); const xform = t.comp( - t.filter((x) => x % 2 === 0), - t.map((x) => x + 1) + t.filter((x: number) => x % 2 === 0), + t.map((x: number) => x + 1) ); + // @ts-expect-error: transduce typing issue const s2 = t.transduce(xform, Stack(), s); expect(s.toArray()).toEqual([1, 2, 3, 4]); expect(s2.toArray()).toEqual([5, 3]); @@ -18,9 +19,10 @@ describe('Transformer Protocol', () => { const v1 = Stack.of(1, 2, 3); const v2 = Stack.of(4, 5, 6, 7); const xform = t.comp( - t.filter((x) => x % 2 === 0), - t.map((x) => x + 1) + t.filter((x: number) => x % 2 === 0), + t.map((x: number) => x + 1) ); + // @ts-expect-error: transduce typing issue const r = t.transduce(xform, Stack(), v1, v2); expect(v1.toArray()).toEqual([1, 2, 3]); expect(v2.toArray()).toEqual([4, 5, 6, 7]); @@ -30,9 +32,11 @@ describe('Transformer Protocol', () => { it('transduces List without initial values', () => { const v = List.of(1, 2, 3, 4); const xform = t.comp( - t.filter((x) => x % 2 === 0), - t.map((x) => x + 1) + t.filter((x: number) => x % 2 === 0), + t.map((x: number) => x + 1) ); + + // @ts-expect-error: transduce typing issue const r = t.transduce(xform, List(), v); expect(v.toArray()).toEqual([1, 2, 3, 4]); expect(r.toArray()).toEqual([3, 5]); @@ -42,9 +46,10 @@ describe('Transformer Protocol', () => { const v1 = List.of(1, 2, 3); const v2 = List.of(4, 5, 6, 7); const xform = t.comp( - t.filter((x) => x % 2 === 0), - t.map((x) => x + 1) + t.filter((x: number) => x % 2 === 0), + t.map((x: number) => x + 1) ); + // @ts-expect-error: transduce typing issue const r = t.transduce(xform, List(), v1, v2); expect(v1.toArray()).toEqual([1, 2, 3]); expect(v2.toArray()).toEqual([4, 5, 6, 7]); @@ -54,9 +59,10 @@ describe('Transformer Protocol', () => { it('transduces Map without initial values', () => { const m1 = Map({ a: 1, b: 2, c: 3, d: 4 }); const xform = t.comp( - t.filter(([_k, v]) => v % 2 === 0), - t.map(([k, v]) => [k, v * 2]) + t.filter(([_k, v]: [string, number]) => v % 2 === 0), + t.map(([k, v]: [string, number]) => [k, v * 2]) ); + // @ts-expect-error: transduce typing issue const m2 = t.transduce(xform, Map(), m1); expect(m1.toObject()).toEqual({ a: 1, b: 2, c: 3, d: 4 }); expect(m2.toObject()).toEqual({ b: 4, d: 8 }); @@ -66,9 +72,10 @@ describe('Transformer Protocol', () => { const m1 = Map({ a: 1, b: 2, c: 3 }); const m2 = Map({ a: 4, b: 5 }); const xform = t.comp( - t.filter(([_k, v]) => v % 2 === 0), - t.map(([k, v]) => [k, v * 2]) + t.filter(([_k, v]: [string, number]) => v % 2 === 0), + t.map(([k, v]: [string, number]) => [k, v * 2]) ); + // @ts-expect-error: transduce typing issue const m3 = t.transduce(xform, Map(), m1, m2); expect(m1.toObject()).toEqual({ a: 1, b: 2, c: 3 }); expect(m2.toObject()).toEqual({ a: 4, b: 5 }); @@ -78,9 +85,10 @@ describe('Transformer Protocol', () => { it('transduces Set without initial values', () => { const s1 = Set.of(1, 2, 3, 4); const xform = t.comp( - t.filter((x) => x % 2 === 0), - t.map((x) => x + 1) + t.filter((x: number) => x % 2 === 0), + t.map((x: number) => x + 1) ); + // @ts-expect-error: transduce typing issue const s2 = t.transduce(xform, Set(), s1); expect(s1.toArray()).toEqual([1, 2, 3, 4]); expect(s2.toArray()).toEqual([3, 5]); @@ -90,9 +98,10 @@ describe('Transformer Protocol', () => { const s1 = Set.of(1, 2, 3, 4); const s2 = Set.of(2, 3, 4, 5, 6); const xform = t.comp( - t.filter((x) => x % 2 === 0), - t.map((x) => x + 1) + t.filter((x: number) => x % 2 === 0), + t.map((x: number) => x + 1) ); + // @ts-expect-error: transduce typing issue const s3 = t.transduce(xform, Set(), s1, s2); expect(s1.toArray()).toEqual([1, 2, 3, 4]); expect(s2.toArray()).toEqual([2, 3, 4, 5, 6]); diff --git a/__tests__/tsconfig.json b/__tests__/tsconfig.json index 78742cd9bd..be2581c919 100644 --- a/__tests__/tsconfig.json +++ b/__tests__/tsconfig.json @@ -1,12 +1,7 @@ { + "extends": "../tsconfig.json", + "include": ["./"], "compilerOptions": { - "noEmit": true, - // TODO: add additional strictness - "strictNullChecks": true, - "strictFunctionTypes": true, - "target": "esnext", - "moduleResolution": "node", - "skipLibCheck": true, "paths": { "immutable": ["../type-definitions/immutable.d.ts"] } diff --git a/__tests__/updateIn.ts b/__tests__/updateIn.ts index 1ca054f979..f511091c53 100644 --- a/__tests__/updateIn.ts +++ b/__tests__/updateIn.ts @@ -3,13 +3,14 @@ import { fromJS, List, Map, - MapOf, + type MapOf, removeIn, Seq, Set, setIn, updateIn, } from 'immutable'; +import invariant from '../src/utils/invariant'; describe('updateIn', () => { it('deep edit', () => { @@ -81,6 +82,7 @@ describe('updateIn', () => { this.length = values.length; for (let i = 0; i < values.length; i++) { + // @ts-expect-error -- TypeScript does not know that this is a valid index this[i] = values[i]; } } @@ -101,6 +103,8 @@ describe('updateIn', () => { throw new RangeError('Index out of bounds'); } + invariant(typeof this[index] !== 'undefined', 'Index out of bounds'); + return this[index]; } } diff --git a/package-lock.json b/package-lock.json index 3e9cba0103..84465729fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "@types/prismjs": "^1.26.3", "@types/random-seed": "0.3.5", "@types/react": "19.1.0", + "@types/transducers-js": "^0.4.8", "benchmark": "2.1.4", "codemirror": "^6.0.1", "colors": "1.4.0", @@ -3602,6 +3603,13 @@ "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", "dev": true }, + "node_modules/@types/transducers-js": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/@types/transducers-js/-/transducers-js-0.4.8.tgz", + "integrity": "sha512-WMzIHF9H1R9/oJHogF4m2pp2OkmWp1eHFDXyZY7L8UTcgramikok09SPFCnH/TJxZ70ke4ubTksFjIHLCu3OLA==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", @@ -16120,6 +16128,12 @@ "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", "dev": true }, + "@types/transducers-js": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/@types/transducers-js/-/transducers-js-0.4.8.tgz", + "integrity": "sha512-WMzIHF9H1R9/oJHogF4m2pp2OkmWp1eHFDXyZY7L8UTcgramikok09SPFCnH/TJxZ70ke4ubTksFjIHLCu3OLA==", + "dev": true + }, "@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", diff --git a/package.json b/package.json index 833b0ec6c5..dd251f1186 100644 --- a/package.json +++ b/package.json @@ -106,6 +106,7 @@ "@types/prismjs": "^1.26.3", "@types/random-seed": "0.3.5", "@types/react": "19.1.0", + "@types/transducers-js": "^0.4.8", "benchmark": "2.1.4", "codemirror": "^6.0.1", "colors": "1.4.0", diff --git a/resources/jestPreprocessor.js b/resources/jestPreprocessor.js index 5ea6aa5036..c334f071cd 100644 --- a/resources/jestPreprocessor.js +++ b/resources/jestPreprocessor.js @@ -3,11 +3,11 @@ const makeSynchronous = require('make-synchronous'); const TYPESCRIPT_OPTIONS = { noEmitOnError: true, - target: typescript.ScriptTarget.ES2015, + target: typescript.ScriptTarget.ES2022, module: typescript.ModuleKind.CommonJS, - strictNullChecks: true, sourceMap: true, inlineSourceMap: true, + esModuleInterop: true, }; function transpileTypeScript(src, path) {