Skip to content

Commit

Permalink
Remove duplicate methods from TemplateCompilerNode
Browse files Browse the repository at this point in the history
These methods match the super classes implementation. This removes the
duplication.
  • Loading branch information
rwjblue committed Mar 29, 2021
1 parent f0f3717 commit 5a2ae88
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions packages/core/src/template-compiler-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,35 +51,4 @@ export class NodeTemplateCompiler extends TemplateCompiler {
} as InlineBabelParams,
];
}

baseDir() {
return join(__dirname, '..');
}

// tests for the classic ember-cli-htmlbars-inline-precompile babel plugin
static isInlinePrecompilePlugin(item: PluginItem) {
if (typeof item === 'string') {
return matchesSourceFile(item);
}
if (hasProperties(item) && (item as any)._parallelBabel) {
return matchesSourceFile((item as any)._parallelBabel.requireFile);
}
if (Array.isArray(item) && item.length > 0) {
if (typeof item[0] === 'string') {
return matchesSourceFile(item[0]);
}
if (hasProperties(item[0]) && (item[0] as any)._parallelBabel) {
return matchesSourceFile((item[0] as any)._parallelBabel.requireFile);
}
}
return false;
}
}

function matchesSourceFile(filename: string) {
return /(htmlbars-inline-precompile|ember-cli-htmlbars)\/(index|lib\/require-from-worker)(\.js)?$/.test(filename);
}

function hasProperties(item: any) {
return item && (typeof item === 'object' || typeof item === 'function');
}

0 comments on commit 5a2ae88

Please sign in to comment.