diff options
Diffstat (limited to 'tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/README.md')
-rw-r--r-- | tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/README.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/README.md b/tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/README.md new file mode 100644 index 0000000000..d341c9ce35 --- /dev/null +++ b/tools/node_modules/babel-eslint/node_modules/@babel/helper-get-function-arity/README.md @@ -0,0 +1,21 @@ +# @babel/helper-get-function-arity + +Function that returns the number of arguments that a function takes. +* Examples of what is considered an argument can be found at [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length) + +## Usage + +```javascript +import getFunctionArity from "@babel/helper-get-function-arity"; + +function wrap(state, method, id, scope) { + // ... + if (!t.isFunction(method)) { + return false; + } + + const argumentsLength = getFunctionArity(method); + + // ... +} +``` |