-
Notifications
You must be signed in to change notification settings - Fork 505
Closed
Labels
solution: duplicateThis issue or pull request already existsThis issue or pull request already existssolution: workaround availableThere is a workaround available for this issueThere is a workaround available for this issuetopic: downlevelIterationRelated to tsconfig downlevelIterationRelated to tsconfig downlevelIteration
Milestone
Description
Current Behavior
$ tsdx create -> basic
Node.js Buffer object with spread operator has wrong value.
tsconfig.json
{
"include": ["src", "types"],
"compilerOptions": {
"module": "esnext",
"lib": ["dom", "esnext"],
"importHelpers": true,
"declaration": true,
"sourceMap": true,
"rootDir": "./src",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"baseUrl": "./",
"paths": {
"*": ["src/*", "node_modules/*"]
},
"jsx": "react",
"esModuleInterop": true,
"downlevelIteration": true
}
}
Expected behavior
Got value Buffer <[1,2,3,4,5,6]>
Suggested solution(s)
might be rollup config. because below tsconfig.js without tsdx transpiled and got values correctly. so at least it should not be typescript bug.
I avoid using spread operator ... on Buffer. Switch to ...Buffer.from([1,2,3]).toJSON().data for now as workaround.
below tsconfig.json with typescript Version 3.9.6 works
{
"compilerOptions": {
"target": "es2018",
"module": "commonjs",
"outDir": "dist",
"lib": ["es2018", "esnext.asynciterable", "DOM"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"downlevelIteration": true
}
}
Additional context
Your environment
| Software | Version(s) |
|---|---|
| TSDX | 0.13.2 with tsdx create -> basic |
| TypeScript | 3.9.6 |
| Browser | |
| npm/Yarn | 1.22.4 |
| Node | v13.7.0 |
| Operating System | MacOS Catalina 10.15.5 (19F101) |
Metadata
Metadata
Assignees
Labels
solution: duplicateThis issue or pull request already existsThis issue or pull request already existssolution: workaround availableThere is a workaround available for this issueThere is a workaround available for this issuetopic: downlevelIterationRelated to tsconfig downlevelIterationRelated to tsconfig downlevelIteration