summaryrefslogtreecommitdiff
path: root/src/services/chart/entities.ts
blob: 23a97607eb467494be39b5aac132fb707477dabb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { fileURLToPath } from 'url';
import { dirname } from 'path';
import Chart from './core';

//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);
	}
}));