@bonniernews/local-esi
Advanced tools
Comparing version 0.5.0 to 0.5.1
17
index.js
@@ -342,2 +342,5 @@ "use strict"; | ||
if (arrayMatch) { | ||
if (!context.assigns[arrayMatch[1]]) { | ||
return ""; | ||
} | ||
return context.assigns[arrayMatch[1]][arrayMatch[2]]; | ||
@@ -478,4 +481,14 @@ } | ||
if (node.operator === "has_i") return left.toLowerCase().indexOf(right.toLowerCase()) > -1; | ||
if (node.operator === "matches") return left.match(right); | ||
if (node.operator === "matches_i") return left.match(new RegExp(right, "i")); | ||
if (node.operator === "matches") { | ||
if (!left) { | ||
return null; | ||
} | ||
return left.match(right); | ||
} | ||
if (node.operator === "matches_i") { | ||
if (!left) { | ||
return null; | ||
} | ||
return left.match(new RegExp(right, "i")); | ||
} | ||
@@ -482,0 +495,0 @@ throw new Error(`Uknown BinaryExpression operator ${node.operator}`); |
{ | ||
"name": "@bonniernews/local-esi", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Local Edge Side Includes parser", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21595
614