content-entry-transform 1.4.0 → 1.4.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "content-entry-transform",
3
- "version": "1.4.0",
3
+ "version": "1.4.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -25,7 +25,7 @@
25
25
  "lint:docs": "documentation lint ./src/**/*.mjs"
26
26
  },
27
27
  "dependencies": {
28
- "content-entry": "^5.0.1",
28
+ "content-entry": "^5.0.2",
29
29
  "iterable-string-interceptor": "^2.0.0"
30
30
  },
31
31
  "devDependencies": {
@@ -13,14 +13,22 @@ export function createPropertiesInterceptor(properties) {
13
13
  leadOut
14
14
  ) {
15
15
  function ev(e, deepth) {
16
- if (deepth > 9) throw new Error(`Probably circular reference evaluating: ${expression}`);
16
+ if (deepth > 9) {
17
+ throw new Error(
18
+ `Probably circular reference evaluating: ${expression}`
19
+ );
20
+ }
17
21
  const value = properties[e];
18
22
  if (value !== undefined) {
19
23
  if (typeof value === "string") {
20
24
  const li = value.indexOf(leadIn);
21
25
  if (li >= 0) {
22
26
  const lo = value.indexOf(leadOut, li + leadIn.length);
23
- return ev(value.substring(li + leadIn.length, lo), deepth + 1);
27
+ return (
28
+ value.substring(0, li) +
29
+ ev(value.substring(li + leadIn.length, lo), deepth + 1) +
30
+ value.substring(lo + leadOut.length)
31
+ );
24
32
  }
25
33
  }
26
34
  return value;