Asserts this spec on a given value. Returns the value if value passes spec,
returns perusal-immutable.invalid
otherwise.
The value to be asserted.
Returns the value if value passes spec, returns perusal-immutable.invalid otherwise.
Explains why a value passes/fails this spec.
The value to be checked.
The path travelled to this spec.
Returns true if the value satisfies this spec, false otherwise.
Generated using TypeDoc
Class representing
Optional
specs, which either accepts an undefined value or requires that the value satisfy the spec if present. Typically used with keys to denote specs for optional keys.