is-async-function
Advanced tools
Comparing version 1.1.3 to 1.1.4
## 1.1.4 - 2016-09-21 | ||
- Release v1.1.4 / npm@v1.1.4 | ||
- use `lazy-cache` and `lazy-arrayify`, closes #10 | ||
- add support for `names` to be a string, not only array of strings | ||
- update to use `mukla` instead of `assertit` | ||
- update npm scripts | ||
- update travis builds and coverage things | ||
- update gitignore | ||
- update editorconfig | ||
- add `standard`, `nyc` and `coveralls` to devDeps | ||
## 1.1.3 - 2016-04-21 | ||
@@ -4,0 +15,0 @@ - Release v1.1.3 / npm@v1.1.3 |
@@ -10,2 +10,4 @@ /*! | ||
var utils = require('./utils') | ||
/** | ||
@@ -43,4 +45,6 @@ * > Trying to guess is `fn` asynchronous function or not. | ||
} | ||
names = require('isarray')(names) ? names : require('common-callback-names') | ||
return require('arr-includes')(require('function-arguments')(fn), names) | ||
names = utils.isArray(names) ? names : utils.arrayify(names) | ||
names = names.length ? names : utils.callbackNames | ||
return utils.arrIncludes(utils.fnArgs(fn), names) | ||
} |
{ | ||
"name": "is-async-function", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "Is function really asynchronous function? Trying to guess that based on check if [common-callback-names][] exists as function arguments names or you can pass your custom.", | ||
@@ -11,20 +11,31 @@ "repository": "tunnckoCore/is-async-function", | ||
"scripts": { | ||
"test": "standard && node test.js" | ||
"lint": "standard --verbose", | ||
"pretest": "npm run lint", | ||
"test": "npm run coverage", | ||
"posttest": "npm run lint:coverage", | ||
"coverage": "nyc node test.js", | ||
"lint:coverage": "nyc check-coverage --statements 100 --functions 100 --lines 100", | ||
"report-coverage": "nyc report --reporter=text-lcov | coveralls" | ||
}, | ||
"dependencies": { | ||
"arr-includes": "^1.0.0", | ||
"arr-includes": "^1.0.1", | ||
"common-callback-names": "^1.0.2", | ||
"function-arguments": "^1.0.1", | ||
"isarray": "^1.0.0" | ||
"function-arguments": "^1.0.5", | ||
"lazy-arrayify": "^1.0.3", | ||
"lazy-cache": "^2.0.1" | ||
}, | ||
"devDependencies": { | ||
"assertit": "^0.1.0", | ||
"coveralls": "^2.11.14", | ||
"gh-got": "^1.1.0", | ||
"got": "^3.2.0", | ||
"is-match": "^0.4.1", | ||
"pre-commit": "^1.1.2", | ||
"request": "^2.57.0" | ||
"mukla": "^0.4.4", | ||
"nyc": "^8.3.0", | ||
"pre-commit": "^1.1.3", | ||
"request": "^2.57.0", | ||
"standard": "^8.1.0" | ||
}, | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"utils.js" | ||
], | ||
@@ -31,0 +42,0 @@ "keywords": [ |
@@ -19,3 +19,3 @@ # [is-async-function][author-www-url] [![npmjs.com][npmjs-img]][npmjs-url] [![The MIT License][license-img]][license-url] | ||
### [isAsyncFunction](index.js#L38) | ||
### [isAsyncFunction](index.js#L40) | ||
> Trying to guess is `fn` asynchronous function or not. But not [is-callback-function][] be aware of that diff. | ||
@@ -48,9 +48,9 @@ | ||
## Related | ||
* [common-callback-names](https://www.npmjs.com/package/common-callback-names): List of common callback names - callback, cb, callback_, next, done. | [homepage](https://github.com/tunnckocore/common-callback-names) | ||
* [fn-args](https://www.npmjs.com/package/fn-args): Get the arguments of a function | [homepage](https://github.com/sindresorhus/fn-args) | ||
* [fn-name](https://www.npmjs.com/package/fn-name): Get the name of a named function | [homepage](https://github.com/sindresorhus/fn-name) | ||
* [function-arguments](https://www.npmjs.com/package/function-arguments): Get arguments of a function, useful for and used in dependency injectors.… [more](https://www.npmjs.com/package/function-arguments) | [homepage](https://github.com/tunnckocore/function-arguments) | ||
* [get-fn-name](https://www.npmjs.com/package/get-fn-name): Get function name with strictness and correctness in mind. Also works for… [more](https://www.npmjs.com/package/get-fn-name) | [homepage](https://github.com/tunnckocore/get-fn-name) | ||
* [is-callback-function](https://www.npmjs.com/package/is-callback-function): Returns true if function is a callback. Checks its name is one… [more](https://www.npmjs.com/package/is-callback-function) | [homepage](https://github.com/tunnckocore/is-callback-function) | ||
* [parse-function](https://www.npmjs.com/package/parse-function): Parse a function, arrow function or string to object with name, args,… [more](https://www.npmjs.com/package/parse-function) | [homepage](https://github.com/tunnckocore/parse-function) | ||
- [common-callback-names](https://www.npmjs.com/package/common-callback-names): List of common callback names - callback, cb, callback_, next, done. | [homepage](https://github.com/tunnckocore/common-callback-names#readme "List of common callback names - callback, cb, callback_, next, done.") | ||
- [fn-args](https://www.npmjs.com/package/fn-args): Get the arguments of a function | [homepage](https://github.com/sindresorhus/fn-args "Get the arguments of a function") | ||
- [fn-name](https://www.npmjs.com/package/fn-name): Get the name of a named function | [homepage](https://github.com/sindresorhus/fn-name "Get the name of a named function") | ||
- [function-arguments](https://www.npmjs.com/package/function-arguments): Get arguments of a function, useful for and used in dependency injectors… [more](https://github.com/tunnckocore/function-arguments#readme) | [homepage](https://github.com/tunnckocore/function-arguments#readme "Get arguments of a function, useful for and used in dependency injectors. Works for regular functions, generator functions and arrow functions.") | ||
- [get-fn-name](https://www.npmjs.com/package/get-fn-name): Get function name with strictness and correctness in mind. Also works for… [more](https://github.com/tunnckocore/get-fn-name#readme) | [homepage](https://github.com/tunnckocore/get-fn-name#readme "Get function name with strictness and correctness in mind. Also works for arrow functions and getting correct name of bounded functions. Powered by [fn-name][].") | ||
- [is-callback-function](https://www.npmjs.com/package/is-callback-function): Returns true if function is a callback. Checks its name is one… [more](https://github.com/tunnckocore/is-callback-function#readme) | [homepage](https://github.com/tunnckocore/is-callback-function#readme "Returns true if function is a callback. Checks its name is one of [common-callback-names][] - callback, cb, cb_, callback_, next, done, they can be customized, these are default.") | ||
- [parse-function](https://www.npmjs.com/package/parse-function): Parse a function, arrow function or string to object with name, args… [more](https://github.com/tunnckocore/parse-function#readme) | [homepage](https://github.com/tunnckocore/parse-function#readme "Parse a function, arrow function or string to object with name, args, params and body properties.") | ||
@@ -65,4 +65,4 @@ ## Contributing | ||
[common-callback-names]: https://github.com/tunnckocore/common-callback-names | ||
[function-arguments]: https://github.com/tunnckocore/function-arguments | ||
[common-callback-names]: https://github.com/tunnckocore/common-callback-names | ||
[is-callback-function]: https://github.com/tunnckocore/is-callback-function | ||
@@ -112,1 +112,2 @@ | ||
[fn-name]: https://github.com/sindresorhus/fn-name |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
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
13201
6
60
5
9
2
+ Addedlazy-arrayify@^1.0.3
+ Addedlazy-cache@^2.0.1
+ Addedlazy-arrayify@1.0.3(transitive)
- Removedisarray@^1.0.0
Updatedarr-includes@^1.0.1
Updatedfunction-arguments@^1.0.5