Cypher actor @Embed (#1)
Reviewed-on: #1 Co-authored-by: Mike Bloy <mike@bloy.org> Co-committed-by: Mike Bloy <mike@bloy.org>
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
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));
|
||||
}
|
||||
Reference in New Issue
Block a user