feat: add isModule
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
const MOD_EXCLUDE: Array<string> = ['.d.ts'];
|
||||
const MOD_INCLUDE: Array<string> = ['.ts', '.js', '.mjs', '.cjs'];
|
||||
export function isModule(path: string): boolean {
|
||||
for (const ext of MOD_EXCLUDE) if (path.endsWith(ext)) return false;
|
||||
|
||||
for (const ext of MOD_INCLUDE) if (path.endsWith(ext)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
Reference in New Issue
Block a user