Skip to content

Commit a37880f

Browse files
committed
Allow to use with TypeScript > 5.0
1 parent 315b73c commit a37880f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"homepage": "https://github.com/timocov/ts-transformer-properties-rename",
2828
"peerDependencies": {
29-
"typescript": ">=4.3.0"
29+
"typescript": ">=4.3.0 || >=5.0.0-beta"
3030
},
3131
"devDependencies": {
3232
"@types/chai": "~4.3.3",

src/typescript-helpers.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ export function hasPrivateKeyword(node: ClassMember | ts.ParameterDeclaration):
128128
return hasModifier(node, ts.SyntaxKind.PrivateKeyword);
129129
}
130130

131+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
132+
// @ts-ignore
131133
function getModifiers(node: ts.Node): readonly NonNullable<ts.Node['modifiers']>[number][] {
132134
if (isBreakingTypeScriptApi(ts)) {
133135
if (!ts.canHaveModifiers(node)) {
@@ -137,6 +139,8 @@ function getModifiers(node: ts.Node): readonly NonNullable<ts.Node['modifiers']>
137139
return ts.getModifiers(node) || [];
138140
}
139141

142+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
143+
// @ts-ignore
140144
// eslint-disable-next-line deprecation/deprecation
141145
return node.modifiers || [];
142146
}
@@ -154,6 +158,8 @@ function getDecorators(node: ts.Node): readonly unknown[] {
154158
return ts.getDecorators(node) || [];
155159
}
156160

161+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
162+
// @ts-ignore
157163
// eslint-disable-next-line deprecation/deprecation
158164
return node.decorators || [];
159165
}

0 commit comments

Comments
 (0)