monkeeShark/src/services/chart/entities.ts
syuilo b9cb6d1c10 refactor: refactoring imports
将来ESMに移行しやすいように
Related: #7658

なんかmochaが起動しなくなってるけど理由不明
すぐ直したい
2021-08-19 18:33:41 +09:00

15 lines
429 B
TypeScript

import { fileURLToPath } from 'url';
import { dirname } from 'path';
import Chart from './core.js';
//const _filename = fileURLToPath(import.meta.url);
const _filename = __filename;
const _dirname = dirname(_filename);
export const entities = Object.values(require('require-all')({
dirname: _dirname + '/charts/schemas',
filter: /^.+\.[jt]s$/,
resolve: (x: any) => {
return Chart.schemaToEntity(x.name, x.schema);
}
}));