Skip to content

Commit

Permalink
TB 0.28.3 | Variadic Type Expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclairzx81 committed Apr 21, 2023
1 parent df4bf05 commit ec6b18d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
9 changes: 3 additions & 6 deletions example/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ function Print(transform: string, code: any) {
console.log('')
}
const Code = `
export interface Vector {
x: number
y: number
z: number
}
type A = Vector['x']
type A = [0, 1]
type B = [2, 3]
type C = [...A, ...B]
`
// ----------------------------------------------------------------------------
// Immediate Transform
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@types/prettier": "^2.7.2"
},
"dependencies": {
"@sinclair/typebox": "^0.28.1",
"@sinclair/typebox": "^0.28.3",
"prettier": "^2.8.7",
"typescript": "^5.0.4"
},
Expand Down
2 changes: 1 addition & 1 deletion src/typescript/typescript-to-typebox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export namespace TypeScriptToTypeBox {
yield Collect(node.type)
}
function* RestTypeNode(node: ts.RestTypeNode): IterableIterator<string> {
yield `Type.Rest()`
yield `...Type.Rest(${node.type.getText()})`
}
function* ConditionalTypeNode(node: ts.ConditionalTypeNode): IterableIterator<string> {
const checkType = Collect(node.checkType)
Expand Down

0 comments on commit ec6b18d

Please sign in to comment.