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

load-helpers

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

load-helpers - npm Package Compare versions

Comparing version 0.2.11 to 0.3.0

README.md

20

index.js

@@ -10,10 +10,12 @@ /*!

var util = require('util');
var Emitter = require('component-emitter');
var utils = require('./utils');
module.exports = function(cache, options) {
module.exports = Emitter(loadHelpers);
function loadHelpers(cache, options) {
options = options || {};
cache = cache || {};
function loadHelpers(key, val) {
function loaderFn(key, val) {
if (typeof key === 'function') {

@@ -53,3 +55,5 @@ throw new TypeError('key should be an object, array or string.');

}
cache[name] = fn;
loadHelpers.emit(options.emit || 'helper', name, fn, !!fn.async);
return cache;

@@ -61,3 +65,3 @@ }

helpers.forEach(function(helper) {
loadHelpers(helper, opts);
loaderFn(helper, opts);
});

@@ -77,3 +81,3 @@ } else if (utils.isObject(helpers)) {

helper.forEach(function(val) {
utils.extend(obj[name], loadHelpers(val, opts));
utils.extend(obj[name], loaderFn(val, opts));
});

@@ -101,5 +105,5 @@ utils.extend(cache, obj);

name = utils.renameKey(name, opts);
loadHelpers(name, file);
loaderFn(name, file);
} else {
loadHelpers(file, opts);
loaderFn(file, opts);
}

@@ -110,3 +114,3 @@ }

return loadHelpers;
return loaderFn;
};

33

package.json
{
"name": "load-helpers",
"description": "Load helpers with patterns, as an object, key-value pair, or module.",
"version": "0.2.11",
"version": "0.3.0",
"homepage": "https://github.com/jonschlinkert/load-helpers",

@@ -14,2 +14,4 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"index.js",
"LICENSE",
"README.md",
"utils.js"

@@ -25,6 +27,7 @@ ],

"dependencies": {
"component-emitter": "^1.2.1",
"extend-shallow": "^2.0.1",
"is-valid-glob": "^0.3.0",
"lazy-cache": "^2.0.1",
"matched": "^0.4.1",
"matched": "^0.4.3",
"resolve-dir": "^0.1.0"

@@ -34,7 +37,5 @@ },

"gulp": "^3.9.1",
"gulp-eslint": "^2.0.0",
"gulp-istanbul": "^0.10.4",
"gulp-mocha": "^2.2.0",
"mocha": "^2.5.3",
"should": "^9.0.0"
"gulp-eslint": "^3.0.1",
"gulp-format-md": "^0.1.9",
"mocha": "^2.5.3"
},

@@ -55,2 +56,10 @@ "keywords": [

"verb": {
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"related": {

@@ -60,6 +69,14 @@ "list": [

"helper-cache",
"template-helpers"
"template-helpers",
"templates"
]
},
"reflinks": [
"verb",
"verb-generate-readme"
],
"lint": {
"reflinks": true
}
}
}
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