https://github.com/inspect-js/is-arrow-function
Determine if a function is an ES6 arrow function or not.
https://github.com/inspect-js/is-arrow-function
arrow function is javascript
Last synced: 9 months ago
JSON representation
Determine if a function is an ES6 arrow function or not.
- Host: GitHub
- URL: https://github.com/inspect-js/is-arrow-function
- Owner: inspect-js
- License: mit
- Created: 2013-09-13T04:18:35.000Z (over 12 years ago)
- Default Branch: main
- Last Pushed: 2024-05-10T04:09:07.000Z (over 1 year ago)
- Last Synced: 2025-03-20T21:44:14.281Z (10 months ago)
- Topics: arrow, function, is, javascript
- Language: JavaScript
- Homepage:
- Size: 101 KB
- Stars: 22
- Watchers: 5
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# is-arrow-function [![Version Badge][npm-version-svg]][npm-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![npm badge][npm-badge-png]][npm-url]
npm module to determine if a function is an ES6 arrow function or not.
NOTE: Only works in Firefox at the moment.
## Example
```js
var isArrowFunction = require('is-arrow-function');
assert(!isArrowFunction(function () {}));
assert(!isArrowFunction(null));
assert(isArrowFunction((a, b) => a * b));
assert(isArrowFunction(() => 42));
assert(isArrowFunction(x => x * x));
assert(isArrowFunction(x => () => x * x));
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[npm-url]: https://npmjs.org/package/is-arrow-function
[npm-version-svg]: https://versionbadg.es/inspect-js/is-arrow-function.svg
[deps-svg]: https://david-dm.org/inspect-js/is-arrow-function.svg
[deps-url]: https://david-dm.org/inspect-js/is-arrow-function
[dev-deps-svg]: https://david-dm.org/inspect-js/is-arrow-function/dev-status.svg
[dev-deps-url]: https://david-dm.org/inspect-js/is-arrow-function#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/is-arrow-function.png?downloads=true&stars=true