Skip to content

Commit

Permalink
feat(typescript): bumped to TypeScript 4.7
Browse files Browse the repository at this point in the history
BREAKING CHANGE: TypeScript 4.6 has a breaking API (and ABI) surface
  • Loading branch information
grantila committed Jun 18, 2022
1 parent 1ae1e9f commit 3e01981
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion lib/json-schema-to-suretype.ts
Expand Up @@ -350,6 +350,8 @@ function createImportHeader(
annotate: boolean
)
{
const hasNonTypeImport = regular || raw || compile || annotate;

const importedMembers = [
...( regular ? [ 'suretype', 'v' ] : [ ] ),
...( raw ? [ 'raw' ] : [ ] ),
Expand All @@ -358,7 +360,11 @@ function createImportHeader(
...( TypeOf ? [ 'TypeOf' ] : [ ] ),
]
.map( name =>
factory.createImportSpecifier( undefined, t.ident( name ) )
factory.createImportSpecifier(
!hasNonTypeImport,
undefined,
t.ident( name )
)
);
return factory.createImportDeclaration(
undefined, // decorators
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -40,14 +40,14 @@
"dependencies": {
"@types/json-schema": "^7.0.9",
"core-types": "^1.10.0",
"core-types-json-schema": "^1.6.2",
"core-types-ts": "^1.5.0",
"core-types-json-schema": "^1.6.3",
"core-types-ts": "^2.0.0",
"json-schema-cycles": "^1.1.0",
"jsonpos": "^1.1.0",
"openapi-json-schema": "^1.1.3",
"suretype": "^2.4.1",
"toposort": "^2.0.2",
"typescript": "^4.4.3"
"typescript": "^4.7.4"
},
"devDependencies": {
"@types/jest": "^27.0.1",
Expand Down

0 comments on commit 3e01981

Please sign in to comment.