@hostwebhook/template-engine 1.1.0 → 1.1.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/dist/index.js CHANGED
@@ -377,7 +377,9 @@ function resolveJsonValue(value, ctx, opts) {
377
377
  return !val;
378
378
  }
379
379
  if (/\|\s*\w+/.test(expr)) {
380
- return evaluate(expr, ctx, opts);
380
+ const result = evaluate(expr, ctx, opts);
381
+ if (result !== "" && isFinite(Number(result))) return Number(result);
382
+ return result;
381
383
  }
382
384
  const resolved = resolvePath(expr, ctx);
383
385
  if (resolved !== void 0) return resolved;
package/dist/index.mjs CHANGED
@@ -335,7 +335,9 @@ function resolveJsonValue(value, ctx, opts) {
335
335
  return !val;
336
336
  }
337
337
  if (/\|\s*\w+/.test(expr)) {
338
- return evaluate(expr, ctx, opts);
338
+ const result = evaluate(expr, ctx, opts);
339
+ if (result !== "" && isFinite(Number(result))) return Number(result);
340
+ return result;
339
341
  }
340
342
  const resolved = resolvePath(expr, ctx);
341
343
  if (resolved !== void 0) return resolved;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostwebhook/template-engine",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Template interpolation and sandboxed JS execution engine for HostWebhook",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",