async-helpers
Advanced tools
Comparing version 0.1.2 to 0.1.3
12
index.js
@@ -93,11 +93,13 @@ /*! | ||
function wrapper(name) { | ||
var self = this; | ||
var helper = this.helpers[name]; | ||
function wrapper (name) { | ||
var self = this; | ||
return function () { | ||
var args = [].slice.call(arguments); | ||
var obj = { | ||
name: name, | ||
id: self.prefix + self.globalCounter + '_' + (self.counter++) + '__', | ||
fn: self.helpers[name], | ||
args: [].slice.call(arguments), | ||
fn: helper, | ||
args: args, | ||
argRefs: [] | ||
@@ -107,3 +109,3 @@ }; | ||
// store references to other async helpers | ||
obj.args.forEach(function (arg, i) { | ||
args.forEach(function (arg, i) { | ||
if (typeof arg === 'string' && arg.indexOf(self.prefix) === 0) { | ||
@@ -110,0 +112,0 @@ obj.argRefs.push({arg: arg, idx: i}); |
{ | ||
"name": "async-helpers", | ||
"description": "Use async helpers in template engines like Handlebars and Lodash.", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"homepage": "https://github.com/doowb/async-helpers", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -18,3 +18,3 @@ # async-helpers [![NPM version](https://badge.fury.io/js/async-helpers.svg)](http://badge.fury.io/js/async-helpers) [![Build Status](https://travis-ci.org/doowb/async-helpers.svg)](https://travis-ci.org/doowb/async-helpers) | ||
## API | ||
### [AsyncHelpers](./index.js#L25) | ||
### [AsyncHelpers](index.js#L25) | ||
@@ -29,3 +29,3 @@ Create a new instance of AsyncHelpers | ||
### [.set](./index.js#L61) | ||
### [.set](index.js#L61) | ||
@@ -44,3 +44,3 @@ Add a helper to the cache. | ||
### [.get](./index.js#L81) | ||
### [.get](index.js#L81) | ||
@@ -58,3 +58,3 @@ Get all helpers or a helper with the given name. | ||
### [.wrap](./index.js#L130) | ||
### [.wrap](index.js#L132) | ||
@@ -71,3 +71,3 @@ Wrap a helper with async handling capibilities. | ||
### [.reset](./index.js#L153) | ||
### [.reset](index.js#L155) | ||
@@ -82,3 +82,3 @@ Reset all the stashed helpers. | ||
### [.resolve](./index.js#L176) | ||
### [.resolve](index.js#L178) | ||
@@ -100,3 +100,2 @@ Resolve a stashed helper by the generated id. | ||
## Run tests | ||
@@ -116,3 +115,3 @@ | ||
**Brian Woodward** | ||
+ [github/doowb](https://github.com/doowb) | ||
@@ -127,2 +126,2 @@ + [twitter/doowb](http://twitter.com/doowb) | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 18, 2015._ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on April 17, 2015._ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
10110
205
119
1