@ts-intl/dependency
Version:
I18n keys dependency analysis
32 lines (31 loc) • 1.16 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeMadgeConfig = exports.offsprings = void 0;
const offsprings = (id, graph, visit = {}) => {
const res = [];
(graph[id] || []).forEach((dep) => {
if (visit[dep])
return;
visit[dep] = true;
res.push(dep);
res.push(...(0, exports.offsprings)(dep, graph, visit));
});
return res;
};
exports.offsprings = offsprings;
const mergeMadgeConfig = (config) => {
const tsConfig = typeof config.tsConfig === 'object'
? JSON.parse(JSON.stringify(config.tsConfig))
: {};
tsConfig.compilerOptions = Object.assign(Object.assign({}, tsConfig.compilerOptions), { moduleResolution: 'Node', esModuleInterop: true, baseUrl: config.baseDir });
return Object.assign(Object.assign({ fileExtensions: ['.ts', '.tsx'], detectiveOptions: {
noTypeDefinitions: true,
ts: {
skipTypeImports: true,
// mixedImports: true,
},
} }, config), {
// high priority
tsConfig });
};
exports.mergeMadgeConfig = mergeMadgeConfig;