Skip to content

Commit b7fd874

Browse files
committed
Remove passes of decorators to TS factory functions
1 parent 503164e commit b7fd874

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

scripts/build/create-overloads.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,10 @@ function keepPublicFunctionsTransformer(
149149
) {
150150
return factory.updateParameterDeclaration(
151151
param,
152-
param.decorators,
153-
param.modifiers,
152+
[
153+
...(ts.getDecorators(param) || []),
154+
...(ts.getModifiers(param) || []),
155+
],
154156
param.dotDotDotToken,
155157
param.name,
156158
param.questionToken,
@@ -176,8 +178,7 @@ function keepPublicFunctionsTransformer(
176178
overloads.push(
177179
factory.updateFunctionDeclaration(
178180
node,
179-
node.decorators,
180-
[],
181+
ts.getModifiers(node),
181182
node.asteriskToken,
182183
node.name,
183184
node.typeParameters,
@@ -216,7 +217,6 @@ function keepPublicFunctionsTransformer(
216217

217218
// hardcode adding `import { FirebaseApp as FirebaseAppCompat } from '@firebase/app-compat'`
218219
const appCompatImport = factory.createImportDeclaration(
219-
undefined,
220220
undefined,
221221
factory.createImportClause(
222222
false,
@@ -233,7 +233,6 @@ function keepPublicFunctionsTransformer(
233233
);
234234

235235
const importStatement = factory.createImportDeclaration(
236-
undefined,
237236
undefined,
238237
factory.createImportClause(
239238
false,
@@ -251,7 +250,6 @@ function keepPublicFunctionsTransformer(
251250
factory.createStringLiteral(moduleNameToEnhance)
252251
);
253252
const moduleToEnhance = factory.createModuleDeclaration(
254-
undefined,
255253
[factory.createModifier(ts.SyntaxKind.DeclareKeyword)],
256254
factory.createStringLiteral(moduleNameToEnhance),
257255
factory.createModuleBlock(overloads)

0 commit comments

Comments
 (0)