Skip to content
This repository was archived by the owner on Jan 31, 2023. It is now read-only.

Commit f549896

Browse files
authored
fix: Fix TypeScript iterator support. (#43)
1 parent 24117d0 commit f549896

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/simple_tsify.js

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module.exports = function (b, opts) {
3333
compilerOptions: {
3434
esModuleInterop: true,
3535
jsx: 'react',
36+
downlevelIteration: true,
3637
},
3738
}).outputText)
3839
}

test/fixtures/typescript/math_spec.ts

+5
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@ context('math.ts', function () {
1515
it('test ts-typed variable', function () {
1616
expect(x).to.eq(3)
1717
})
18+
it('test iterator', () => {
19+
const arr = [...Array(100).keys()]
20+
21+
expect(arr[0] + arr[1]).to.eq(1)
22+
})
1823
})

0 commit comments

Comments
 (0)