MCPcopy Index your code
hub / github.com/jashkenas/underscore / isEmpty

Function isEmpty

underscore.js:300–309  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

298 // Is a given array, string, or object empty?
299 // An "empty" object has no enumerable own-properties.
300 function isEmpty(obj) {
301 if (obj == null) return true;
302 // Skip the more expensive `toString`-based type checks if `obj` has no
303 // `.length`.
304 var length = getLength(obj);
305 if (typeof length == 'number' && (
306 isArray(obj) || isString(obj) || isArguments$1(obj)
307 )) return length === 0;
308 return getLength(keys(obj)) === 0;
309 }
310
311 // Returns whether an object has a given set of `key:value` pairs.
312 function isMatch(object, attrs) {

Callers

nothing calls this directly

Calls 1

keysFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…