Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bigcommerce/stencil-paper

Package Overview
Dependencies
Maintainers
2
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bigcommerce/stencil-paper - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

helpers/all.js

42

helpers/any.js

@@ -16,11 +16,43 @@ var _ = require('lodash'),

internals.implementation.prototype.register = function(context) {
this.handlebars.registerHelper('any', function(collection, options) {
var predicate = options.hash,
any = _.any(collection, predicate);
this.handlebars.registerHelper('any', function() {
var args = [],
opts,
predicate,
any;
// Translate arguments to array safely
for (var i = 0; i < arguments.length; i++) {
args.push(arguments[i]);
}
// Take the last argument (content) out of testing array
opts = args.pop();
predicate = opts.hash;
if (!_.isEmpty(predicate)) {
// With options hash, we check the contents of first argument
any = _.any(args[0], predicate);
} else {
// Without options hash, we check all the arguments
any = _.any(args, function(arg) {
if (_.isArray(arg)) {
return !!arg.length;
}
// If an empty object is passed, arg is false
else if (_.isEmpty(arg) && _.isObject(arg)) {
return false;
}
// Everything else
else {
return !!arg;
}
});
}
if (any) {
return options.fn(this);
return opts.fn(this);
}
return options.inverse(this);
return opts.inverse(this);
});

@@ -27,0 +59,0 @@ };

@@ -9,4 +9,8 @@ var internals = {};

this.handlebars.registerHelper('replace', function(needle, haystack, options) {
var contains = haystack.indexOf(needle) > -1;
var contains = false;
if (typeof(haystack) === 'string') {
contains = haystack.indexOf(needle) > -1;
}
// Yield block if true

@@ -13,0 +17,0 @@ if (contains) {

2

package.json
{
"name": "@bigcommerce/stencil-paper",
"version": "1.0.5",
"version": "1.0.6",
"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",

@@ -31,2 +31,10 @@ var Code = require('code'),

it('should handle undefined values', function(done) {
var context = {};
expect(c(templates, context))
.to.be.equal('');
done();
});
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc