@ztimson/utils 0.27.16 → 0.27.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2322,10 +2322,10 @@ ${opts.message || this.desc}`;
|
|
|
2322
2322
|
const nested = matchAll(found[0], /\{\{\s*?\?.+?}}/g).slice(-1)?.[0]?.index;
|
|
2323
2323
|
if (nested != 0)
|
|
2324
2324
|
found = /\{\{\s*?\?\s*?(.+?)\s*?}}([\s\S]*?)(?:\{\{\s*?!\?\s*?}}([\s\S]*?))?\{\{\s*?\/\?\s*?}}/g.exec(content.slice(found.index + nested));
|
|
2325
|
-
content = content.
|
|
2325
|
+
content = content.replace(found[0], (evaluate(found[1], d, false) ? found[2] : found[3]) || "");
|
|
2326
2326
|
}
|
|
2327
2327
|
while (!!(found = /\{\{\s*?<\s*?(.+?)\s*?}}/g.exec(content))) {
|
|
2328
|
-
content = content.
|
|
2328
|
+
content = content.replace(found[0], await renderTemplate(await fetch2(found[1].trim()), data, fetch2));
|
|
2329
2329
|
}
|
|
2330
2330
|
while (!!(found = /\{\{\s*?\*\s*?(.+?)\s+in\s+(.+?)\s*?}}([\s\S]*?)\{\{\s*?\/\*\s*?}}/g.exec(content))) {
|
|
2331
2331
|
const split = found[1].replaceAll(/[()\s]/g, "").split(",");
|
|
@@ -2342,10 +2342,10 @@ ${opts.message || this.desc}`;
|
|
|
2342
2342
|
[index]: i
|
|
2343
2343
|
}, fetch2));
|
|
2344
2344
|
}
|
|
2345
|
-
content = content.
|
|
2345
|
+
content = content.replace(found[0], compiled.join("\n"));
|
|
2346
2346
|
}
|
|
2347
2347
|
while (!!(found = /\{\{\s*([^<>\*\?!/}\s][^}]*?)\s*}}/g.exec(content))) {
|
|
2348
|
-
content = content.
|
|
2348
|
+
content = content.replace(found[0], evaluate(found[1].trim(), d) || "");
|
|
2349
2349
|
}
|
|
2350
2350
|
while (!!(found = /\{\{\s*?>\s*?(.+?):(.+?)\s*?}}([\s\S]*?)\{\{\s*?\/>\s*?}}/g.exec(content))) {
|
|
2351
2351
|
content = content.replace(found[0], await renderTemplate(await fetch2(found[1].trim), {
|