MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / toIterable

Function toIterable

lib/web/jshint.js:5947–5955  ·  view source on GitHub ↗

* Converts `value` to an array-like object if it is not one. * * @private * @param {*} value The value to process. * @returns {Array|Object} Returns the array-like object.

(value)

Source from the content-addressed store, hash-verified

5945 * @returns {Array|Object} Returns the array-like object.
5946 */
5947 function toIterable(value) {
5948 if (value == null) {
5949 return [];
5950 }
5951 if (!isLength(getLength(value))) {
5952 return values(value);
5953 }
5954 return isObject(value) ? value : Object(value);
5955 }
5956
5957 /**
5958 * Converts `value` to an object if it is not one.

Callers 5

createExtremumFunction · 0.85
runInContextFunction · 0.85
sampleFunction · 0.85
shuffleFunction · 0.85
sumFunction · 0.85

Calls 4

isLengthFunction · 0.85
valuesFunction · 0.85
ObjectFunction · 0.85
isObjectFunction · 0.70

Tested by

no test coverage detected