Skip to content

Function that returns an arbitrary arrow function, or undefined if arrow function syntax is unsupported.

License

Notifications You must be signed in to change notification settings

ljharb/make-arrow-function

Repository files navigation

make-arrow-function Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Function that returns an arbitrary arrow function, or undefined if arrow function syntax is unsupported.

Example

var maybeArrowFunction = require('make-arrow-function')();
if (maybeArrowFunction) {
	assert(typeof maybeArrowFunction === 'function');
} else {
	assert(typeof maybeArrowFunction === 'undefined');
}

var arrowFunctions = require('make-arrow-function').list();
assert(arrowFunctions.every(function (fn) { return typeof fn === 'function'; }));

Tests

Simply clone the repo, npm install, and run npm test

About

Function that returns an arbitrary arrow function, or undefined if arrow function syntax is unsupported.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published