make-arrow-function

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

MIT 3 个版本
安装
npm install make-arrow-function
yarn add make-arrow-function
pnpm add make-arrow-function
bun add make-arrow-function
README

#make-arrow-function Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

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

版本列表
1.2.0 2020-01-28
1.1.0 2015-08-18
1.0.0 2014-12-15