How to use the isFunction function from util
Find comprehensive JavaScript util.isFunction code examples handpicked from public code repositorys.
133 134 135 136 137 138 139 140 141 142
// false ``` <div id="isFunction" class="anchor"></div> ## util.isFunction(object) > 稳定度:0 - 已废弃 如果给定的 'object' 是 `Function`,返回 `true`。否则,返回 `false`。
21
99
2
+ 3 other calls in file
312 313 314 315 316 317 318 319 320 321
// To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (this._events.newListener) this.emit('newListener', type, util.isFunction(listener.listener) ? listener.listener : listener); if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object.
1
14
2
GitHub: io-forward/io-forward
105 106 107 108 109 110 111 112 113
options.host = args[1]; } } var cb = args[args.length - 1]; return util.isFunction(cb) ? [options, cb] : [options]; } exports._normalizeConnectArgs = normalizeConnectArgs;
0
11
3
GitHub: linvinglor/node
381 382 383 384 385 386 387 388 389 390
obj[Symbol.toStringTag] = 'Error'; util.isError(obj); // Returns: true ``` ### util.isFunction(object) <!-- YAML added: v0.11.5 deprecated: v4.0.0 -->
0
6
1
GitHub: rlidwka/node
78 79 80 81 82 83 84 85 86 87
} }; } function maybeCallback(cb) { return util.isFunction(cb) ? cb : rethrow(); } // Ensure that callbacks run in the global context. Only use this function // for callbacks that are passed to the binding layer, callbacks that are
0
3
3
util.promisify is the most popular function in util (378 examples)