mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
17 lines
399 B
JavaScript
17 lines
399 B
JavaScript
import { glob } from '@fesjs/utils';
|
|
import { getValidFiles } from '.';
|
|
|
|
export function getModels(cwd, pattern) {
|
|
const files = glob
|
|
.sync(pattern || '**/*.{js,jsx}', {
|
|
cwd
|
|
})
|
|
.filter(
|
|
file => !file.endsWith('.d.ts')
|
|
&& !file.endsWith('.test.js')
|
|
&& !file.endsWith('.test.jsx')
|
|
);
|
|
|
|
return getValidFiles(files, cwd);
|
|
}
|