MCPcopy
hub / github.com/axios/axios / isEmptyObject

Function isEmptyObject

lib/utils.js:211–223  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

209 * @returns {boolean} True if value is an empty object, otherwise false
210 */
211const isEmptyObject = (val) => {
212 // Early return for non-objects or Buffers to prevent RangeError
213 if (!isObject(val) || isBuffer(val)) {
214 return false;
215 }
216
217 try {
218 return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
219 } catch (e) {
220 // Fallback for any other objects that might cause RangeError with Object.keys()
221 return false;
222 }
223};
224
225/**
226 * Determine if a value is a Date

Callers

nothing calls this directly

Calls 2

isObjectFunction · 0.85
isBufferFunction · 0.85

Tested by

no test coverage detected