@bigcommerce/stencil-paper
Advanced tools
Comparing version 2.0.23 to 2.0.24
'use strict'; | ||
const common = require('../lib/common.js'); | ||
function helper(paper) { | ||
paper.handlebars.registerHelper('replace', function (needle, haystack) { | ||
needle = common.unwrapIfSafeString(needle); | ||
haystack = common.unwrapIfSafeString(haystack); | ||
const options = arguments[arguments.length - 1]; | ||
@@ -6,0 +10,0 @@ |
{ | ||
"name": "@bigcommerce/stencil-paper", | ||
"version": "2.0.23", | ||
"version": "2.0.24", | ||
"description": "A stencil plugin to register partials and helpers from handlebars and returns the compiled version for the stencil platform.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -17,2 +17,3 @@ var Code = require('code'), | ||
price: '$49.99', | ||
facet: 'brand', | ||
}; | ||
@@ -49,2 +50,9 @@ | ||
it('should work nicely with other helpers that use safestring', function(done) { | ||
expect(c("Replace+Concat+Hyphenated: fifth-{{#replace '&' (concat '&' (hyphenate facet)) }}{{/replace}}", context)) | ||
.to.be.equal("Replace+Concat+Hyphenated: fifth-brand"); | ||
done(); | ||
}); | ||
it('should gracefully handle not strings', function(done) { | ||
@@ -51,0 +59,0 @@ expect(c("{{#replace something price}}{{/replace}}", context)) |
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
172925
4248