Object, any non-primitive value
Confirms if passed value is an object
const isObject = require("type/object/is");
isObject({}); // true
isObject(true); // false
isObject(null); // false
If given argument is an object, it is returned back. Otherwise TypeError
is thrown.
const ensureObject = require("type/object/ensure");
const obj = {};
ensureObject(obj); // obj
ensureString(null); // Thrown TypeError: null is not an object