Files
mb-cypher2/scripts/module.js
T
mike fda78257f9 Cypher actor @Embed (#1)
Reviewed-on: #1
Co-authored-by: Mike Bloy <mike@bloy.org>
Co-committed-by: Mike Bloy <mike@bloy.org>
2026-09-26 04:47:30 +00:00

20 lines
552 B
JavaScript

export const MODULE_ID = "mb-cypher2";
export function log(...args) {
console.log(`${MODULE_ID} |`, ...args);
}
export function normalizeTemplatePaths(paths, baseDir = "") {
const templates = {};
log("finding templates", paths, baseDir);
const basePath = `modules/${MODULE_ID}/templates${baseDir ? "/" + baseDir : ""}`;
for (const file of paths) {
templates[file] = `${basePath}/${file}`;
}
return templates;
}
export async function preloadTemplatePaths(normalizedPaths) {
return loadTemplates(Object.values(normalizedPaths));
}