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

Function isEmpty

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

* Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-l

(value)

Source from the content-addressed store, hash-verified

22103 * // => false
22104 */
22105 function isEmpty(value) {
22106 if (value == null) {
22107 return true;
22108 }
22109 if (isArrayLike(value) &&
22110 (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
22111 isBuffer(value) || isTypedArray(value) || isArguments(value))) {
22112 return !value.length;
22113 }
22114 var tag = getTag(value);
22115 if (tag == mapTag || tag == setTag) {
22116 return !value.size;
22117 }
22118 if (isPrototype(value)) {
22119 return !baseKeys(value).length;
22120 }
22121 for (var key in value) {
22122 if (hasOwnProperty.call(value, key)) {
22123 return false;
22124 }
22125 }
22126 return true;
22127 }
22128
22129 /**
22130 * Performs a deep comparison between two values to determine if they are

Callers

nothing calls this directly

Calls 7

isArrayLikeFunction · 0.85
isBufferFunction · 0.85
isTypedArrayFunction · 0.85
isArgumentsFunction · 0.85
isPrototypeFunction · 0.85
baseKeysFunction · 0.85
isArrayFunction · 0.70

Tested by

no test coverage detected