Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xotic750/get-function-args-x
Get the args of the function.
https://github.com/xotic750/get-function-args-x
arguments browser ecmascript name nodejs
Last synced: 15 days ago
JSON representation
Get the args of the function.
- Host: GitHub
- URL: https://github.com/xotic750/get-function-args-x
- Owner: Xotic750
- License: mit
- Created: 2016-01-05T23:05:36.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T23:18:20.000Z (about 2 years ago)
- Last Synced: 2024-04-09T18:02:54.439Z (10 months ago)
- Topics: arguments, browser, ecmascript, name, nodejs
- Language: JavaScript
- Homepage:
- Size: 3.53 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## get-function-args-x
### `module.exports(fn)` ⇒
undefined
\|Array
⏏This method returns the args of the function, or `undefined` if not
a function.**Kind**: Exported function
**Returns**:undefined
\|Array
- The args of the function, or `undefined` if
not a function.| Param | Type | Description |
| ----- | --------------------- | -------------------------------- |
| fn |function
| The function to get the args of. |**Example**
```js
import getFunctionArgs from 'get-function-args-x';getFunctionArgs(); // undefined
getFunctionArgs(Number.MIN_VALUE); // undefined
getFunctionArgs('abc'); // undefined
getFunctionArgs(true); // undefined
getFunctionArgs({name: 'abc'}); // undefined
getFunctionArgs(function() {}); // []
getFunctionArgs(new Function()); // []
getFunctionArgs(function test() {}); // []
getFunctionArgs(function test(a, b) {}); // ['a', 'b']
getFunctionArgs(function* test(a, b) {}); // ['a', 'b']
getFunctionArgs((a, b) => {}); // ['a', 'b']
getFunctionArgs(async function test(a, b) {}); // ['a', 'b']
```