nestjs-autoloader
Version:
Module autoloading for NestJS
14 lines (13 loc) • 506 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.isScript = isScript;
const testInfixes = ['test', 'spec', 'e2e-test', 'e2e-spec'];
function isScript(name) {
return (
// Include js and ts files.
(name.endsWith('.js') || name.endsWith('.ts')) &&
// Exclude type mappings.
!name.endsWith('.d.ts') &&
// Exclude test-related files.
!testInfixes.find((infix) => name.endsWith(`.${infix}.ts`) || name.endsWith(`.${infix}.js`)));
}
;