Value, any value that's neither null
nor undefined
.
Confirms whether passed argument is a value
const isValue = require("type/value/is");
isValue({}); // true
isValue(null); // false
Ensures if given argument is a value. If it's a value it is returned back, if not TypeError
is thrown
const ensureValue = require("type/value/ensure");
const obj = {};
ensureValue(obj); // obj
ensureValue(null); // Thrown TypeError: Cannot use null