async-helpers
Advanced tools
Comparing version 0.3.12 to 0.3.13
36
index.js
@@ -458,7 +458,2 @@ /*! | ||
var val = yield self.resolveId(key); | ||
if (['string', 'number', 'boolean'].indexOf(typeOf(val)) === -1) { | ||
console.log(`[WARNING]: AsyncHelpers#resolveIds ${formatWarning(key, val)}`); | ||
} | ||
str = str.split(key).join(val); | ||
@@ -504,33 +499,2 @@ } | ||
/** | ||
* Format a warning message to provide better information about the | ||
* helper and the arguments passed to the helper when the returned results aren't | ||
* what's expected. | ||
* | ||
* @param {String} `key` Helper async id used to find more information about the helper. | ||
* @param {Mixed} `val` Value returned from the helper | ||
* @return {String} Formatted warning message | ||
*/ | ||
function formatWarning(key, val) { | ||
var helper = stash[key]; | ||
if (!helper) { | ||
return `Expected returned result to be a string, number or boolean. Instead result is typeof "${typeOf(val)}"`; | ||
} | ||
var args = helper.args.slice(); | ||
args = args.filter(function(arg) { | ||
if (!arg || typeof arg === 'function') { | ||
return false; | ||
} | ||
return true; | ||
}).map(function(arg) { | ||
return stringify(arg); | ||
}); | ||
var res = `Expected the returned result from "${helper.name}" to be a string, number or boolean. Instead result is typeof "${typeOf(val)}".`; | ||
// res += `\nHelper arguments: \`${args.join(', ')}\``; | ||
return res; | ||
} | ||
/** | ||
* Create a prefix to use when generating an async id. | ||
@@ -537,0 +501,0 @@ * |
{ | ||
"name": "async-helpers", | ||
"description": "Use async helpers in templates with engines that typically only handle sync helpers. Handlebars and Lodash have been tested.", | ||
"version": "0.3.12", | ||
"version": "0.3.13", | ||
"homepage": "https://github.com/doowb/async-helpers", | ||
@@ -6,0 +6,0 @@ "author": "Brian Woodward (https://github.com/doowb)", |
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
23557
504