MCPcopy Index your code
hub / github.com/deployd/deployd / toArray

Function toArray

test-app/public/sinon.js:22945–22959  ·  view source on GitHub ↗

* Converts `value` to an array. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to convert. * @returns {Array} Returns the converted array. * @example * * _.toArray({ 'a':

(value)

Source from the content-addressed store, hash-verified

22943 * // => []
22944 */
22945 function toArray(value) {
22946 if (!value) {
22947 return [];
22948 }
22949 if (isArrayLike(value)) {
22950 return isString(value) ? stringToArray(value) : copyArray(value);
22951 }
22952 if (symIterator && value[symIterator]) {
22953 return iteratorToArray(value[symIterator]());
22954 }
22955 var tag = getTag(value),
22956 func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
22957
22958 return func(value);
22959 }
22960
22961 /**
22962 * Converts `value` to a finite number.

Callers 1

wrapperNextFunction · 0.85

Calls 5

isArrayLikeFunction · 0.85
stringToArrayFunction · 0.85
copyArrayFunction · 0.85
iteratorToArrayFunction · 0.85
isStringFunction · 0.70

Tested by

no test coverage detected