MCPcopy Create free account
hub / github.com/dtmilano/AndroidViewClient / toArray

Function toArray

docs/_static/underscore-1.13.1.js:1604–1613  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

1602 // Safely create a real, live array from anything iterable.
1603 var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
1604 function toArray(obj) {
1605 if (!obj) return [];
1606 if (isArray(obj)) return slice.call(obj);
1607 if (isString(obj)) {
1608 // Keep surrogate pair characters together.
1609 return obj.match(reStrSymbol);
1610 }
1611 if (isArrayLike(obj)) return map(obj, identity);
1612 return values(obj);
1613 }
1614
1615 // Return the number of elements in a collection.
1616 function size(obj) {

Callers

nothing calls this directly

Calls 3

isArrayLikeFunction · 0.85
mapFunction · 0.85
valuesFunction · 0.85

Tested by

no test coverage detected