15 lines
421 B
TypeScript
15 lines
421 B
TypeScript
import { branch, compile } from "../core/config";
|
|
import type { Config, PresetJson } from "../core/type";
|
|
|
|
export default (preset: PresetJson): Config[] => {
|
|
const config: Config = compile(preset["default"] || {});
|
|
const result: Config[] = [];
|
|
for (const [k, v] of Object.entries(preset)) {
|
|
if (k == "default") {
|
|
continue;
|
|
}
|
|
result.push(branch(config, { ...v, name: k }));
|
|
}
|
|
return result;
|
|
};
|