What problem does it solve?
Developers need reliable predicates to determine the shape and emptiness of values in JavaScript without pulling in heavy utilities. This skill provides a focused set of shape checks to distinguish objects, arrays, iterables, and emptiness, enabling safer data flows and validation.
Core Features & Use Cases
- isObject: truthy when the value is any object type, including arrays, dates, and class instances, minus null and functions.
- isPlainObject: true only for plain objects like {} or Object.create(null) with null prototype edge cases.
- Is.array: true for literal arrays, false for array-like or other iterables.
- isIterable: true for values with a [Symbol.iterator] method, including strings and collections.
- isEmpty: smart emptiness with nuanced rules for null, undefined, empty strings, zero values, maps/sets, and plain objects.
Quick Start
Import the predicates from @mongez/supportive-is and begin using isObject, isPlainObject, Is.array, isIterable, and isEmpty in your validation logic.