diff --git a/packages/core/src/template-colocation-plugin.ts b/packages/core/src/template-colocation-plugin.ts index c34dfa236..9994fd456 100644 --- a/packages/core/src/template-colocation-plugin.ts +++ b/packages/core/src/template-colocation-plugin.ts @@ -90,7 +90,7 @@ export default function main(babel: unknown) { ), ]); } - } else if (isTSDeclareFunction(t, declaration)) { + } else if (t.isTSDeclareFunction(declaration)) { // we don't rewrite this } else { let local = importTemplate(path, state.adder, state.colocatedTemplate); @@ -127,12 +127,6 @@ export default function main(babel: unknown) { }; } -// this is here because babel6 doesn't offer this function, but we still want it -// to provide type exhaustiveness when it's missing -function isTSDeclareFunction(t: BabelTypes, dec: any): dec is t.TSDeclareFunction { - return t.isTSDeclareFunction?.(dec); -} - function importTemplate(target: NodePath, adder: ImportAdder, colocatedTemplate: string) { return adder.import(target, explicitRelative(dirname(colocatedTemplate), colocatedTemplate), 'default', 'TEMPLATE'); }