MCPcopy Create free account
hub / github.com/DanWahlin/CustomerManagerStandard / __map

Function __map

CustomerManager/Scripts/breeze.debug.js:278–295  ·  view source on GitHub ↗
(items, fn, includeNull)

Source from the content-addressed store, hash-verified

276
277 // a version of Array.map that doesn't require an array, i.e. works on arrays and scalars.
278 function __map(items, fn, includeNull) {
279 // whether to return nulls in array of results; default = true;
280 includeNull = includeNull == null ? true : includeNull;
281 if (items == null) return items;
282 var result;
283 if (Array.isArray(items)) {
284 result = [];
285 items.forEach(function (v, ix) {
286 var r = fn(v, ix);
287 if (r != null || includeNull) {
288 result[ix] = r;
289 }
290 });
291 } else {
292 result = fn(items);
293 }
294 return result;
295 }
296
297
298 function __arrayFirst(array, predicate) {

Callers 5

structuralObjectToJsonFunction · 0.85
unwrapInstanceFunction · 0.85
unwrapChangedValuesFunction · 0.85
breeze.debug.jsFile · 0.85
processNoMergeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected