@bemoje/template 2.0.0 → 2.0.1
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/lib/index.cjs +1 -3
- package/lib/index.js +1 -3
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -63,9 +63,7 @@ var Template = class {
|
|
|
63
63
|
const stringTemplate = this.strategy.templateToString(this.template);
|
|
64
64
|
const merged = value.Value.Cast(this.optionsSchema, data);
|
|
65
65
|
assertValidSchema(this.optionsSchema, merged, "Invalid options");
|
|
66
|
-
const populated = stringTemplate.replaceAll(/{{(\w+)}}/g, (_, key) =>
|
|
67
|
-
return String(merged[key]);
|
|
68
|
-
});
|
|
66
|
+
const populated = stringTemplate.replaceAll(/{{(\w+)}}/g, (_, key) => String(merged[key]));
|
|
69
67
|
return this.strategy.render(populated);
|
|
70
68
|
}
|
|
71
69
|
/**
|
package/lib/index.js
CHANGED
|
@@ -61,9 +61,7 @@ var Template = class {
|
|
|
61
61
|
const stringTemplate = this.strategy.templateToString(this.template);
|
|
62
62
|
const merged = Value.Cast(this.optionsSchema, data);
|
|
63
63
|
assertValidSchema(this.optionsSchema, merged, "Invalid options");
|
|
64
|
-
const populated = stringTemplate.replaceAll(/{{(\w+)}}/g, (_, key) =>
|
|
65
|
-
return String(merged[key]);
|
|
66
|
-
});
|
|
64
|
+
const populated = stringTemplate.replaceAll(/{{(\w+)}}/g, (_, key) => String(merged[key]));
|
|
67
65
|
return this.strategy.render(populated);
|
|
68
66
|
}
|
|
69
67
|
/**
|