Skip to content

Commit

Permalink
Merge pull request #988 from embroider-build/remove-babel6-compat
Browse files Browse the repository at this point in the history
removing leftover babel 6 compatibility code
  • Loading branch information
ef4 authored Sep 30, 2021
2 parents 9e6260f + 80e194f commit f02ff6a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/core/src/template-colocation-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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<t.Node>, adder: ImportAdder, colocatedTemplate: string) {
return adder.import(target, explicitRelative(dirname(colocatedTemplate), colocatedTemplate), 'default', 'TEMPLATE');
}

0 comments on commit f02ff6a

Please sign in to comment.