-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
32 lines (27 loc) · 857 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* eslint-env es6 */
require("noop") // defines global `noop()`
const noops = [
noop,
require("async.util.noop"),
require("basic-functions").noop,
require("blank-space").noop,
require("co-noop"), // exports a generator function version of noop …
require("empty").func,
require("fj-noop").FUNC,
require("lodash._noop"),
require("lodash.noop"),
require("n0p3"),
require("no-op"),
require("node-noop").noop,
require("none"),
require("noop-fn"),
require("noop2"),
require("noop3"),
require("noop4")(), // exports a function that returns a noop function …
require("noopaam"),
require("nop"),
require("yanoop").noop,
];
isGeneratorFn = fn => fn instanceof Object.getPrototypeOf(function*(){}).constructor
noopCaller = fn => isGeneratorFn(fn) ? fn().next().value : fn()
module.exports = () => noops.map(noopCaller)