MCPcopy Create free account
hub / github.com/amasad/debug_utils / applyOne

Function applyOne

du.js:540–550  ·  view source on GitHub ↗

* Applies the first method that exists on `object` from `methods`. Otherwise * throws with `message`. * * @param {object} object * @param {array } methods * @param {array<*>} args * @param {string} message * @private

(object, methods, args, message)

Source from the content-addressed store, hash-verified

538 */
539
540function applyOne(object, methods, args, message) {
541 for (var i = 0; i < methods.length; i++) {
542 var fn = object[methods[i]];
543 if (typeof fn === 'function') {
544 return fn.apply(object, args);
545 }
546 }
547 if (message) {
548 throw new Error(message);
549 }
550}
551
552/**
553 * Alphanumeric Unique id of `len` length.

Callers 2

debugEventFunction · 0.85
$duvrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected