MCPcopy
hub / github.com/josdejong/mathjs / _getTypedCallbackArgCount

Function _getTypedCallbackArgCount

src/function/matrix/map.js:240–246  ·  view source on GitHub ↗

* Determines the argument pattern of a typed callback function. * @param {Function} callback - The typed callback function to analyze * @param {Array} values - Sample values for signature resolution * @param {Array} idx - Sample index for signature resolution * @param {Array} arrays - Sample arr

(callback, values, idx, arrays)

Source from the content-addressed store, hash-verified

238 */
239
240 function _getTypedCallbackArgCount (callback, values, idx, arrays) {
241 if (typed.resolve(callback, [...values, idx, ...arrays]) !== null) { return 2 }
242 if (typed.resolve(callback, [...values, idx]) !== null) { return 1 }
243 if (typed.resolve(callback, values) !== null) { return 0 }
244 // this should never happen
245 return 0
246 }
247 /**
248 * Map for a multi dimensional array
249 * @param {Array} array

Callers 1

_mapMultipleFunction · 0.85

Calls 1

resolveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…