From 641b69280413f3f43eccb92fbd74ac99f9f1ec35 Mon Sep 17 00:00:00 2001 From: Mark Silverwood <3482679+SlicedSilver@users.noreply.github.com> Date: Wed, 15 May 2024 16:46:39 +0100 Subject: [PATCH 1/2] update typescript to v5 --- package.json | 6 +++--- src/transformer.ts | 6 +++--- tests/test-cases/simple/output.js | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index a8b3348..7280188 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "ts-transformer-strip-const-enums", - "version": "1.0.1", + "version": "2.0.0", "description": "A TypeScript custom transformer which strips const enums if preserveConstEnums is enabled and const enum isn't exported", "main": "dist/transformer.js", "repository": { @@ -26,7 +26,7 @@ }, "homepage": "https://github.com/timocov/ts-transformer-strip-const-enums", "peerDependencies": { - "typescript": ">=3.0.0" + "typescript": ">=5.0.0" }, "devDependencies": { "@types/chai": "~4.2.11", @@ -38,7 +38,7 @@ "rimraf": "~3.0.2", "ts-node": "~8.10.1", "tslint": "~6.1.2", - "typescript": "~3.8.3" + "typescript": "~5.4.5" }, "scripts": { "clean": "rimraf lib/ dist/", diff --git a/src/transformer.ts b/src/transformer.ts index 1de787f..b32a179 100644 --- a/src/transformer.ts +++ b/src/transformer.ts @@ -69,8 +69,8 @@ function createTransformerFactory(program: ts.Program, options?: Partial getActualSymbol(symbol)); } - function hasModifier(node: ts.Node, modifier: ts.SyntaxKind): boolean { - return node.modifiers !== undefined && node.modifiers.some((mod: ts.Modifier) => mod.kind === modifier); + function hasModifier(node: ts.EnumDeclaration, modifier: ts.SyntaxKind): boolean { + return node.modifiers !== undefined && node.modifiers.some((mod: ts.ModifierLike) => mod.kind === modifier); } if (!compilerOptions.preserveConstEnums) { @@ -112,7 +112,7 @@ function createTransformerFactory(program: ts.Program, options?: Partial Date: Wed, 15 May 2024 16:48:28 +0100 Subject: [PATCH 2/2] update other devDependencies --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 7280188..7a3824b 100644 --- a/package.json +++ b/package.json @@ -29,14 +29,14 @@ "typescript": ">=5.0.0" }, "devDependencies": { - "@types/chai": "~4.2.11", - "@types/mocha": "~7.0.2", - "@types/node": "~13.13.4", - "chai": "~4.2.0", - "mocha": "~7.1.2", + "@types/chai": "~4.3.16", + "@types/mocha": "~10.0.6", + "@types/node": "~20.12.12", + "chai": "~5.1.1", + "mocha": "~10.4.0", "npm-run-all": "~4.1.5", - "rimraf": "~3.0.2", - "ts-node": "~8.10.1", + "rimraf": "~5.0.7", + "ts-node": "~10.9.2", "tslint": "~6.1.2", "typescript": "~5.4.5" },