Comparing version 1.16.1 to 1.16.2
1.16.2 / 2019-11-19 | ||
================== | ||
**fixes** | ||
* [[`bb8f5d4`](http://github.com/node-modules/utility/commit/bb8f5d4becb61df6e8ce1788a172f8ae4e9937b4)] - fix: getParamNames throw when input is not function (#51) (Daniels.Sun <<better.sunjian@gmail.com>>) | ||
**others** | ||
* [[`7016803`](http://github.com/node-modules/utility/commit/7016803364f22c70c42da59870eee64dd1d99020)] - build: add node 12 in ci (dead-horse <<dead_horse@qq.com>>) | ||
1.16.1 / 2019-03-25 | ||
@@ -3,0 +12,0 @@ ================== |
'use strict'; | ||
var assert = require('assert'); | ||
/** | ||
@@ -19,2 +21,5 @@ * A empty function. | ||
exports.getParamNames = function getParamNames(func, cache) { | ||
var type = typeof func; | ||
assert(type === 'function', `The "func" must be a function. Received type "${type}"`); | ||
cache = cache !== false; | ||
@@ -21,0 +26,0 @@ if (cache && func.__cache_names) { |
{ | ||
"name": "utility", | ||
"version": "1.16.1", | ||
"version": "1.16.2", | ||
"description": "A collection of useful utilities.", | ||
@@ -5,0 +5,0 @@ "main": "lib/utility.js", |
@@ -113,2 +113,8 @@ # utility | ||
utils.noop = function () {} | ||
// throw out an assertion error if you were given an invalid "func" | ||
try { | ||
utils.getParamNames(null); // Only function is allowed | ||
} catch (err) { | ||
console.error(err); // Assertion Error | ||
} | ||
@@ -115,0 +121,0 @@ ``` |
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
57671
1357
339