# Objects
rtvref : object

RTV.js Reference

Members herein are indirectly accessed and/or exposed through the RTV.js Public Interface.

rtv : object

RTV.js Public Interface

Provides the externally-facing API. It wraps the implementation, adding a bit of syntactic sugar, and adds the configuration facilities.

# rtvref : object

RTV.js Reference

Members herein are _indirectly_ accessed and/or exposed through the [RTV.js Public Interface](#rtv). **Kind**: global namespace * [rtvref](#rtvref) : object * [.Enumeration](#rtvref.Enumeration) * [new Enumeration(map, [name])](#new_rtvref.Enumeration_new) * [.$name](#rtvref.Enumeration+$name) : string * [.$values](#rtvref.Enumeration+$values) : Array.<String> * [.check(value)](#rtvref.Enumeration+check) ⇒ \* \| undefined * [.verify(value, [silent])](#rtvref.Enumeration+verify) ⇒ \* * [.toString()](#rtvref.Enumeration+toString) ⇒ string * [.RtvError](#rtvref.RtvError) ⇐ [JS\_Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) * [new RtvError(value, typeset, path, mismatch, [rootCause])](#new_rtvref.RtvError_new) * [.valid](#rtvref.RtvError+valid) : boolean * [.value](#rtvref.RtvError+value) : \* * [.typeset](#rtvref.RtvError+typeset) : [typeset](#rtvref.types.typeset) * [.path](#rtvref.RtvError+path) : Array.<string> * [.mismatch](#rtvref.RtvError+mismatch) : [fully\_qualified\_typeset](#rtvref.types.fully_qualified_typeset) * [.rootCause](#rtvref.RtvError+rootCause) : Error \| undefined * [.toString()](#rtvref.RtvError+toString) ⇒ string * [.RtvSuccess](#rtvref.RtvSuccess) * [new RtvSuccess(params)](#new_rtvref.RtvSuccess_new) * [.valid](#rtvref.RtvSuccess+valid) : boolean * [.mvv](#rtvref.RtvSuccess+mvv) : \* * [.toString()](#rtvref.RtvSuccess+toString) ⇒ string * [.impl](#rtvref.impl) : object * [.getQualifier(typeset)](#rtvref.impl.getQualifier) ⇒ string * [.toTypeset(type, [qualifier], [args], [fullyQualified])](#rtvref.impl.toTypeset) ⇒ [typeset](#rtvref.types.typeset) * [.fullyQualify(typeset, [qualifier])](#rtvref.impl.fullyQualify) ⇒ [fully\_qualified\_typeset](#rtvref.types.fully_qualified_typeset) * [.extractNextType(typeset, [qualifier])](#rtvref.impl.extractNextType) ⇒ [typeset](#rtvref.types.typeset) \| Array * [.checkWithType(value, singleType, [context])](#rtvref.impl.checkWithType) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.checkWithShape(value, shape, [context])](#rtvref.impl.checkWithShape) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.checkWithArray(value, arrayTs, [context])](#rtvref.impl.checkWithArray) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.check(value, typeset, [context])](#rtvref.impl.check) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.qualifiers](#rtvref.qualifiers) : object * [.REQUIRED](#rtvref.qualifiers.REQUIRED) * [.EXPECTED](#rtvref.qualifiers.EXPECTED) * [.OPTIONAL](#rtvref.qualifiers.OPTIONAL) * [.TRUTHY](#rtvref.qualifiers.TRUTHY) * [.qualifiers](#rtvref.qualifiers.qualifiers) : [Enumeration](#rtvref.Enumeration) * [.DEFAULT_QUALIFIER](#rtvref.qualifiers.DEFAULT_QUALIFIER) : string * [.valuePermitted(v, [q])](#rtvref.qualifiers.valuePermitted) ⇒ boolean * [.restricted_values](#rtvref.qualifiers.restricted_values) : void * [.types](#rtvref.types) : object * [.objTypes](#rtvref.types.objTypes) : [Enumeration](#rtvref.Enumeration) * [.argTypes](#rtvref.types.argTypes) : [Enumeration](#rtvref.Enumeration) * [.types](#rtvref.types.types) : [Enumeration](#rtvref.Enumeration) * [.ANY](#rtvref.types.ANY) : string * [.NULL](#rtvref.types.NULL) : string * [.STRING](#rtvref.types.STRING) : string * [.BOOLEAN](#rtvref.types.BOOLEAN) : string * [.SYMBOL](#rtvref.types.SYMBOL) : string * [.NUMBER](#rtvref.types.NUMBER) : string * [.FINITE](#rtvref.types.FINITE) : string * [.INT](#rtvref.types.INT) : string * [.SAFE_INT](#rtvref.types.SAFE_INT) : string * [.FLOAT](#rtvref.types.FLOAT) : string * [.FUNCTION](#rtvref.types.FUNCTION) : string * [.REGEXP](#rtvref.types.REGEXP) : string * [.DATE](#rtvref.types.DATE) : string * [.ERROR](#rtvref.types.ERROR) : string * [.PROMISE](#rtvref.types.PROMISE) : string * [.ARRAY](#rtvref.types.ARRAY) : string * [.ANY_OBJECT](#rtvref.types.ANY_OBJECT) : string * [.OBJECT](#rtvref.types.OBJECT) : string * [.PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) : string * [.CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) : string * [.HASH_MAP](#rtvref.types.HASH_MAP) : string * [.MAP](#rtvref.types.MAP) : string * [.WEAK_MAP](#rtvref.types.WEAK_MAP) : string * [.SET](#rtvref.types.SET) : string * [.WEAK_SET](#rtvref.types.WEAK_SET) : string * [.JSON](#rtvref.types.JSON) : string * [.DEFAULT_OBJECT_TYPE](#rtvref.types.DEFAULT_OBJECT_TYPE) : string * [.primitives](#rtvref.types.primitives) : void * [.falsy_values](#rtvref.types.falsy_values) : void * [.qualifier_rules](#rtvref.types.qualifier_rules) : void * [.shape_descriptor](#rtvref.types.shape_descriptor) : Object * [.type_arguments](#rtvref.types.type_arguments) : Object * [.STRING_args](#rtvref.types.STRING_args) : Object * [.SYMBOL_args](#rtvref.types.SYMBOL_args) : Object * [.numeric_args](#rtvref.types.numeric_args) : Object * [.shape_object_args](#rtvref.types.shape_object_args) : Object * [.ARRAY_args](#rtvref.types.ARRAY_args) : Object * [.collection_args](#rtvref.types.collection_args) : Object * [.typeset](#rtvref.types.typeset) : Object \| string \| Array \| function * [.fully_qualified_typeset](#rtvref.types.fully_qualified_typeset) : Array * [.custom_validator](#rtvref.types.custom_validator) ⇒ \* * [.util](#rtvref.util) : object * [.print(printValue, printOptions)](#rtvref.util.print) ⇒ string * [.hasOwnProp(obj, prop)](#rtvref.util.hasOwnProp) ⇒ boolean * [.validation](#rtvref.validation) : object * [.method(value)](#rtvref.validation.method) ⇒ boolean * [.isAny](#rtvref.validation.isAny) : Module * [.type](#rtvref.validation.isAny.type) : string * [.check(v)](#rtvref.validation.isAny.check) ⇒ boolean * [.isAnyObject](#rtvref.validation.isAnyObject) : Module * [.type](#rtvref.validation.isAnyObject.type) : string * [.check(v)](#rtvref.validation.isAnyObject.check) ⇒ boolean * [.isArray](#rtvref.validation.isArray) : Module * [.type](#rtvref.validation.isArray.type) : string * [.check(v)](#rtvref.validation.isArray.check) ⇒ boolean * [.isBoolean](#rtvref.validation.isBoolean) : Module * [.type](#rtvref.validation.isBoolean.type) : string * [.check(v)](#rtvref.validation.isBoolean.check) ⇒ boolean * [.isClassObject](#rtvref.validation.isClassObject) : Module * [.type](#rtvref.validation.isClassObject.type) : string * [.check(v)](#rtvref.validation.isClassObject.check) ⇒ boolean * [.isCustomValidator](#rtvref.validation.isCustomValidator) : Module * [.type](#rtvref.validation.isCustomValidator.type) : string * [.check(v)](#rtvref.validation.isCustomValidator.check) ⇒ boolean * [.isDate](#rtvref.validation.isDate) : Module * [.type](#rtvref.validation.isDate.type) : string * [.check(v)](#rtvref.validation.isDate.check) ⇒ boolean * [.isError](#rtvref.validation.isError) : Module * [.type](#rtvref.validation.isError.type) : string * [.check(v)](#rtvref.validation.isError.check) ⇒ boolean * [.isFalsy](#rtvref.validation.isFalsy) : Module * [.type](#rtvref.validation.isFalsy.type) : string * [.check(v)](#rtvref.validation.isFalsy.check) ⇒ boolean * [.isFinite](#rtvref.validation.isFinite) : Module * [.type](#rtvref.validation.isFinite.type) : string * [.check(v)](#rtvref.validation.isFinite.check) ⇒ boolean * [.isFloat](#rtvref.validation.isFloat) : Module * [.type](#rtvref.validation.isFloat.type) : string * [.check(v)](#rtvref.validation.isFloat.check) ⇒ boolean * [.isFunction](#rtvref.validation.isFunction) : Module * [.type](#rtvref.validation.isFunction.type) : string * [.check(v)](#rtvref.validation.isFunction.check) ⇒ boolean * [.isHashMap](#rtvref.validation.isHashMap) : Module * [.type](#rtvref.validation.isHashMap.type) : string * [.check(v)](#rtvref.validation.isHashMap.check) ⇒ boolean * [.isInt](#rtvref.validation.isInt) : Module * [.type](#rtvref.validation.isInt.type) : string * [.check(v)](#rtvref.validation.isInt.check) ⇒ boolean * [.isJson](#rtvref.validation.isJson) : Module * [.type](#rtvref.validation.isJson.type) : string * [.check(v)](#rtvref.validation.isJson.check) ⇒ boolean * [.isMap](#rtvref.validation.isMap) : Module * [.type](#rtvref.validation.isMap.type) : string * [.check(v)](#rtvref.validation.isMap.check) ⇒ boolean * [.isNull](#rtvref.validation.isNull) : Module * [.type](#rtvref.validation.isNull.type) : string * [.check(v)](#rtvref.validation.isNull.check) ⇒ boolean * [.isNumber](#rtvref.validation.isNumber) : Module * [.type](#rtvref.validation.isNumber.type) : string * [.check(v)](#rtvref.validation.isNumber.check) ⇒ boolean * [.isObject](#rtvref.validation.isObject) : Module * [.type](#rtvref.validation.isObject.type) : string * [.check(v)](#rtvref.validation.isObject.check) ⇒ boolean * [.isPlainObject](#rtvref.validation.isPlainObject) : Module * [.type](#rtvref.validation.isPlainObject.type) : string * [.check(v)](#rtvref.validation.isPlainObject.check) ⇒ boolean * [.isPrimitive](#rtvref.validation.isPrimitive) : Module * [.type](#rtvref.validation.isPrimitive.type) : string * [.check(v)](#rtvref.validation.isPrimitive.check) ⇒ boolean * [.isPromise](#rtvref.validation.isPromise) : Module * [.type](#rtvref.validation.isPromise.type) : string * [.check(v)](#rtvref.validation.isPromise.check) ⇒ boolean * [.isRegExp](#rtvref.validation.isRegExp) : Module * [.type](#rtvref.validation.isRegExp.type) : string * [.check(v)](#rtvref.validation.isRegExp.check) ⇒ boolean * [.isSafeInt](#rtvref.validation.isSafeInt) : Module * [.type](#rtvref.validation.isSafeInt.type) : string * [.check(v)](#rtvref.validation.isSafeInt.check) ⇒ boolean * [.isSet](#rtvref.validation.isSet) : Module * [.type](#rtvref.validation.isSet.type) : string * [.check(v)](#rtvref.validation.isSet.check) ⇒ boolean * [.isShape](#rtvref.validation.isShape) : Module * [.type](#rtvref.validation.isShape.type) : string * [.check(v)](#rtvref.validation.isShape.check) ⇒ boolean * [.isString](#rtvref.validation.isString) : Module * [.type](#rtvref.validation.isString.type) : string * [.check(v, [options])](#rtvref.validation.isString.check) ⇒ boolean * [.isSymbol](#rtvref.validation.isSymbol) : Module * [.type](#rtvref.validation.isSymbol.type) : string * [.check(v)](#rtvref.validation.isSymbol.check) ⇒ boolean * [.isTypeArgs](#rtvref.validation.isTypeArgs) : Module * [.type](#rtvref.validation.isTypeArgs.type) : string * [.check(v)](#rtvref.validation.isTypeArgs.check) ⇒ boolean * [.isTypeset](#rtvref.validation.isTypeset) : Module * [.type](#rtvref.validation.isTypeset.type) : string * [.check(v, [options])](#rtvref.validation.isTypeset.check) ⇒ boolean * [.isWeakMap](#rtvref.validation.isWeakMap) : Module * [.type](#rtvref.validation.isWeakMap.type) : string * [.check(v)](#rtvref.validation.isWeakMap.check) ⇒ boolean * [.isWeakSet](#rtvref.validation.isWeakSet) : Module * [.type](#rtvref.validation.isWeakSet.type) : string * [.check(v)](#rtvref.validation.isWeakSet.check) ⇒ boolean * [.validator](#rtvref.validator) : object * [.type_validator(value, qualifier, args, context)](#rtvref.validator.type_validator) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.validator_config(settings)](#rtvref.validator.validator_config) * [.valAny](#rtvref.validator.valAny) : Module * [.type](#rtvref.validator.valAny.type) : string * [.config(settings)](#rtvref.validator.valAny.config) * [.validate(v, [q])](#rtvref.validator.valAny.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valAnyObject](#rtvref.validator.valAnyObject) : Module * [.type](#rtvref.validator.valAnyObject.type) : string * [.config(settings)](#rtvref.validator.valAnyObject.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valAnyObject.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valArray](#rtvref.validator.valArray) : Module * [.type](#rtvref.validator.valArray.type) : string * [.config(settings)](#rtvref.validator.valArray.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valArray.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valBoolean](#rtvref.validator.valBoolean) : Module * [.type](#rtvref.validator.valBoolean.type) : string * [.config(settings)](#rtvref.validator.valBoolean.config) * [.validate(v, [q])](#rtvref.validator.valBoolean.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valClassObject](#rtvref.validator.valClassObject) : Module * [.type](#rtvref.validator.valClassObject.type) : string * [.config(settings)](#rtvref.validator.valClassObject.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valClassObject.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valDate](#rtvref.validator.valDate) : Module * [.type](#rtvref.validator.valDate.type) : string * [.config(settings)](#rtvref.validator.valDate.config) * [.validate(v, [q])](#rtvref.validator.valDate.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valError](#rtvref.validator.valError) : Module * [.type](#rtvref.validator.valError.type) : string * [.config(settings)](#rtvref.validator.valError.config) * [.validate(v, [q])](#rtvref.validator.valError.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valFinite](#rtvref.validator.valFinite) : Module * [.type](#rtvref.validator.valFinite.type) : string * [.config(settings)](#rtvref.validator.valFinite.config) * [.validate(v, [q], [args])](#rtvref.validator.valFinite.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valFloat](#rtvref.validator.valFloat) : Module * [.type](#rtvref.validator.valFloat.type) : string * [.config(settings)](#rtvref.validator.valFloat.config) * [.validate(v, [q], [args])](#rtvref.validator.valFloat.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valFunction](#rtvref.validator.valFunction) : Module * [.type](#rtvref.validator.valFunction.type) : string * [.config(settings)](#rtvref.validator.valFunction.config) * [.validate(v, [q])](#rtvref.validator.valFunction.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valHashMap](#rtvref.validator.valHashMap) : Module * [.type](#rtvref.validator.valHashMap.type) : string * [.config(settings)](#rtvref.validator.valHashMap.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valHashMap.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.type_validator_context_options](#rtvref.validator.type_validator_context_options) : Object * [.type_validator_context](#rtvref.validator.type_validator_context) : Object * [.validator_config_settings](#rtvref.validator.validator_config_settings) : Object * [.valInt](#rtvref.validator.valInt) : Module * [.type](#rtvref.validator.valInt.type) : string * [.config(settings)](#rtvref.validator.valInt.config) * [.validate(v, [q], [args])](#rtvref.validator.valInt.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valJson](#rtvref.validator.valJson) : Module * [.type](#rtvref.validator.valJson.type) : string * [.config(settings)](#rtvref.validator.valJson.config) * [.validate(v, [q])](#rtvref.validator.valJson.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valMap](#rtvref.validator.valMap) : Module * [.type](#rtvref.validator.valMap.type) : string * [.config(settings)](#rtvref.validator.valMap.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valMap.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valNull](#rtvref.validator.valNull) : Module * [.type](#rtvref.validator.valNull.type) : string * [.config(settings)](#rtvref.validator.valNull.config) * [.validate(v, [q])](#rtvref.validator.valNull.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valNumber](#rtvref.validator.valNumber) : Module * [.type](#rtvref.validator.valNumber.type) : string * [.config(settings)](#rtvref.validator.valNumber.config) * [.validate(v, [q], [args])](#rtvref.validator.valNumber.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valObject](#rtvref.validator.valObject) : Module * [.type](#rtvref.validator.valObject.type) : string * [.config(settings)](#rtvref.validator.valObject.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valObject.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valPlainObject](#rtvref.validator.valPlainObject) : Module * [.type](#rtvref.validator.valPlainObject.type) : string * [.config(settings)](#rtvref.validator.valPlainObject.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valPlainObject.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valPromise](#rtvref.validator.valPromise) : Module * [.type](#rtvref.validator.valPromise.type) : string * [.config(settings)](#rtvref.validator.valPromise.config) * [.validate(v, [q])](#rtvref.validator.valPromise.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valRegExp](#rtvref.validator.valRegExp) : Module * [.type](#rtvref.validator.valRegExp.type) : string * [.config(settings)](#rtvref.validator.valRegExp.config) * [.validate(v, [q])](#rtvref.validator.valRegExp.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valSafeInt](#rtvref.validator.valSafeInt) : Module * [.type](#rtvref.validator.valSafeInt.type) : string * [.config(settings)](#rtvref.validator.valSafeInt.config) * [.validate(v, [q], [args])](#rtvref.validator.valSafeInt.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valSet](#rtvref.validator.valSet) : Module * [.type](#rtvref.validator.valSet.type) : string * [.config(settings)](#rtvref.validator.valSet.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valSet.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valString](#rtvref.validator.valString) : Module * [.type](#rtvref.validator.valString.type) : string * [.config(settings)](#rtvref.validator.valString.config) * [.validate(v, [q], [args])](#rtvref.validator.valString.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valSymbol](#rtvref.validator.valSymbol) : Module * [.type](#rtvref.validator.valSymbol.type) : string * [.config(settings)](#rtvref.validator.valSymbol.config) * [.validate(v, [q], [args])](#rtvref.validator.valSymbol.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valWeakMap](#rtvref.validator.valWeakMap) : Module * [.type](#rtvref.validator.valWeakMap.type) : string * [.config(settings)](#rtvref.validator.valWeakMap.config) * [.validate(v, [q])](#rtvref.validator.valWeakMap.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valWeakSet](#rtvref.validator.valWeakSet) : Module * [.type](#rtvref.validator.valWeakSet.type) : string * [.config(settings)](#rtvref.validator.valWeakSet.config) * [.validate(v, [q])](#rtvref.validator.valWeakSet.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) ## rtvref.Enumeration **Kind**: static class of [rtvref](#rtvref) * [.Enumeration](#rtvref.Enumeration) * [new Enumeration(map, [name])](#new_rtvref.Enumeration_new) * [.$name](#rtvref.Enumeration+$name) : string * [.$values](#rtvref.Enumeration+$values) : Array.<String> * [.check(value)](#rtvref.Enumeration+check) ⇒ \* \| undefined * [.verify(value, [silent])](#rtvref.Enumeration+verify) ⇒ \* * [.toString()](#rtvref.Enumeration+toString) ⇒ string ### new Enumeration(map, [name]) Simple enumeration type. Own-properties on an instance are the keys in the specified `map`, with their associated values. Key names cannot start with "$".
const state = new Enumeration({
  READY: 1,
  RUNNING: 2,
  STOPPED: 3,
  COMPLETE: 4
});

state.RUNNING; // 2
state.verify(3); // 3 (returns the value since found in enumeration)
state.verify(5); // ERROR thrown
state.check(3); // 3 (same as verify(3) since found in enumeration)
state.check(5); // undefined (silent failure)
state.$values; // [1, 2, 3, 4] (special non-enumerable own-property)
**Throws**: - Error If `map` is falsy or empty. - Error If `map` has a key that maps to `undefined`. - Error If `map` contains a duplicate value. - Error If `map` has a key that is a restricted property (starts with "$"). | Param | Type | Description | | --- | --- | --- | | map | Object.<String, \*> | Object mapping keys to values. Values cannot be `undefined`. | | [name] | string | Friendly name used to identify this enumeration, especially in validation error messages. | ### enumeration.$name : string Friendly name (not necessarily unique among all enumeration instances) used to identify this enumeration, especially in validation error messages. Empty string if not specified during construction. Note that this own-property is non-enumerable on purpose. Enumerable properties on this instance are the keys in this enumeration. **Kind**: instance property of [Enumeration](#rtvref.Enumeration) **Read only**: true ### enumeration.$values : Array.<String> List of enumeration values. Values are _references_ to values in this enumeration. Note that this own-property is non-enumerable on purpose. Enumerable properties on this instance are the keys in this enumeration. **Kind**: instance property of [Enumeration](#rtvref.Enumeration) **Read only**: true ### enumeration.check(value) ⇒ \* \| undefined Checks if a value is in this enumeration. **Kind**: instance method of [Enumeration](#rtvref.Enumeration) **Returns**: \* \| undefined - The specified value if it is in this enumeration, or `undefined` if not. An exception is __not__ thrown if the value is not in this enumeration. **See**: [verify](#rtvref.Enumeration+verify) | Param | Type | Description | | --- | --- | --- | | value | \* | Value to check. Cannot be undefined. | ### enumeration.verify(value, [silent]) ⇒ \* Validates a value as being in this enumeration. Throws an exception if the value is not in this enumeration, unless `silent` is true. **Kind**: instance method of [Enumeration](#rtvref.Enumeration) **Returns**: \* - The specified value if it is in this enumeration, or `undefined` if `silent` is true and the value is not in this enumeration. **Throws**: - Error If not `silent` and the value is not in this enumeration. **See**: [check](#rtvref.Enumeration+check) | Param | Type | Default | Description | | --- | --- | --- | --- | | value | \* | | Value to check. Cannot be undefined. | | [silent] | boolean | false | If truthy, returns `undefined` instead of throwing an exception if the specified value is not in this enumeration. | ### enumeration.toString() ⇒ string A string representation of this Enumeration. **Kind**: instance method of [Enumeration](#rtvref.Enumeration) **Returns**: string - String representation. ## rtvref.RtvError ⇐ [JS\_Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) **Kind**: static class of [rtvref](#rtvref) **Extends**: [JS\_Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) * [.RtvError](#rtvref.RtvError) ⇐ [JS\_Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) * [new RtvError(value, typeset, path, mismatch, [rootCause])](#new_rtvref.RtvError_new) * [.valid](#rtvref.RtvError+valid) : boolean * [.value](#rtvref.RtvError+value) : \* * [.typeset](#rtvref.RtvError+typeset) : [typeset](#rtvref.types.typeset) * [.path](#rtvref.RtvError+path) : Array.<string> * [.mismatch](#rtvref.RtvError+mismatch) : [fully\_qualified\_typeset](#rtvref.types.fully_qualified_typeset) * [.rootCause](#rtvref.RtvError+rootCause) : Error \| undefined * [.toString()](#rtvref.RtvError+toString) ⇒ string ### new RtvError(value, typeset, path, mismatch, [rootCause]) Runtime Verification Error Indicator Describes a failed runtime verification of a value against a given [shape](#rtvref.types.shape_descriptor) or [typeset](#rtvref.types.typeset) (note that a shape is a type of typeset). **Throws**: - Error If `typeset`, `path`, or `mismatch` is invalid. | Param | Type | Description | | --- | --- | --- | | value | \* | The value being verified. | | typeset | [typeset](#rtvref.types.typeset) | The typeset used for verification. | | path | Array.<string> | The path deep into `value` where the failure occurred. An empty array signifies the _root_ (top-level) value that was checked. | | mismatch | [fully\_qualified\_typeset](#rtvref.types.fully_qualified_typeset) | The fully-qualified typeset that resulted in the failed validation. This is normally the fully-qualified version of `typeset`, but could be a subtype if `typeset` is an Array typeset or a [shape descriptor](#rtvref.types.shape_descriptor). | | [rootCause] | [RtvError](#rtvref.RtvError) \| Error | [Custom Validator](#rtvref.types.custom_validator) error, if the `RtvError` is a result of a failed custom validation and the validator threw an exception; or some other nested error that was the root cause for the failed validation. | ### rtvError.valid : boolean Flag indicating the validation failed. Always `false`. **Kind**: instance property of [RtvError](#rtvref.RtvError) **Read only**: true **See**: [valid](#rtvref.RtvSuccess+valid) ### rtvError.value : \* Value that failed verification against the [typeset](#rtvref.RtvError+typeset). **Kind**: instance property of [RtvError](#rtvref.RtvError) **Read only**: true ### rtvError.typeset : [typeset](#rtvref.types.typeset) Reference to the typeset used for verification. **Kind**: instance property of [RtvError](#rtvref.RtvError) **Read only**: true ### rtvError.path : Array.<string> Path from [value](#rtvref.RtvError+value) to the nested property that caused the failure. Note that paths into collections such as [HASH_MAP](#rtvref.types.HASH_MAP) or ES6 structures such as [MAP](#rtvref.types.MAP), where it's possible to specify arguments to verify keys vs values, will have elements with special prefixes to differentiate whether the path points to a key ("`key={key-name}`") or a value ("`valueKey={key-name}`"). For example, given the has map `{hello: 'world'}`, if all keys were supposed to be numerical, then the path for the validation error would be `["key=hello"]`, indicating that the problem occurred with the __key__ named "hello", not the associated __value__. If, however, keys could be anything, but values had to be numerical, then the path would be `["valueKey=hello"]`, indicating that the problem occurred with the __value__ associated to the key rather than the key itself.

SECURITY

Some collection types, such as [MAP](#rtvref.types.MAP) and [SET](#rtvref.types.SET), can have actual objects as keys or elements, and these are used (in JSON-stringified form) as part of the error path. If these objects happen to contain sensitive information, that information may end-up in the path, and the path gets included in this error's `message` property, which may get logged by your systems. Other object types where keys can technically be any string value could also contain sensitive information depending on how these keys are defined. These keys will also end-up in the path that gets included in this error's `message` property. __It is YOUR responsibility to exercise necessary caution when validating data structures containing sensitive data.__ **Kind**: instance property of [RtvError](#rtvref.RtvError) **Read only**: true ### rtvError.mismatch : [fully\_qualified\_typeset](#rtvref.types.fully_qualified_typeset) [Fully-qualified typeset](#rtvref.types.fully_qualified_typeset) that caused the validation error (i.e. the mismatched subtype). This will be a subset/subtype of the [typeset](#rtvref.RtvError+typeset), and possibly of a nested typeset within it, expressing only the direct cause of the error. For example, of `typeset` is `[[rtv.STRING]]` (a required array of required strings), and `value` is `['a', 2]`, this property would be `[rtv.REQUIRED, rtv.STRING]` because the validation error would ultimately have been caused by the nested `rtv.STRING` typeset. Remember that the fully-qualified `typeset` would be `[rtv.REQUIRED, rtv.ARRAY, {$: [rtv.REQUIRED, rtv.STRING]}]`, which demonstrates that `[rtv.REQUIRED, rtv.STRING]` is indeed a subset/subtype. **Kind**: instance property of [RtvError](#rtvref.RtvError) **Read only**: true ### rtvError.rootCause : Error \| undefined Validation error thrown by a [Custom Validator](#rtvref.types.custom_validator), which resulted in this `RtvError`. `undefined` if this error was not the result of a failed custom validation. If the custom validator throws an error, this will be a reference to the error it threw; otherwise, it'll be a generic `Error` generated by the library. **Kind**: instance property of [RtvError](#rtvref.RtvError) **Read only**: true ### rtvError.toString() ⇒ string A string representation of this instance. **Kind**: instance method of [RtvError](#rtvref.RtvError) **Returns**: string - String representation. ## rtvref.RtvSuccess **Kind**: static class of [rtvref](#rtvref) * [.RtvSuccess](#rtvref.RtvSuccess) * [new RtvSuccess(params)](#new_rtvref.RtvSuccess_new) * [.valid](#rtvref.RtvSuccess+valid) : boolean * [.mvv](#rtvref.RtvSuccess+mvv) : \* * [.toString()](#rtvref.RtvSuccess+toString) ⇒ string ### new RtvSuccess(params) Runtime Verification Success Indicator Describes a successful runtime verification of a value against a given [shape](#rtvref.types.shape_descriptor) or [typeset](#rtvref.types.typeset) (note that a shape is a type of typeset). | Param | Type | Description | | --- | --- | --- | | params | Object | | | params.mvv | \* | Minimum Viable Value representing the smallest version of the original value checked that satisfies the original Typeset against which it was checked. See the [mvv](#rtvref.RtvSuccess+mvv) property for more information. | ### rtvSuccess.valid : boolean Flag indicating the validation succeeded. Always `true`. **Kind**: instance property of [RtvSuccess](#rtvref.RtvSuccess) **Read only**: true **See**: [valid](#rtvref.RtvError+valid) ### rtvSuccess.mvv : \* Minimum Viable Value (MVV). If the original value checked is one that can be deeply checked (see list below of supported types), this is essentially a __representation__ (stressing it is __not__ necessarily a clone) of the original value, __filtered__ by removing any parts of it that were not specifically checked (i.e. extra properties in an object that were not included in a shape, however deep it was nested, even in the key of a `Map`). Otherwise, it's a reference to the original value. Validating this value (instead of the original value) against the same Typeset would yield the same successful result. This property is most useful when checking a plain array or object (e.g. JSON API response) against an expected shape when the shape you care about is much smaller than the payload itself. Once the the check is complete, keep the minimum viable value instead of the larger original payload to reduce the overall memory footprint of your code. The following types are deeply checked and so will produce an MVV, but note the stated exceptions to types that are not plain objects (`{}`) or arrays (`[]`): - [ARRAY](#rtvref.types.ARRAY): Note that none of the [ARRAY_args](#rtvref.types.ARRAY_args) except for the typeset (`$`) are used, which means items won't be removed if the array is longer than a stated `length` or `max` length. - [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) - [OBJECT](#rtvref.types.OBJECT): Interpreted as an object (`{}`). - [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT): Interpreted as an object (`{}`). - [HASH_MAP](#rtvref.types.HASH_MAP): Interpreted as an object (`{}`). - [ANY_OBJECT](#rtvref.types.ANY_OBJECT): Interpreted as an object (`{}`) because it's essentially treated as one when it's being checked. - [MAP](#rtvref.types.MAP): Interpreted as the native `Map` type. - [SET](#rtvref.types.SET): Interpreted as the native `Set` type. All other types will be referenced, not interpreted. __NOTE:__ The MVV will based on the [Typeset](#rtvref.types.typeset) that validates the original value. If you use an Array Typeset with multiple possibilities for an object value to check (e.g. `[OBJECT, { $: { foo: NUMBER } }, OBJECT, { $: { bar: STRING } }]`), the resulting MVV will use the matching sub-Typeset. Checking `{ foo: 1, bar: 'a' }` would result in `{ foo: 1 }` as the MVV because `OBJECT, { $: { foo: NUMBER } }` is the first sub-Typeset in the list, and so the first match. **Kind**: instance property of [RtvSuccess](#rtvref.RtvSuccess) **Read only**: true ### rtvSuccess.toString() ⇒ string A string representation of this instance. **Kind**: instance method of [RtvSuccess](#rtvref.RtvSuccess) **Returns**: string - String representation. ## rtvref.impl : object

RTV.js Implementation

Provides the internal implementation for the externally-facing [RTV](#rtv) API, as well as utilities for [type validators](#rtvref.validator). **Kind**: static namespace of [rtvref](#rtvref) * [.impl](#rtvref.impl) : object * [.getQualifier(typeset)](#rtvref.impl.getQualifier) ⇒ string * [.toTypeset(type, [qualifier], [args], [fullyQualified])](#rtvref.impl.toTypeset) ⇒ [typeset](#rtvref.types.typeset) * [.fullyQualify(typeset, [qualifier])](#rtvref.impl.fullyQualify) ⇒ [fully\_qualified\_typeset](#rtvref.types.fully_qualified_typeset) * [.extractNextType(typeset, [qualifier])](#rtvref.impl.extractNextType) ⇒ [typeset](#rtvref.types.typeset) \| Array * [.checkWithType(value, singleType, [context])](#rtvref.impl.checkWithType) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.checkWithShape(value, shape, [context])](#rtvref.impl.checkWithShape) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.checkWithArray(value, arrayTs, [context])](#rtvref.impl.checkWithArray) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.check(value, typeset, [context])](#rtvref.impl.check) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) ### impl.getQualifier(typeset) ⇒ string Get the qualifier given any kind of typeset. The typeset's validity is __not__ checked. The function attempts to get a qualifier, and defaults to the [default qualifier](qualifiers.DEFAULT_QUALIFIER) if it cannot. **Kind**: static method of [impl](#rtvref.impl) **Returns**: string - The applicable [qualifier](#rtvref.qualifiers) for the specified typeset, which is assumed to be valid. | Param | Type | Description | | --- | --- | --- | | typeset | [typeset](#rtvref.types.typeset) | The typeset in question. | ### impl.toTypeset(type, [qualifier], [args], [fullyQualified]) ⇒ [typeset](#rtvref.types.typeset) Convert a type, qualifier, and args into a typeset. While the `qualifier`, `args`, and `fullyQualified` parameters are all optional and may be omitted, their order must be maintained: If needed, the `qualifier` must always be before `args`, and `args` before `fullyQualified`. Parameters with `undefined` values will be ignored. **Kind**: static method of [impl](#rtvref.impl) **Returns**: [typeset](#rtvref.types.typeset) - The simplest typeset that represents the combination of the specified type, qualifier, and args, unless `fullyQualified` was set to `true`, in which case it'll always be an array typeset and fully-qualified. **Throws**: - Error If `type`, `qualifier`, or `args` is invalid. | Param | Type | Default | Description | | --- | --- | --- | --- | | type | string | | A single type from [types](#rtvref.types.types). | | [qualifier] | string \| Object \| boolean | "rtvref.qualifiers.DEFAULT_QUALIFIER" | Optional qualifier from [qualifiers](#rtvref.qualifiers.qualifiers). Can also be either the `args` parameter, or the `fullyQualified` parameter if the default qualifier is being used. | | [args] | Object \| boolean | | Optional [type arguments](#rtvref.types.type_arguments). If specified, this parameter must be an [object](#rtvref.types.OBJECT), however the properties of the object are not validated against the specified `type` (i.e. they are not guaranteed to be valid for that type). Can also be the `fullyQualified` parameter if type arguments aren't applicable. | | [fullyQualified] | boolean | false | If _truthy_, the generated typeset will always be [fully-qualified](#rtvref.types.fully_qualified_typeset). Otherwise, it'll be the simplest typeset possible. | ### impl.fullyQualify(typeset, [qualifier]) ⇒ [fully\_qualified\_typeset](#rtvref.types.fully_qualified_typeset) Fully-qualifies a typeset, shallow (i.e. the first level only; nested typesets are not fully-qualified). This function does not modify the input `typeset`. **Kind**: static method of [impl](#rtvref.impl) **Returns**: [fully\_qualified\_typeset](#rtvref.types.fully_qualified_typeset) - A new, fully-qualified typeset representing the input `typeset`. Only the first/immediate level of the input typeset is fully-qualified. The new array returned contains references to elements within the input typeset. **Throws**: - Error If `typeset` or `qualifier` is not a valid. | Param | Type | Description | | --- | --- | --- | | typeset | [typeset](#rtvref.types.typeset) | Typeset to fully-qualify. | | [qualifier] | [qualifiers](#rtvref.qualifiers) | Optional qualifier to be used. If the typeset is a simple [type](#rtvref.types), a [shape](#rtvref.types.shape_descriptor), or a [custom validator](#rtvref.types.custom_validator) that was cherry-picked out of a typeset whose qualifier should be used instead of the [default](#rtvref.qualifiers.DEFAULT_QUALIFIER) one. If `typeset` is an Array typeset, specifying this parameter will __override__ the typeset's qualifier (otherwise, its own qualifier will be used). | ### impl.extractNextType(typeset, [qualifier]) ⇒ [typeset](#rtvref.types.typeset) \| Array Extracts (modifies) the next complete type from an Array typeset. For example, if the given `typeset` is `[EXPECTED, STRING, {string_args}, FINITE]`, the returned array would be `[EXPECTED, STRING, {string_args}]` and `typeset` would then be `[FINITE]`. **Kind**: static method of [impl](#rtvref.impl) **Returns**: [typeset](#rtvref.types.typeset) \| Array - The extracted __Array typeset__ as a new Array, which is a sub-type of the given `typeset`. This sub-typeset is not necessarily fully-qualified. If `typeset` was an empty array, an empty array is returned (which is the only case where an invalid Array typeset is tolerated, so that this function is easy to use in loops, checking for the stopping condition where the returned sub-typeset is empty). **Throws**: - Error If `typeset` is not empty and not a valid Array typeset. - Error If `qualifier` is specified but not valid. | Param | Type | Description | | --- | --- | --- | | typeset | [typeset](#rtvref.types.typeset) \| Array | An Array typeset from which to extract the next complete type. __This Array will be modified.__ Can also be an empty array (which is not a valid typeset, but is tolerated; see the return value for more information). | | [qualifier] | [qualifiers](#rtvref.qualifiers) \| boolean | Optional, and can either be a valid qualifier, `true`, or `false`.

Parameter is specified, and is a qualifier

If __a qualifier is not found in `typeset`__, this qualifier will be used to qualify the returned sub-type Array typeset. If a qualifier is found in `typeset`, this parameter is ignored. If a qualifier is __not__ found in `typeset` and this parameter is specified, then this qualifier will be used to qualify the returned sub-type Array typeset. __Examples:__ - `typeset = [EXPECTED, STRING, FINITE];` - `extractNextType(typeset, REQUIRED) === [EXPECTED, STRING]`, `typeset === [FINITE]` - `extractNextType(typeset) === [FINITE]`, `typeset === []` - `typeset = [FINITE];` - `extractNextType(typeset, EXPECTED) === [EXPECTED, FINITE]`

Parameter is specified, and is a boolean

If `true`, the qualifier, if any, will be included in the returned sub-type Array typeset. If `false`, the qualifier, if any, will be ignored. __Examples:__ - `extractNextType([STRING], true) === [STRING]` - `extractNextType([REQUIRED, STRING], true) === [EXPECTED, STRING]` - `extractNextType([REQUIRED, STRING], false) === [STRING]` | ### impl.checkWithType(value, singleType, [context]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) Checks a value using a single type. **Kind**: static method of [impl](#rtvref.impl) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - A success indicator if the `value` is compliant to the type; an error indicator if not. **Throws**: - Error If `singleType` is not a valid simple type or single type. - Error If the specified `context` is not valid. **See**: [types](#rtvref.types) | Param | Type | Description | | --- | --- | --- | | value | \* | Value to check. | | singleType | string \| Array \| Object | Either a simple type name (one of [types](#rtvref.types.types)), a [shape descriptor](#rtvref.types.shape_descriptor), or an Array [typeset](#rtvref.types.typeset) which represents a single type. In the string/simple case, the [default qualifier](#rtvref.qualifiers.DEFAULT_QUALIFIER) is assumed. In the shape descriptor case, the [default object type](#rtvref.types.DEFAULT_OBJECT_TYPE) is assumed. In the Array case, the qualifier is optional, and a type, along with args, if any, is expected (e.g. `[type]`, `[qualifier, type]`, `[type, args]`, or `[qualifier, type, args]`). Note that the type may be implied if the shorthand notation is being used for an ARRAY, or if the [default object type](#rtvref.types.DEFAULT_OBJECT_TYPE) is being implied for a shape, e.g. `[{foo: rtv.STRING}]`. NOTE: A [custom validator](#rtvref.types.custom_validator) is not considered a valid single type. It's also considered a __separate type__ if it were passed-in via an Array, e.g. `[STRING, validator]`, which would violate the fact that `singleType` should be one type, and therefore cause an exception to be thrown. | | [context] | [type\_validator\_context](#rtvref.validator.type_validator_context) \| undefined | Additional context for the check. If _falsy_, a new context will be created for all downstream checks using `value` as the original value, and `undefined` as the parent. | ### impl.checkWithShape(value, shape, [context]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) Checks a value using a [shape descriptor](#rtvref.types.shape_descriptor) and ensure the value's type is the default object type. **Kind**: static method of [impl](#rtvref.impl) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - A success indicator if the `value` is compliant to the shape; an error indicator if not. **Throws**: - Error If `shape` is not an [OBJECT](#rtvref.types.OBJECT). - Error If the specified `context` is not valid. | Param | Type | Description | | --- | --- | --- | | value | Object | Value to check. Must be of the [default](#rtvref.types.DEFAULT_OBJECT_TYPE) object type. | | shape | Object | Expected shape of the `value`. Must be an [OBJECT](#rtvref.types.OBJECT). | | [context] | [type\_validator\_context](#rtvref.validator.type_validator_context) \| undefined | Additional context for the check. If _falsy_, a new context will be created for all downstream checks using `value` as the original value, and an empty/root path. | ### impl.checkWithArray(value, arrayTs, [context]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) Checks a value using an Array typeset. **Kind**: static method of [impl](#rtvref.impl) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - Success indicator if the `value` is compliant to the `typeset`; error indicator otherwise. An exception is __not__ thrown if the `value` is non-compliant. **Throws**: - Error If `typeset` is not a valid Array typeset. - Error If the specified `context` is not valid. | Param | Type | Description | | --- | --- | --- | | value | \* | Value to check. | | arrayTs | Array | The Array [typeset](#rtvref.types.typeset) to check against. | | [context] | [type\_validator\_context](#rtvref.validator.type_validator_context) \| undefined | Additional context for the check. If _falsy_, a new context will be created for all downstream checks using `value` as the original value, and an empty/root path. | ### impl.check(value, typeset, [context]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) Checks a value against a typeset. **Kind**: static method of [impl](#rtvref.impl) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - Success indicator if the `value` is compliant to the `typeset`; error indicator otherwise. An exception is __not__ thrown if the `value` is non-compliant. **Throws**: - Error If `typeset` is not a valid typeset. - Error If the specified `context` is not valid. | Param | Type | Description | | --- | --- | --- | | value | \* | Value to check. | | typeset | [typeset](#rtvref.types.typeset) | Expected shape/type of the value. | | [context] | [type\_validator\_context](#rtvref.validator.type_validator_context) \| undefined | Additional context for the check. If _falsy_, a new context will be created for all downstream checks using `value` as the original value, and an empty/root path. | ## rtvref.qualifiers : object

Qualifiers

Qualifiers determine the degree at which a value must be of a given type. **Kind**: static namespace of [rtvref](#rtvref) * [.qualifiers](#rtvref.qualifiers) : object * [.REQUIRED](#rtvref.qualifiers.REQUIRED) * [.EXPECTED](#rtvref.qualifiers.EXPECTED) * [.OPTIONAL](#rtvref.qualifiers.OPTIONAL) * [.TRUTHY](#rtvref.qualifiers.TRUTHY) * [.qualifiers](#rtvref.qualifiers.qualifiers) : [Enumeration](#rtvref.Enumeration) * [.DEFAULT_QUALIFIER](#rtvref.qualifiers.DEFAULT_QUALIFIER) : string * [.valuePermitted(v, [q])](#rtvref.qualifiers.valuePermitted) ⇒ boolean * [.restricted_values](#rtvref.qualifiers.restricted_values) : void ### qualifiers.REQUIRED Required qualifier: The value __must__ be of the expected type. Depending on the type, additional requirements may be enforced. Unless otherwise stated in type-specific rules, this qualifier does not permit the value to be `null` or `undefined`. Note the fact the value cannot be `undefined` implicitly requires a [shape](#rtvref.types.shape_descriptor)'s property to be defined _somewhere_ its prototype chain (if it weren't, then its value would be `undefined`, violating the requirements). For example, the shape `{name: [EXPECTED, STRING]}` would require the `name` property to exist and not be `undefined`, but would permit it to be `null` or even an empty string. See specific type for additional rules. **Kind**: static property of [qualifiers](#rtvref.qualifiers) **See** - [types](#rtvref.types) - [STRING](#rtvref.types.STRING) ### qualifiers.EXPECTED Expected qualifier: The value _should_ be of the expected type. Depending on the type, additional requirements may be enforced. Unless otherwise stated in type-specific rules, this qualifier does _not_ permit the value to be `undefined`, but does _permit_ it to be `null`. Note the fact the value cannot be `undefined` implicitly requires a [shape](#rtvref.types.shape_descriptor)'s property to be defined _somewhere_ its prototype chain (if it weren't, then its value would be `undefined`, violating the requirements). For example, the shape `{name: [EXPECTED, STRING]}` would require the `name` property to exist and not be `undefined`, but would permit it to be `null` or even an empty string. See specific type for additional rules. **Kind**: static property of [qualifiers](#rtvref.qualifiers) **See** - [types](#rtvref.types) - [STRING](#rtvref.types.STRING) ### qualifiers.OPTIONAL Optional qualifier: The value _may_ be of the expected type. Depending on the type, additional requirements may be enforced. Unless otherwise stated in type-specific rules, this qualifier _permits_ a the value to be `null` as well as `undefined`. Note the fact the value can be `undefined` implies it does _not_ require a [shape](#rtvref.types.shape_descriptor)'s property to be defined anywhere in its prototype chain. See specific type for additional rules. **Kind**: static property of [qualifiers](#rtvref.qualifiers) **See**: [types](#rtvref.types) ### qualifiers.TRUTHY Truthy qualifier: If the value is _truthy_, it must be of the expected type. Depending on the type, additional requirements may be enforced. Think of this qualifier as, "if _truthy_, the value is [required](#rtvref.qualifiers.REQUIRED) to be of the specified type." Unless otherwise stated in type-specific rules, this qualifier does _permit_ the value to be any [falsy value](#rtvref.types.falsy_values). Note the fact the value can be `undefined` implies it does _not_ require a [shape](#rtvref.types.shape_descriptor)'s property to be defined anywhere in its prototype chain. See specific type for additional rules. **Kind**: static property of [qualifiers](#rtvref.qualifiers) **See**: [types](#rtvref.types) ### qualifiers.qualifiers : [Enumeration](#rtvref.Enumeration) Enumeration (`string -> string`) of all qualifiers: - [REQUIRED](#rtvref.qualifiers.REQUIRED) - [EXPECTED](#rtvref.qualifiers.EXPECTED) - [OPTIONAL](#rtvref.qualifiers.OPTIONAL) - [TRUTHY](#rtvref.qualifiers.TRUTHY) **Kind**: static property of [qualifiers](#rtvref.qualifiers) ### qualifiers.DEFAULT\_QUALIFIER : string Default qualifier: [REQUIRED](#rtvref.qualifiers.REQUIRED) **Kind**: static constant of [qualifiers](#rtvref.qualifiers) ### qualifiers.valuePermitted(v, [q]) ⇒ boolean Convenience function to check if a value is permitted under basic qualifier rules: - REQUIRED: Cannot be any [falsy value](#rtvref.types.falsy_values), including `undefined` and `null`. - EXPECTED: Can be `null`. - OPTIONAL: Can be either `undefined` or `null`. - TRUTHY: Can be any [falsy value](#rtvref.types.falsy_values). **Kind**: static method of [qualifiers](#rtvref.qualifiers) **Returns**: boolean - `true` if the value is _falsy_ and the specific value is permitted by the basic qualifier's rules; `false` otherwise. For example, - `valuePermitted(null, REQUIRED) === false` - `valuePermitted(null, EXPECTED) === true` - `valuePermitted(1, *) === false` because the value `1` is not any of the permitted _falsy_ values for any qualifier - `valuePermitted(false, OPTIONAL) === false` because the value `false` is not permitted by OPTIONAL | Param | Type | Description | | --- | --- | --- | | v | \* | Value to check. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | ### qualifiers.restricted\_values : void

Restricted Values

Qualifiers impose restrictions on certain JavaScript values. Currently, the list of restricted values is the same as the list of JavaScript's [falsy values](#rtvref.types.falsy_values). This may change in the future if more qualifiers are added. See the documentation for each qualifier to know which of these values they permit or restrict. **Kind**: static typedef of [qualifiers](#rtvref.qualifiers) **See**: [valuePermitted](#rtvref.qualifiers.valuePermitted) ## rtvref.types : object

Types

**Kind**: static namespace of [rtvref](#rtvref) * [.types](#rtvref.types) : object * [.objTypes](#rtvref.types.objTypes) : [Enumeration](#rtvref.Enumeration) * [.argTypes](#rtvref.types.argTypes) : [Enumeration](#rtvref.Enumeration) * [.types](#rtvref.types.types) : [Enumeration](#rtvref.Enumeration) * [.ANY](#rtvref.types.ANY) : string * [.NULL](#rtvref.types.NULL) : string * [.STRING](#rtvref.types.STRING) : string * [.BOOLEAN](#rtvref.types.BOOLEAN) : string * [.SYMBOL](#rtvref.types.SYMBOL) : string * [.NUMBER](#rtvref.types.NUMBER) : string * [.FINITE](#rtvref.types.FINITE) : string * [.INT](#rtvref.types.INT) : string * [.SAFE_INT](#rtvref.types.SAFE_INT) : string * [.FLOAT](#rtvref.types.FLOAT) : string * [.FUNCTION](#rtvref.types.FUNCTION) : string * [.REGEXP](#rtvref.types.REGEXP) : string * [.DATE](#rtvref.types.DATE) : string * [.ERROR](#rtvref.types.ERROR) : string * [.PROMISE](#rtvref.types.PROMISE) : string * [.ARRAY](#rtvref.types.ARRAY) : string * [.ANY_OBJECT](#rtvref.types.ANY_OBJECT) : string * [.OBJECT](#rtvref.types.OBJECT) : string * [.PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) : string * [.CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) : string * [.HASH_MAP](#rtvref.types.HASH_MAP) : string * [.MAP](#rtvref.types.MAP) : string * [.WEAK_MAP](#rtvref.types.WEAK_MAP) : string * [.SET](#rtvref.types.SET) : string * [.WEAK_SET](#rtvref.types.WEAK_SET) : string * [.JSON](#rtvref.types.JSON) : string * [.DEFAULT_OBJECT_TYPE](#rtvref.types.DEFAULT_OBJECT_TYPE) : string * [.primitives](#rtvref.types.primitives) : void * [.falsy_values](#rtvref.types.falsy_values) : void * [.qualifier_rules](#rtvref.types.qualifier_rules) : void * [.shape_descriptor](#rtvref.types.shape_descriptor) : Object * [.type_arguments](#rtvref.types.type_arguments) : Object * [.STRING_args](#rtvref.types.STRING_args) : Object * [.SYMBOL_args](#rtvref.types.SYMBOL_args) : Object * [.numeric_args](#rtvref.types.numeric_args) : Object * [.shape_object_args](#rtvref.types.shape_object_args) : Object * [.ARRAY_args](#rtvref.types.ARRAY_args) : Object * [.collection_args](#rtvref.types.collection_args) : Object * [.typeset](#rtvref.types.typeset) : Object \| string \| Array \| function * [.fully_qualified_typeset](#rtvref.types.fully_qualified_typeset) : Array * [.custom_validator](#rtvref.types.custom_validator) ⇒ \* ### types.objTypes : [Enumeration](#rtvref.Enumeration) Enumeration (`string -> string`) of __object__ types: - [ANY_OBJECT](#rtvref.types.ANY_OBJECT) - [OBJECT](#rtvref.types.OBJECT) - [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) - [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) **Kind**: static property of [types](#rtvref.types) ### types.argTypes : [Enumeration](#rtvref.Enumeration) Enumeration (`string -> string`) of types that accept arguments: - [STRING](#rtvref.types.STRING) - [SYMBOL](#rtvref.types.SYMBOL) - [NUMBER](#rtvref.types.NUMBER) - [FINITE](#rtvref.types.FINITE) - [INT](#rtvref.types.INT) - [SAFE_INT](#rtvref.types.SAFE_INT) - [FLOAT](#rtvref.types.FLOAT) - [ARRAY](#rtvref.types.ARRAY) - [ANY_OBJECT](#rtvref.types.ANY_OBJECT) - [OBJECT](#rtvref.types.OBJECT) - [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) - [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) - [HASH_MAP](#rtvref.types.HASH_MAP) - [MAP](#rtvref.types.MAP) - [SET](#rtvref.types.SET) **Kind**: static property of [types](#rtvref.types) ### types.types : [Enumeration](#rtvref.Enumeration) Enumeration (`string -> string`) of all types: - [ANY](#rtvref.types.ANY) - [NULL](#rtvref.types.NULL) - [STRING](#rtvref.types.STRING) - [BOOLEAN](#rtvref.types.BOOLEAN) - [SYMBOL](#rtvref.types.SYMBOL) - [NUMBER](#rtvref.types.NUMBER) - [FINITE](#rtvref.types.FINITE) - [INT](#rtvref.types.INT) - [SAFE_INT](#rtvref.types.SAFE_INT) - [FLOAT](#rtvref.types.FLOAT) - [FUNCTION](#rtvref.types.FUNCTION) - [REGEXP](#rtvref.types.REGEXP) - [DATE](#rtvref.types.DATE) - [ERROR](#rtvref.types.ERROR) - [PROMISE](#rtvref.types.PROMISE) - [ARRAY](#rtvref.types.ARRAY) - [ANY_OBJECT](#rtvref.types.ANY_OBJECT) - [OBJECT](#rtvref.types.OBJECT) - [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) - [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) - [HASH_MAP](#rtvref.types.HASH_MAP) - [MAP](#rtvref.types.MAP) - [WEAK_MAP](#rtvref.types.WEAK_MAP) - [SET](#rtvref.types.SET) - [WEAK_SET](#rtvref.types.WEAK_SET) - [JSON](#rtvref.types.JSON) **Kind**: static property of [types](#rtvref.types) ### types.ANY : string The any type is special in that it allows _anything_, which includes `null` and `undefined` values. Because of this, it's the most liberal in terms of types as well as in its interaction with qualifiers. A more specific type should be used whenever possible to ensure a higher degree of confidence in the value being validated. Any rules per qualifiers: - REQUIRED: Can be any value, including `null` and `undefined`. - EXPECTED: Same rules as REQUIRED. - OPTIONAL: Same rules as EXPECTED. - TRUTHY: Same rules as OPTIONAL. Since this type removes the property's need for existence in the prototype chain, it renders the verification moot (i.e. the property of this type might as well not be included in a [shape descriptor](#rtvref.types.shape_descriptor) unless a [custom validator](#rtvref.types.custom_validator) is being used to do customized verification. **Kind**: static constant of [types](#rtvref.types) **See**: [qualifiers](#rtvref.qualifiers) ### types.NULL : string Null rules per qualifiers: Must be the `null` [primitive](#rtvref.types.primitives). Use this special type to explicitly test for a `null` value. For example, a [shape](#rtvref.types.shape_descriptor)'s property may be required to be `null` under certain circumstances. **Kind**: static constant of [types](#rtvref.types) **See**: [qualifiers](#rtvref.qualifiers) ### types.STRING : string String rules per qualifiers: - REQUIRED: Must be a non-empty string, unless an argument allows it. - EXPECTED | OPTIONAL: May be an empty string, unless an argument disallows it. Note that the value `null` (for EXPECTED and OPTIONAL) or `undefined` (for OPTIONAL) will not be subject to any restrictions imposed by arguments (i.e. the arguments will be ignored; for example, `rtv.verify(null, [EXPECTED, STRING, {min: 1}])` would _pass_ verification because `null` is permitted with EXPECTED). - TRUTHY: May be an empty string _regardless_ of arguments, since an empty string is _falsy_, and this qualifier permits all _falsy_ values. Therefore, `rtv.verify("", [TRUTHY, STRING, {min: 1}])` would still _pass_ verification because an empty string is permitted with TRUTHY. In all cases, the value must be a string [primitive](#rtvref.types.primitives). Note that `new String('hello') !== 'hello'` because the former is an _object_, not a string. Arguments (optional): [STRING_args](#rtvref.types.STRING_args) **Kind**: static constant of [types](#rtvref.types) **See**: [qualifiers](#rtvref.qualifiers) ### types.BOOLEAN : string Boolean rules per qualifiers: Must be a boolean [primitive](#rtvref.types.primitives). Note that `new Boolean(true) !== true` because the former is an _object_, not a boolean. **Kind**: static constant of [types](#rtvref.types) **See**: [qualifiers](#rtvref.qualifiers) ### types.SYMBOL : string Symbol rules per qualifiers: Must be a symbol [primitive](#rtvref.types.primitives). Arguments (optional): [SYMBOL_args](#rtvref.types.SYMBOL_args). **Kind**: static constant of [types](#rtvref.types) **See**: [qualifiers](#rtvref.qualifiers) ### types.NUMBER : string Number rules per qualifiers: - REQUIRED: Cannot be `NaN`, but could be `+Infinity`, `-Infinity`. - EXPECTED | OPTIONAL: Could be `NaN`, `+Infinity`, `-Infinity`. - TRUTHY: Could be `NaN` (since that is a [falsy value](#rtvref.types.falsy_values)), `+Infinity`, `-Infinity`. In all cases, the value must be a number [primitive](#rtvref.types.primitives). Note that `new Number(1) !== 1` because the former is an _object_, not a number. An number is not guaranteed to be a [safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). Arguments (optional): [numeric_args](#rtvref.types.numeric_args) **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [FINITE](#rtvref.types.FINITE) - [INT](#rtvref.types.INT) - [SAFE_INT](#rtvref.types.SAFE_INT) - [FLOAT](#rtvref.types.FLOAT) ### types.FINITE : string Finite rules per qualifiers: Cannot be `NaN` (unless the qualifier is TRUTHY), `+Infinity`, `-Infinity`. The value can be either an [integer](#rtvref.types.INT), or a [floating point number](#rtvref.types.FLOAT). It must also be a number [primitive](#rtvref.types.primitives). A finite number is not guaranteed to be a [safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). Arguments (optional): [numeric_args](#rtvref.types.numeric_args) **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [NUMBER](#rtvref.types.NUMBER) - [INT](#rtvref.types.INT) - [SAFE_INT](#rtvref.types.SAFE_INT) - [FLOAT](#rtvref.types.FLOAT) ### types.INT : string Int rules per qualifiers: Must be a [finite](#rtvref.types.FINITE) number, an integer, and a number [primitive](#rtvref.types.primitives). `NaN`, however, is permitted if the qualifier is TRUTHY. An integer is not guaranteed to be a [safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger). Arguments (optional): [numeric_args](#rtvref.types.numeric_args) **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [NUMBER](#rtvref.types.NUMBER) - [FINITE](#rtvref.types.FINITE) - [SAFE_INT](#rtvref.types.SAFE_INT) - [FLOAT](#rtvref.types.FLOAT) ### types.SAFE\_INT : string Int rules per qualifiers: Must be a [finite](#rtvref.types.FINITE) number, a [safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger), and a number [primitive](#rtvref.types.primitives). `NaN`, however, is permitted if the qualifier is TRUTHY. An integer is safe if it's an IEEE-754 double precision number which isn't the result of a rounded unsafe integer. For example, `2^53 - 1` is safe, but `2^53` is not because `2^53 + 1` would be rounded to `2^53`. Arguments (optional): [numeric_args](#rtvref.types.numeric_args) **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [NUMBER](#rtvref.types.NUMBER) - [FINITE](#rtvref.types.FINITE) - [INT](#rtvref.types.INT) - [FLOAT](#rtvref.types.FLOAT) ### types.FLOAT : string Float rules per qualifiers: Must be a [finite](#rtvref.types.FINITE) floating point number, and a number [primitive](#rtvref.types.primitives). Per IEEE 754, zero (`0`) is considered a float. Note that `NaN` is permitted if the qualifier is TRUTHY. Arguments (optional): [numeric_args](#rtvref.types.numeric_args) **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [NUMBER](#rtvref.types.NUMBER) - [FINITE](#rtvref.types.FINITE) - [INT](#rtvref.types.INT) - [SAFE_INT](#rtvref.types.SAFE_INT) ### types.FUNCTION : string Function rules per qualifiers: Must be a `function`. **Kind**: static constant of [types](#rtvref.types) **See**: [qualifiers](#rtvref.qualifiers) ### types.REGEXP : string RegExp rules per qualifiers: Must be a `RegExp` instance. **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp ### types.DATE : string Date rules per qualifiers: Must be a `Date` instance. **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date ### types.ERROR : string Error rules per qualifiers: Must be an `Error` instance, which includes `TypeError`, `RangeError`, `ReferenceError`, etc. **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error ### types.PROMISE : string Promise rules per qualifiers: Must be a `Promise` instance. **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise ### types.ARRAY : string Array rules per qualifiers: Must be an `Array`. Empty arrays are permitted, unless arguments prevent them. Arguments (optional): [ARRAY_args](#rtvref.types.ARRAY_args). Note that the `ARRAY` type must be specified when using arguments (i.e. the shorthand notation cannot be used). When describing arrays, either _shorthand_ or _full_ notation may be used. In the shorthand notation, the `ARRAY` type isn't necessary, but it's only possible to specify the Array typeset to use to validate each array element, and [arguments](#rtvref.types.ARRAY_args) can't be specified. In the [fully-qualified](#rtvref.types.fully_qualified_typeset) notation, the `ARRAY` type is required, but the Array typeset must be moved into the `typeset` argument (along with any other argument necessary). __NOTE__: It's important to realize that arrays (as in the JavaScript Array type) are essentially nested [Array typesets](#rtvref.types.typeset). They represent a set of types that will be used to validate each element of an array using a short-circuit OR conjunction, looking for the first type that matches.

Array Example: Simple array

The `value` property must be an array (possibly empty) of any type of value.
{
  value: [ARRAY]
}
__NOTE__: Since arrays are, in reality, nested [Array typesets](#rtvref.types.typeset), and since an empty array is an invalid Array typeset, it's not possible to use the shorthand notation to indicate what could be the equivalent: `[[]]`. The inner Array typeset would be deemed _invalid_.

Array Example: Shorthand notation

The `value` property must be an array (possibly empty) of finite numbers of any value.
{
  value: [[FINITE]]
}

Array Example: Shorthand, mixed types

The `value` property must be either a boolean; or an array (possibly empty) of finite numbers of any value, or non-empty strings, or a mix of both.
{
  value: [BOOLEAN, [FINITE, STRING]]
}

Array Example: Fully-qualified notation, no typeset

The `value` property must be a non-empty array of any type of value.
{
  value: [REQUIRED, ARRAY, {min: 1}]
}

Array Example: Fully-qualified notation

The `value` property must be an array (possibly empty) of finite numbers of any value (nested typeset is not fully-qualified).
{
  value: [REQUIRED, ARRAY, {$: [FINITE]}]
}

Array Example: Fully-qualified, mixed types

The `value` property must be either a boolean; or an array (possibly empty) of finite numbers of any value, or non-empty strings, or a mix of both (nested typeset is not fully-qualified).
{
  value: [REQUIRED, BOOLEAN, ARRAY, {$: [FINITE, STRING]}]
}
**Kind**: static constant of [types](#rtvref.types) **See**: [qualifiers](#rtvref.qualifiers) ### types.ANY\_OBJECT : string An _any_ object is anything that is __not__ a [primitive](#rtvref.types), which means it includes the `Array` type, as well as functions and arguments, and other JavaScript _object_ types. To test for an array, use the [ARRAY](#rtvref.types.ARRAY) type. To test for a function, use the [FUNCTION](#rtvref.types.FUNCTION) type. The following values __are considered__ any objects: - `{}` - `new Object()` - `new (function() {}) | new (class {})()` (class instance) (also see [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT)) - `new String('')` - `new Boolean(true)` - `new Number(1)` - `[]` (also see [ARRAY](#rtvref.types.ARRAY)) - `new Array()` (also see [ARRAY](#rtvref.types.ARRAY)) - `/re/` (also see [REGEXP](#rtvref.types.REGEXP)) - `new RegExp('re')` (also see [REGEXP](#rtvref.types.REGEXP)) - `new Date()` (also see [DATE](#rtvref.types.DATE)) - `new Error()` (also see [ERROR](#rtvref.types.ERROR)) - `new Promise()` (also see [PROMISE](#rtvref.types.PROMISE)) - `function(){}` (also see [FUNCTION](#rtvref.types.FUNCTION)) - `arguments` (function arguments) - `new Map()` (also see [MAP](#rtvref.types.MAP)) - `new WeakMap()` (also see [WEAK_MAP](#rtvref.types.WEAK_MAP)) - `new Set()` (also see [SET](#rtvref.types.SET)) - `new WeakSet()` (also see [WEAK_SET](#rtvref.types.WEAK_SET)) [Primitive](#rtvref.types.primitives) values __are not__ considered any objects, especially when the qualifier is [REQUIRED](#rtvref.qualifiers.REQUIRED). Note that `typeof null === 'object'` in JavaScript; the `ANY_OBJECT` type allows testing for this undesirable fact. Any object rules per qualifiers: - REQUIRED: Per the lists above. - EXPECTED: `null` is allowed. - OPTIONAL: `undefined` is allowed. Arguments (optional): [shape_object_args](#rtvref.types.shape_object_args) **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [OBJECT](#rtvref.types.OBJECT) - [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) - [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) ### types.OBJECT : string An object is one that extends from `JavaScript.Object` (i.e. an _instance_ of _something_ that extends from Object) and is not a [function](#rtvref.types.FUNCTION), [array](#rtvref.types.ARRAY), [regular expression](#rtvref.types.REGEXP), [DATE](#rtvref.types.DATE), function arguments object, [map](#rtvref.types.MAP), [weak map](#rtvref.types.WEAK_MAP), [set](#rtvref.types.SET), [weak set](#rtvref.types.WEAK_SET), nor a [primitive](#rtvref.types). This is the __default__ (imputed) type for [shape descriptors](#rtvref.types.shape_descriptor), which means the object itself (the value being tested), prior to being checked against its shape, will be tested according to this type. The following values are considered objects: - `{}` - `new Object()` - `new (function() {}) | new (class {})()` (class instance) (also see [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT)) The following values __are not__ considered objects: - `new String('')` - `new Boolean(true)` - `new Number(1)` - `[]` (also see [ARRAY](#rtvref.types.ARRAY)) - `new Array()` (also see [ARRAY](#rtvref.types.ARRAY)) - `/re/` (also see [REGEXP](#rtvref.types.REGEXP)) - `new RegExp('re')` (also see [REGEXP](#rtvref.types.REGEXP)) - `new Date()` (also see [DATE](#rtvref.types.DATE)) - `new Error()` (also see [ERROR](#rtvref.types.ERROR)) - `new Promise()` (also see [PROMISE](#rtvref.types.PROMISE)) - `function(){}` (also see [FUNCTION](#rtvref.types.FUNCTION)) - `arguments` (function arguments) - `new Map()` (also see [MAP](#rtvref.types.MAP)) - `new WeakMap()` (also see [WEAK_MAP](#rtvref.types.WEAK_MAP)) - `new Set()` (also see [SET](#rtvref.types.SET)) - `new WeakSet()` (also see [WEAK_SET](#rtvref.types.WEAK_SET)) - all [primitives](#rtvref.types.primitives) Object rules per qualifiers: - REQUIRED: Per the lists above. - EXPECTED: `null` is allowed. - OPTIONAL: `undefined` is allowed. Arguments (optional): [shape_object_args](#rtvref.types.shape_object_args) **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [ANY_OBJECT](#rtvref.types.ANY_OBJECT) - [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) - [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) ### types.PLAIN\_OBJECT : string A _plain_ object is one that is created directly from the `Object` constructor, whether using `new Object()` or the literal `{}`. The following values are considered plain objects: - `{}` - `new Object()` The following values __are not__ considered plain objects: - `new (function() {}) | new (class {})()` (class instance) (also see [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT)) - `new String('')` - `new Boolean(true)` - `new Number(1)` - `[]` (also see [ARRAY](#rtvref.types.ARRAY)) - `new Array()` (also see [ARRAY](#rtvref.types.ARRAY)) - `/re/` (also see [REGEXP](#rtvref.types.REGEXP)) - `new RegExp('re')` (also see [REGEXP](#rtvref.types.REGEXP)) - `new Date()` (also see [DATE](#rtvref.types.DATE)) - `new Error()` (also see [ERROR](#rtvref.types.ERROR)) - `new Promise()` (also see [PROMISE](#rtvref.types.PROMISE)) - `function(){}` (also see [FUNCTION](#rtvref.types.FUNCTION)) - `arguments` (function arguments) - `new Map()` (also see [MAP](#rtvref.types.MAP)) - `new WeakMap()` (also see [WEAK_MAP](#rtvref.types.WEAK_MAP)) - `new Set()` (also see [SET](#rtvref.types.SET)) - `new WeakSet()` (also see [WEAK_SET](#rtvref.types.WEAK_SET)) - all [primitives](#rtvref.types.primitives) Plain object rules per qualifiers: - REQUIRED: Per the lists above. - EXPECTED: `null` is allowed. - OPTIONAL: `undefined` is allowed. Arguments (optional): [shape_object_args](#rtvref.types.shape_object_args) **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [ANY_OBJECT](#rtvref.types.ANY_OBJECT) - [OBJECT](#rtvref.types.OBJECT) - [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) ### types.CLASS\_OBJECT : string A _class_ object is one that is created by invoking the `new` operator on a function (other than a primitive type function), generating a new object, commonly referred to as a _class instance_. This object's prototype (`__proto__`) is a reference to that function's `prototype` and has a `constructor` property that is `===` to the function. The following values are considered class objects: - `new (function() {}) | new (class {})()` (tip: use the `ctor` [argument](#rtvref.types.shape_object_args) to test for a specific class) The following values __are not__ considered class objects: - `{}` - `new Object()` - `new String('')` - `new Boolean(true)` - `new Number(1)` - `[]` (also see [ARRAY](#rtvref.types.ARRAY)) - `new Array()` (also see [ARRAY](#rtvref.types.ARRAY)) - `/re/` (also see [REGEXP](#rtvref.types.REGEXP)) - `new RegExp('re')` (also see [REGEXP](#rtvref.types.REGEXP)) - `new Date()` (also see [DATE](#rtvref.types.DATE)) - `new Error()` (also see [ERROR](#rtvref.types.ERROR)) - `new Promise()` (also see [PROMISE](#rtvref.types.PROMISE)) - `function(){}` (also see [FUNCTION](#rtvref.types.FUNCTION)) - `arguments` (function arguments) - `new Map()` (also see [MAP](#rtvref.types.MAP)) - `new WeakMap()` (also see [WEAK_MAP](#rtvref.types.WEAK_MAP)) - `new Set()` (also see [SET](#rtvref.types.SET)) - `new WeakSet()` (also see [WEAK_SET](#rtvref.types.WEAK_SET)) - all [primitives](#rtvref.types.primitives) Class object rules per qualifiers: - REQUIRED: Per the lists above. - EXPECTED: `null` is allowed. - OPTIONAL: `undefined` is allowed. Arguments (optional): [shape_object_args](#rtvref.types.shape_object_args) **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [ANY_OBJECT](#rtvref.types.ANY_OBJECT) - [OBJECT](#rtvref.types.OBJECT) - [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) ### types.HASH\_MAP : string A simple [OBJECT](#rtvref.types.OBJECT) that is treated as a hash map with an expected set of keys (forcibly strings due to the nature of the native JavaScript `Object` type) and values. Keys are __own-properties only__, and can be described using a regular expression. Values can be described using a [typeset](#rtvref.types.typeset). Empty maps are permitted. Map object rules per qualifiers: Same as [OBJECT](#rtvref.types.OBJECT) rules. Arguments (optional): [collection_args](#rtvref.types.collection_args) **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [ANY_OBJECT](#rtvref.types.ANY_OBJECT) - [OBJECT](#rtvref.types.OBJECT) - [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) - [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) - [MAP](#rtvref.types.MAP) - [WEAK_MAP](#rtvref.types.WEAK_MAP) ### types.MAP : string An ES6 map supports any value as its keys, unlike a [HASH_MAP](#rtvref.types.HASH_MAP) that only supports strings. Keys can be described using a regular expression (if they are strings), and values can be described using a [typeset](#rtvref.types.typeset). Empty maps are permitted by default. Map rules per qualifiers: Must be a `Map` instance. Arguments (optional): [collection_args](#rtvref.types.collection_args) **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [HASH_MAP](#rtvref.types.HASH_MAP) - [WEAK_MAP](#rtvref.types.WEAK_MAP) ### types.WEAK\_MAP : string An ES6 weak map supports any _object_ as its keys, unlike a [HASH_MAP](#rtvref.types.HASH_MAP) that only supports strings, and a [MAP](#rtvref.types.MAP) that supports any type of value. Weak map rules per qualifiers: Must be a `WeakMap` instance. **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [HASH_MAP](#rtvref.types.HASH_MAP) - [MAP](#rtvref.types.MAP) ### types.SET : string An ES6 set is a collection of _unique_ values without associated keys. Values can be described using a [typeset](#rtvref.types.typeset). Empty sets are permitted by default. Set rules per qualifiers: Must be a `Set` instance. Arguments (optional): [collection_args](#rtvref.types.collection_args) **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [WEAK_SET](#rtvref.types.WEAK_SET) ### types.WEAK\_SET : string An ES6 weak set is a collection of weakly held _unique_ _objects_ without associated keys. Weak set rules per qualifiers: Must be a `WeakSet` instance. **Kind**: static constant of [types](#rtvref.types) **See** - [qualifiers](#rtvref.qualifiers) - [SET](#rtvref.types.SET) ### types.JSON : string JSON rules per qualifiers: Must be a JSON value: - [null](#rtvref.types.NULL) - [string](#rtvref.types.STRING), however __empty strings are permitted__, even if the qualifier is `REQUIRED` - [boolean](#rtvref.types.BOOLEAN) - [finite number](#rtvref.types.FINITE), however `NaN` __is permitted__ if the qualifier is TRUTHY since it is a [falsy value](#rtvref.types.falsy_values). - [plain object](#rtvref.types.PLAIN_OBJECT) - [array](#rtvref.types.ARRAY) Since this type checks for _any_ valid JSON value, empty string and `null` values are permitted, even when the typeset is qualified as `REQUIRED`. Therefore, the `REQUIRED` qualifier has the same effect as the `EXPECTED` qualifier. Also note that if the qualifier is `OPTIONAL` or `TRUTHY`, then `undefined` will be a permitted value, even though it is not a JSON value. **Kind**: static constant of [types](#rtvref.types) **See**: [qualifiers](#rtvref.qualifiers) ### types.DEFAULT\_OBJECT\_TYPE : string Default object type: [OBJECT](#rtvref.types.OBJECT). This type is associated with an un-qualified [shape descriptor](#rtvref.types.shape_descriptor). **Kind**: static constant of [types](#rtvref.types) ### types.primitives : void

Primitives

In RTV.js (as in [ECMAScript 2015](https://developer.mozilla.org/en-US/docs/Glossary/Primitive)), a _primitive_ is considered one of the following types: - `undefined` - `null` - `string` (note that `new String('s')` does not produce a _primitive_, it produces an [object](#rtvref.types.OBJECT), and __should be avoided__). - `boolean` (note that `new Boolean(true)` does not produce a _primitive_, it produces an [object](#rtvref.types.OBJECT), and __should be avoided__). - `number` (note that `new Number(1)` does not produce a _primitive_, it produces an [object](#rtvref.types.OBJECT), and __should be avoided__). - `Symbol` **Kind**: static typedef of [types](#rtvref.types) **See**: [isPrimitive](#rtvref.validation.isPrimitive) ### types.falsy\_values : void

Falsy Values

In JavaScript, a _falsy_ value means any one of these values which, when tested in a logical operation like `&&`, `||`, or an `IF` statement, evaluates to `false`: - `undefined` - `null` - `false` - `0` - `""` - `NaN` **Kind**: static typedef of [types](#rtvref.types) **See**: [isFalsy](#rtvref.validation.isFalsy) ### types.qualifier\_rules : void

Rules Per Qualifiers

[Qualifiers](#rtvref.qualifiers) state basic rules. Unless otherwise stated, every type herein abides by those basic rules. Each type will also impose additional rules specific to the type of value it represents. For example, while the [FINITE](#rtvref.types.FINITE) type states that the value must not be `NaN`, `+Infinity`, nor `-Infinity`; it could be `null` if the qualifier used is `EXPECTED`; and it could be `undefined` if the qualifier used is `OPTIONAL`. **Kind**: static typedef of [types](#rtvref.types) ### types.shape\_descriptor : Object

Shape Descriptor

Describes the shape (i.e. interface) of an object as a map of properties to [typesets](#rtvref.types.typeset). Each typeset indicates whether the property is required, expected, or optional, using [qualifiers](#rtvref.qualifiers), along with possible types. Only __own-enumerable properties__ of the shape are considered part of the shape. When a value is [checked](#rtv.check) or [verified](#rtv.verify) against a given shape, _properties on the value that are not part of the shape are ignored_ (this is to stay true to the concept of an _interface_ whereby an object may have other functionality, but remains _compatible_ or _usable_ as long as it meets the specified contract as a subset of its properties and methods). If successfully checked/verified, the value is guaranteed to provide the properties described in the shape, and each property is guaranteed to be assigned to a value of at least one type described in each property's typeset. The shape descriptor itself must be an [OBJECT](#rtvref.types.OBJECT). An empty shape descriptor is valid, but will result in nothing being verified on the value, other than whether its type is the [default object type](#rtvref.types.DEFAULT_OBJECT_TYPE). __NOTE:__ A shape is simply a specific _type_ of typeset since a typeset can come in the form of multiple value types, including an object which represents a shape. **Kind**: static typedef of [types](#rtvref.types) **See** - [isShape](#rtvref.validation.isShape) - [typeset](#rtvref.types.typeset) ### types.type\_arguments : Object

Type Arguments

Some types will accept, or may even expect, one or more arguments. Each type will specify whether it has arguments, and if they're optional or required. Arguments are specified as a single [object](#rtvref.types.OBJECT) immediately following a type in an __Array__ [typeset](#rtvref.types.typeset) (i.e. an Array must be used as the typeset in order to provide arguments for a type). An arguments object immediately follows its type in a typeset, such as `[PLAIN_OBJECT, {$: {hello: STRING}}]`. This would specify the value must be a [plain object](#rtvref.types.PLAIN_OBJECT) with a shape that includes a property named 'hello', that property being a [required](#rtvref.qualifiers.REQUIRED) [string](#rtvref.types.STRING). Another example would be `[STRING, {min: 5}]`, which would require a string of at least 5 characters in length. Since [qualifiers](#rtvref.qualifiers) may affect how a value is validated against a type, [qualifier rules](#rtvref.types.qualifier_rules) will take precedence over any argument specified, _unless otherwise stated in the type's qualifier rules_ or arguments spec. **Kind**: static typedef of [types](#rtvref.types) **See**: [isTypeArgs](#rtvref.validation.isTypeArgs) ### types.STRING\_args : Object

String Arguments

**Kind**: static typedef of [types](#rtvref.types) **See**: [STRING](#rtvref.types.STRING) **Properties** | Name | Type | Description | | --- | --- | --- | | [oneOf] | string \| Array.<string> | An exact string to match (`===`). Can also be a list of strings, one of which must be an exact match. An empty string is allowed, and will override the normal rules of the `REQUIRED` [qualifier](#rtvref.qualifiers) which would otherwise require a non-empty string as the value. The list may contain an empty string. __An empty list will be ignored__. This argument is ignored if `exp` is specified. | | [partial] | string | A partial value to match (must be somewhere within the string). Ignored if not a string, an empty string, or `oneOf` or `exp` is specified. `min` and `max` take __precedence__ over this argument (min/max will be validated first, then a partial match will be attempted). | | [min] | number | Minimum inclusive length. Defaults to 1 for a `REQUIRED` string, and 0 for an `EXPECTED` or `OPTIONAL` string. Ignored if `oneOf` or `exp` is specified, or `min` is not a [FINITE](#rtvref.types.FINITE) number >= 0. | | [max] | number | Maximum inclusive length. Negative means no maximum. Ignored if `oneOf` or `exp` is specified, `max` is not a [FINITE](#rtvref.types.FINITE) number, or `max` is less than `min`. Defaults to -1 (unlimited length). Can be set to zero to require a zero-length string. | | [exp] | string | A string-based regular expression describing the string. For example, to require a string of numbers with a minimum length of 1, the following expression could be used: `"^\\d+$"`. | | [expFlags] | string | A string specifying any flags to use with the regular expression specified in `exp`. Ignored if _falsy_ or if `exp` is not specified. See the [RegExp#flags](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) parameter for more information. | ### types.SYMBOL\_args : Object

Symbol Arguments

**Kind**: static typedef of [types](#rtvref.types) **See**: [SYMBOL](#rtvref.types.SYMBOL) **Properties** | Name | Type | Description | | --- | --- | --- | | [oneOf] | symbol \| Array.<symbol> | An exact symbol to match (`===`). Can also be a list of symbols, one of which must be an exact match. Values to match are ignored if they are not symbols. An empty list will be ignored. | ### types.numeric\_args : Object

Numeric Value Arguments

Applicable to all numeric types: - [NUMBER](#rtvref.types.NUMBER) - [FINITE](#rtvref.types.FINITE) - [INT](#rtvref.types.INT) - [SAFE_INT](#rtvref.types.SAFE_INT) - [FLOAT](#rtvref.types.FLOAT) **Kind**: static typedef of [types](#rtvref.types) **See** - [NUMBER](#rtvref.types.NUMBER) - [FINITE](#rtvref.types.FINITE) - [INT](#rtvref.types.INT) - [SAFE_INT](#rtvref.types.SAFE_INT) - [FLOAT](#rtvref.types.FLOAT) - [qualifiers](#rtvref.qualifiers) **Properties** | Name | Type | Description | | --- | --- | --- | | [oneOf] | number \| Array.<number> | An exact number to match (`===`). Can also be a list of numbers, one of which must be an exact match. An empty list will be ignored. Values to match are ignored if they are not within normal range of the type (e.g. for `NUMBER`, could be `+Infinity`, or even `NaN` if the qualifier is not `REQUIRED`; but these values would be ignored by `FINITE` since they aren't part of the `FINITE` range), or not numbers at all. Note that `0` and `NaN` are permitted when the qualifier is `TRUTHY` even if they aren't part of the list or aren't the single match. | | [min] | number | Minimum inclusive value. Ignored if `oneOf` is specified, `min` is `NaN`, or `min` is not within normal range of the type. Note that `0` is permitted when the qualifier is `TRUTHY` even if the minimum does not permit it. | | [max] | number | Maximum inclusive value. Ignored if `oneOf` is specified, `max` is `NaN`, `max` is not within normal range of the type, or `max` is less than `min`. Note that `0` is permitted when the qualifier is `TRUTHY` even if the minimum does not permit it. | ### types.shape\_object\_args : Object

Shape Object Arguments

Applicable to all object types that may have a shape: - [ANY_OBJECT](#rtvref.types.ANY_OBJECT) - [OBJECT](#rtvref.types.OBJECT) - [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) - [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) **Kind**: static typedef of [types](#rtvref.types) **See** - [ANY_OBJECT](#rtvref.types.ANY_OBJECT) - [OBJECT](#rtvref.types.OBJECT) - [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) - [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) **Properties** | Name | Type | Description | | --- | --- | --- | | [$] | Object | The [shape descriptor](#rtvref.types.shape_descriptor) describing the expected interface of the value being verified. If not specified, none of the value's properties will be verified, and the `exact` flag (as well as the `exactShapes` verification option) will be ignored. __NOTE:__ Any properties in the shape itself that are `undefined` will be ignored. This facilitates merging shapes with destructuring when combining shapes into larger ones. Applies to all shape object types. | | [ctor] | function | A reference to a constructor function. If specified, the class object (instance) must have this class function in its inheritance chain such that ` instanceof ctor === true`. Note that this property is not serializable to JSON. Ignored if not a [function](#rtvref.types.FUNCTION). Applies to: [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT). | | [exact] | boolean | If `true`, this will restrict the __immediate__ object being verified to having the exact set of own-properties as those specified on the shape. By default, _additional_ own-properties on the object are ignored. In other words, the object must always have all of the shape's properties, but (by default) it may also have additional properties that are not in the shape. Setting `exact: true` would cause the verification to fail if the object has more properties than those specified in the shape. If specified, whether `true` or `false`, this flag overrides the `exactShapes` option for the verification __for this shape only__. Nested shapes will not be affected. The `exactShapes` flag that may be set in the verification's [context options](#rtvref.validator.type_validator_context_options) via a call to [check](#rtv.check) or [verify](#rtv.verify). __NOTE:__ If this flag is `true` and the shape is __empty__, it will restrict the object being verified to an empty object (i.e. no own-properties). __NOTE:__ If this flag is `true` and the shape is not specified, the flag will be ignored, not verifying the value being checked has any specific own-properties. Applies to all shape object types. | ### types.ARRAY\_args : Object

Array Arguments

**Kind**: static typedef of [types](#rtvref.types) **See**: [ARRAY](#rtvref.types.ARRAY) **Properties** | Name | Type | Description | | --- | --- | --- | | [$] | [typeset](#rtvref.types.typeset) | The typeset which every value in the array must match. Defaults to [ANY](#rtvref.types.ANY) which means any value will match. | | [length] | number | Exact length. Ignored if not a [FINITE](#rtvref.types.FINITE) number >= 0. | | [min] | number | Minimum inclusive length. Ignored if `length` is specified, or `min` is not a [FINITE](#rtvref.types.FINITE) number >= 0. Defaults to 0. | | [max] | number | Maximum inclusive length. Negative means no maximum. Ignored if `length` is specified, `max` is not a [FINITE](#rtvref.types.FINITE) number, or `max` is less than `min`. Defaults to -1 (unlimited). | ### types.collection\_args : Object

Collection Arguments

Describes the keys and values in a collection-based object, which is one of the following types: - [HASH_MAP](#rtvref.types.HASH_MAP) (NOTE: only __own-enumerable properties__ are considered part of this collection type) - [MAP](#rtvref.types.MAP) - [SET](#rtvref.types.SET) (with some exceptions) For example, the following arguments both verify a collection of 3-letter string keys (upper- or lowercase) to finite numbers: - `{keyExp: '[a-z]{3}', keyFlags: 'i', $values: FINITE}` - `{keyExp: '[a-zA-Z]{3}', $values: FINITE}` Note that [ARRAY](#rtvref.types.ARRAY) is __not__ included in this list because the array type has special syntax for describing the type of its items. See [ARRAY_args](#rtvref.types.ARRAY_args) instead. The [WEAK_MAP](#rtvref.types.WEAK_MAP) and [WEAK_SET](#rtvref.types.WEAK_SET) types do not apply because, due to their nature, their elements cannot be iterated. **Kind**: static typedef of [types](#rtvref.types) **See** - [HASH_MAP](#rtvref.types.HASH_MAP) - [MAP](#rtvref.types.MAP) - [SET](#rtvref.types.SET) **Properties** | Name | Type | Description | | --- | --- | --- | | [length] | number | The exact number of elements required in the collection. A negative value allows for any number of entries. Zero requires an empty collection. Ignored if not a [FINITE](#rtvref.types.FINITE) number. Applies to: All collection types. | | [$keys] | [typeset](#rtvref.types.typeset) | A typeset describing each key in the collection. If the type is [HASH_MAP](#rtvref.types.HASH_MAP), this argument is ignored due to the nature of its JavaScript `Object`-based implementation which requires that all keys be non-empty [strings](#rtvref.types.STRING). Applies to: [MAP](#rtvref.types.MAP). | | [keyExp] | string | A string-based regular expression describing the names of keys found in the collection. By default, there are no restrictions on key names. Ignored if the key type is not [STRING](#rtvref.types.STRING), as specified in `$keys` (when `$keys` is applicable to the collection type). For example, to require numerical keys, the following expression could be used: `"^\\d+$"`. Applies to: [HASH_MAP](#rtvref.types.HASH_MAP), [MAP](#rtvref.types.MAP). | | [keyFlags] | string | A string specifying any flags to use with the regular expression specified in `keyExp`. Ignored if _falsy_, or if `keyExp` is not specified or irrelevant. See the [RegExp#flags](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) parameter for more information. Applies to: [HASH_MAP](#rtvref.types.HASH_MAP), [MAP](#rtvref.types.MAP). | | [$values] | [typeset](#rtvref.types.typeset) | A typeset describing each value in the collection. If specified, all values must match this typeset (but the collection is not required to have any elements to be considered valid, unless `length` is specified). If not specified, no validation is performed on values. For example, to require arrays of non-empty string values as values in the collection, the following typeset could be used: `[[types.STRING]]`. Applies to: All collection types. | | [deep] | boolean | If `true`, the property value being tested does not match the `$values` typeset, and the property value [is a hash map](#rtvref.types.HASH_MAP), then verification will recurse into the property value and will attempt to verify its properties against the typeset in `$values`. If `false` (default), the property value must match the `$values` typeset. Applies to: [HASH_MAP](#rtvref.types.HASH_MAP). | ### types.typeset : Object \| string \| Array \| function

Typeset

Describes the possible types for a given value. It can be any one of the following JavaScript types: - [Object](#rtvref.types.OBJECT): For the root or a nested [shape descriptor](#rtvref.types.shape_descriptor) of _implied_ [OBJECT](#rtvref.types.OBJECT) type (unless paired with a specific object type like [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT), for example, when using the Array notation, e.g. `[PLAIN_OBJECT, {...}]`). If the object is empty (has no properties), nothing will be verified (anything will pass). - [String](#rtvref.types.STRING): For a single type, such as [FINITE](#rtvref.types.FINITE) for a finite number. Must be one of the types defined in [types](#rtvref.types). - [Function](#rtvref.types.FUNCTION): For a [custom validator](#rtvref.types.custom_validator) that will verify the value of the property using custom code. Since the Array form is not being used (only the validator is being provided), it's always invoked immediately. Since a type is not provided, the [ANY](#rtvref.types.ANY) type is implied. - [Array](#rtvref.types.ARRAY): For multiple type possibilities, optionally [qualified](#rtvref.qualifiers), using a short-circuit __OR__ conjunction, which means the value of the property being described must match _at least one_ of the types listed, but not all. Matching is done in a short-circuit fashion, from the first to the last element in the typeset. If a simpler type is a more likely match, it's more performant to specify it first/earlier in the typeset to avoid a match attempt on a nested shape or Array. - Cannot be an empty Array. - A given type may be included more than once in the typeset. This allows for greater composition. The first-matched will win. `[STRING, {oneOf: 'foo'}, STRING]` would validate both `'foo'` and `'bar'` because the second occurrence of `STRING` is not restricted to any specific value. - An Array is necessary to [qualify](#rtvref.qualifiers) the typeset as not required (see _Typeset Qualifiers_ below). - An Array is necessary if a type needs or requires [arguments](#rtvref.types.type_arguments). - If the __first__ element is an `Object` (or second, if a [qualifier](rtvref.types.qualifiers) is provided, and this, in a typeset that is _not_ [fully-qualified](#rtvref.types.fully_qualified_typeset)), it's treated as a nested [shape descriptor](#rtvref.types.shape_descriptor) describing an object of the [default object type](#rtvref.types.DEFAULT_OBJECT_TYPE). To include a shape descriptor at any other position within the array, it __must__ be preceded by a type, even if the default object type is being used (i.e. `OBJECT` must be specified as the type). For example, all these typesets are equivalent (and equivalent to just `{name: STRING}` as the typeset): `[{name: STRING}]`, `[REQUIRED, {name: STRING}]`, and `[REQUIRED, OBJECT, {$: {name: STRING}}]`, describing an object that has a name property which is a non-empty string. Changing it to `[STRING, {$: {name: STRING}}]`, however, does __not__ mean, "a non-empty string, or an object with a name property which is a non-empty string". In this case, the [object arguments](rtvref.types.object_args) `{$: {name: STRING}}` would be treated as [STRING arguments](#rtvref.types.STRING_args), which is likely not the intent. The arguments would have to be preceded by an object type (e.g. [OBJECT](#rtvref.types.OBJECT), [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT), etc.) to have them interpreted as in the former "OR" case. - If an element is an `Array` (any position), it's treated as a __nested list__ with an implied [ARRAY](#rtvref.types.ARRAY) type, e.g. `[BOOLEAN, [STRING, FINITE]]` would describe a property that should be a boolean, or an array of non-empty strings or finite numbers. See the `ARRAY` type reference for more information on _shorthand_ and _full_ notations. - If an element is a `Function`, it must be the __last__ element in the Array and will be treated as a [custom validator](#rtvref.types.custom_validator). Only one validator can be specified for a given typeset (additional validators may appear in nested typesets).

Typeset Qualifiers

All typesets use an _implied_ [REQUIRED](#rtvref.qualifiers.REQUIRED) qualifier unless otherwise specified. To qualify a typeset, a [qualifier](#rtvref.qualifiers) may be specified as the __first__ element in the `Array` form (if specified, it must be the first element). For example, `{note: [EXPECTED, STRING]}` would describe an object with a 'note' property that is an expected, but not required, string, which could therefore be either empty or even `null`. The `Array` form must be used in order to qualify a typeset as other than required, and the qualifier applies to all immediate types in the typeset (which means each nested typeset can have its own qualifier).

JSON Serialization

__ALL__ typesets should be fully JSON-serializable (via `JSON.stringify()` and `JSON.parse()`) with the following unavoidable exceptions: - [Custom validators](#rtvref.types.custom_validator) - [CLASS_OBJECT arguments](#rtvref.types.shape_object_args) 'ctor' property Those exceptions are due to the fact that these represent functions, and functions are not serializable to JSON. They will be ignored in the stringification process, unless a custom _replacer_ is provided which, _somehow_ (up to you), handles them. This could, among other possibilities, enable the transmission of typesets over network requests, perhaps embedded in JSON payloads, similar to [JSON-LD](https://json-ld.org/) schemas.

Typeset Example: Object

const contactShape = {
  name: rtv.STRING, // required, non-empty, string
  tags: [rtv.ARRAY, [rtv.STRING]], // required array of non-empty strings
  // tags: [[rtv.STRING]], // same as above, but using shortcut array format
  details: { // required nested object of type `OBJECT` (default)
    birthday: [rtv.EXPECTED, rtv.DATE] // Date (could be null)
  },
  notes: [rtv.OPTIONAL, rtv.STRING, function(value) { // optional string...
    if (value && !value.test(/^[A-Z].+\.$/)) {
      throw new Error('Note must start with a capital letter, end with a ' +
          period, and have something in between, if specified.');
    }
  }]
};

const contact = {
  name: 'John Doe',
  tags: ['colleagues', 'sports'],
  details: {
    birthday: null // not specified
  }
};

rtv.verify(contact, contactShape); // OK

const walletShape = {
  contacts: [[contactShape]], // list of contacts using nested shape
  address: {
    street: rtv.STRING
    // ...
  },
  money: rtv.FINITE
};

rtv.verify({
  contacts: [contact],
  address: {street: '123 Main St'},
  money: 100
}, walletShape); // OK

Typeset Example: String

rtv.verify('foo', rtv.STRING); // OK
rtv.verify('foo', rtv.FINITE); // ERROR

Typeset Example: Array

const typeset = [rtv.STRING, rtv.FINITE]; // non-empty string, or finite number
rtv.verify('foo', typeset); // OK
rtv.verify(1, typeset); // OK

Typeset Example: Function

const validator = (v) => {
  if (v % 10) {
    throw new Error('Number must be a factor of 10.');
  }
};

rtv.verify(100, validator); // OK
rtv.verify(120, [rtv.INT, validator]); // OK

Typeset Example: Alternate Qualifier

const person = {
  name: rtv.STRING, // required, non-empty
  age: [rtv.OPTIONAL, rtv.FINITE, (v) => { // 18 or older, if specified
    if (v < 18) {
      throw new Error('Must be 18 or older.');
    }
  }]
};
rtv.verify({name: 'Bob'}, person); // OK
rtv.verify({name: ''}, person); // ERROR
rtv.verify({name: 'Steve', age: 17}, person); // ERROR
rtv.verify({name: 'Steve', age: null}, person); // OK
**Kind**: static typedef of [types](#rtvref.types) ### types.fully\_qualified\_typeset : Array

Fully-Qualified Typeset

A [typeset](#rtvref.types.typeset) expressed without any shortcut notations or implied/default types to make it easier to parse, especially as the `match` parameter given to a [custom validator](#rtvref.types.custom_validator). A fully-qualified typeset always uses the array notation, and has a single [qualifier](#rtvref.qualifiers) as its first element, followed by at least one type, and at most one validator. For example: - `STRING` -> `[REQUIRED, STRING]` - `{note: STRING}` -> `[REQUIRED, OBJECT, {$: {note: [REQUIRED, STRING]}}]` - `[[FINITE]]` -> `[REQUIRED, ARRAY, {$: [REQUIRED, FINITE]}]` - `(v) => if (!v) { throw new Error(); }` -> `[REQUIRED, ANY, (v) => if (!v) { throw new Error(); }]` **Kind**: static typedef of [types](#rtvref.types) ### types.custom\_validator ⇒ \*

Custom Validator

A function used as a [typeset](#rtvref.types.typeset), or as a subset to a typeset, to provide custom verification of the value being verified. A typeset may only have one validator, and the validator is _only called if the value being verified was verified by at least one type in the typeset_. The validator must be the __last__ element within the typeset (if the typeset is an array, and a validator is needed). The validator must also be specified _after_ the [qualifier](#rtvref.qualifiers) in a typeset Array. The validator is invoked immediately after the first type match, but _only if a type match is made_. If the typeset is not [fully-qualified](#rtvref.types.fully_qualified_typeset) and does not explicitly specify a type, the [ANY](#rtvref.types.ANY) type is implied, which will match _any_ value, which means the validator will always be called. __NOTE about qualifiers:__ Validators will be invoked regardless of the qualifier. If the typeset's qualifier is `EXPECTED`, the validator __must handle `null` values__. If the qualifier is `OPTIONAL`, the validator __must handle `undefined` and `null` values__. Also note that a value of `null` or `undefined`, if permitted by the qualifier, will always be type-matched to the first type in the typeset because all types allow these values for their related qualifiers. There is one __disadvantage__ to using a custom validator: It cannot be serialized via JSON, which means it cannot be easily transmitted or persisted. One option would be to customize the serialization to JSON by serializing the validator to a special object with properties that would inform the deserialization process on how to reconstruct the validator dynamically. There may also be a way to persist the function's code, but that would require the use of the unsafe `eval()` function to later reconstitute it as an actual function. **Kind**: static typedef of [types](#rtvref.types) **Returns**: \* - Either `undefined` or a _truthy_ value to __pass__ the verification, or a _falsy_ value to fail it. The validator may also throw an `Error` to fail the verification. If a _falsy_ value (other than `undefined`) is returned, an `Error` will be generated and included in the resulting `RtvError` as its [failure](rtvref.RtvError#failure) property, as well as part of its `message`. While `undefined` is _falsy_, it's also the result of a function that did not return anything, which is interpreted as indicating the validator found no fault with the value. It's recommend to throw an `Error` with a helpful message rather than simply returning a _falsy_ value to fail the verification. **Throws**: - Error (Optional) If the validation fails. This error will fail the overall verification, and will be included in the resulting `RtvError` as its [failure](rtvref.RtvError#failure) property, as well as part of its `message`. Although not required, it's recommended to throw an error with a message that will help the developer determine why the custom validation failed, while avoiding exposing any sensitive information that may be found in the `value` (such as passwords). **See**: [isCustomValidator](#rtvref.validation.isCustomValidator) | Param | Type | Description | | --- | --- | --- | | value | \* | The value being verified. This value differs from `context.originalValue` in that it is the value currently being verified, closest to the custom validator itself, e.g. the value of element in an array, as opposed to the array itself, or the value of a property in an object, as opposed to the object itself. | | match | Array | A [fully-qualified](#rtvref.types.fully_qualified_typeset) typeset describing the __sub-type within__ the `typeset` parameter that matched, resulting in the custom validator being called (if no sub-types matched, it would not get called). For example, if the typeset used for verification was `[PLAIN_OBJECT, {$: {note: STRING}}, validator]`, this parameter would be a new Array typeset `[REQUIRED, PLAIN_OBJECT, {$: {note: STRING}}]`, and the `typeset` parameter would be a reference to the original `[PLAIN_OBJECT, {$: {note: STRING}}, validator]`. If the verification typeset was `[STRING, FINITE, validator]` and FINITE matched, this parameter would be `[REQUIRED, FINITE]` and the `typeset` parameter would be a reference to the original `[STRING, FINITE, validator]`. If the verification typeset was `[{message: STRING}, validator]` and the shape matched, this parameter would be `[REQUIRED, OBJECT, {$: {message: STRING}}]` (because of the [default object type](#rtvref.types.DEFAULT_OBJECT_TYPE)) and the `typeset` parameter would be a reference to the original `[{message: STRING}, validator]`. If the verification typeset was simply `validator` (just the validator itself), this parameter would be `[REQUIRED, ANY]` (because of the implied [ANY](#rtvref.types.ANY) type) and the `typeset` would be a reference to the original `validator`. | | typeset | [typeset](#rtvref.types.typeset) | Reference to the typeset used for verification. Note the typeset may contain nested typeset(s), and may be part of a larger parent typeset (though there would be no reference to the parent typeset, if any). | | context | [type\_validator\_context](#rtvref.validator.type_validator_context) | Additional context for the validation. | ## rtvref.util : object

RTV.js Utilities

**Kind**: static namespace of [rtvref](#rtvref) * [.util](#rtvref.util) : object * [.print(printValue, printOptions)](#rtvref.util.print) ⇒ string * [.hasOwnProp(obj, prop)](#rtvref.util.hasOwnProp) ⇒ boolean ### util.print(printValue, printOptions) ⇒ string Pretty-print a value. **Kind**: static method of [util](#rtvref.util) **Returns**: string - Pretty-printed value. It's not perfect and may not catch all types, but attempts to be good enough. | Param | Type | Default | Description | | --- | --- | --- | --- | | printValue | \* | | Value to print. | | printOptions | Object | | Print options. | | [printOptions.isTypeset] | boolean | false | `true` if the value being printed is a [typeset](#rtvref.types.typeset); `false` otherwise. | ### util.hasOwnProp(obj, prop) ⇒ boolean Safely determines if a property is an own-property of an object. **Kind**: static method of [util](#rtvref.util) **Returns**: boolean - `true` if it is; `false` otherwise. Also `false` if `obj` is _falsy_. | Param | Type | Description | | --- | --- | --- | | obj | Object | Object to check. Can be _falsy_. | | prop | string | Own-property to check. | ## rtvref.validation : object

RTV.js Validation

This namespace provides _type validations_ which verify values to be of the [types](#rtvref.types) defined in this library. If permitted values differ between [qualifiers](#rtvref.qualifiers), the validation must only permit the `REQUIRED` values. Validations strictly check for types; they do not consider [type arguments](#rtvref.types.type_arguments) or qualifiers like [type validators](#rtvref.validator) do. Validations may also check for pseudo-types, such as the [isTypeset](#rtvref.validation.isTypeset) validation verifying a value as a [typeset](#rtvref.types.typeset), which is not an actual type. __Every validation module must provide the following interface:__ - `{function} check`: The [validation method](#rtvref.validation.method) itself. - `{(string|undefined)} type`: The [type](#rtvref.types) verified; `undefined` for a pseudo-type (e.g. [primitive](#rtvref.types.primitives) or [typeset](#rtvref.types.typeset)). Validations are meant to be leaf modules. They should not import other modules other than types and other validations. Validation modules should be named as `is` such that their default export is named `is`. NOTE: Where possible, validations should use the other validations rather than third-party code (e.g. isTypeset.js needs to check for objects, so it should use the isObject.js validation rather than 'lodash/isObject', and let isObject.js decide the best way to check a value as being an 'object' as defined by this library in rtvref.types.OBJECT). This way, it makes it much easier to change the definition of a type later on. **Kind**: static namespace of [rtvref](#rtvref) * [.validation](#rtvref.validation) : object * [.method(value)](#rtvref.validation.method) ⇒ boolean * [.isAny](#rtvref.validation.isAny) : Module * [.type](#rtvref.validation.isAny.type) : string * [.check(v)](#rtvref.validation.isAny.check) ⇒ boolean * [.isAnyObject](#rtvref.validation.isAnyObject) : Module * [.type](#rtvref.validation.isAnyObject.type) : string * [.check(v)](#rtvref.validation.isAnyObject.check) ⇒ boolean * [.isArray](#rtvref.validation.isArray) : Module * [.type](#rtvref.validation.isArray.type) : string * [.check(v)](#rtvref.validation.isArray.check) ⇒ boolean * [.isBoolean](#rtvref.validation.isBoolean) : Module * [.type](#rtvref.validation.isBoolean.type) : string * [.check(v)](#rtvref.validation.isBoolean.check) ⇒ boolean * [.isClassObject](#rtvref.validation.isClassObject) : Module * [.type](#rtvref.validation.isClassObject.type) : string * [.check(v)](#rtvref.validation.isClassObject.check) ⇒ boolean * [.isCustomValidator](#rtvref.validation.isCustomValidator) : Module * [.type](#rtvref.validation.isCustomValidator.type) : string * [.check(v)](#rtvref.validation.isCustomValidator.check) ⇒ boolean * [.isDate](#rtvref.validation.isDate) : Module * [.type](#rtvref.validation.isDate.type) : string * [.check(v)](#rtvref.validation.isDate.check) ⇒ boolean * [.isError](#rtvref.validation.isError) : Module * [.type](#rtvref.validation.isError.type) : string * [.check(v)](#rtvref.validation.isError.check) ⇒ boolean * [.isFalsy](#rtvref.validation.isFalsy) : Module * [.type](#rtvref.validation.isFalsy.type) : string * [.check(v)](#rtvref.validation.isFalsy.check) ⇒ boolean * [.isFinite](#rtvref.validation.isFinite) : Module * [.type](#rtvref.validation.isFinite.type) : string * [.check(v)](#rtvref.validation.isFinite.check) ⇒ boolean * [.isFloat](#rtvref.validation.isFloat) : Module * [.type](#rtvref.validation.isFloat.type) : string * [.check(v)](#rtvref.validation.isFloat.check) ⇒ boolean * [.isFunction](#rtvref.validation.isFunction) : Module * [.type](#rtvref.validation.isFunction.type) : string * [.check(v)](#rtvref.validation.isFunction.check) ⇒ boolean * [.isHashMap](#rtvref.validation.isHashMap) : Module * [.type](#rtvref.validation.isHashMap.type) : string * [.check(v)](#rtvref.validation.isHashMap.check) ⇒ boolean * [.isInt](#rtvref.validation.isInt) : Module * [.type](#rtvref.validation.isInt.type) : string * [.check(v)](#rtvref.validation.isInt.check) ⇒ boolean * [.isJson](#rtvref.validation.isJson) : Module * [.type](#rtvref.validation.isJson.type) : string * [.check(v)](#rtvref.validation.isJson.check) ⇒ boolean * [.isMap](#rtvref.validation.isMap) : Module * [.type](#rtvref.validation.isMap.type) : string * [.check(v)](#rtvref.validation.isMap.check) ⇒ boolean * [.isNull](#rtvref.validation.isNull) : Module * [.type](#rtvref.validation.isNull.type) : string * [.check(v)](#rtvref.validation.isNull.check) ⇒ boolean * [.isNumber](#rtvref.validation.isNumber) : Module * [.type](#rtvref.validation.isNumber.type) : string * [.check(v)](#rtvref.validation.isNumber.check) ⇒ boolean * [.isObject](#rtvref.validation.isObject) : Module * [.type](#rtvref.validation.isObject.type) : string * [.check(v)](#rtvref.validation.isObject.check) ⇒ boolean * [.isPlainObject](#rtvref.validation.isPlainObject) : Module * [.type](#rtvref.validation.isPlainObject.type) : string * [.check(v)](#rtvref.validation.isPlainObject.check) ⇒ boolean * [.isPrimitive](#rtvref.validation.isPrimitive) : Module * [.type](#rtvref.validation.isPrimitive.type) : string * [.check(v)](#rtvref.validation.isPrimitive.check) ⇒ boolean * [.isPromise](#rtvref.validation.isPromise) : Module * [.type](#rtvref.validation.isPromise.type) : string * [.check(v)](#rtvref.validation.isPromise.check) ⇒ boolean * [.isRegExp](#rtvref.validation.isRegExp) : Module * [.type](#rtvref.validation.isRegExp.type) : string * [.check(v)](#rtvref.validation.isRegExp.check) ⇒ boolean * [.isSafeInt](#rtvref.validation.isSafeInt) : Module * [.type](#rtvref.validation.isSafeInt.type) : string * [.check(v)](#rtvref.validation.isSafeInt.check) ⇒ boolean * [.isSet](#rtvref.validation.isSet) : Module * [.type](#rtvref.validation.isSet.type) : string * [.check(v)](#rtvref.validation.isSet.check) ⇒ boolean * [.isShape](#rtvref.validation.isShape) : Module * [.type](#rtvref.validation.isShape.type) : string * [.check(v)](#rtvref.validation.isShape.check) ⇒ boolean * [.isString](#rtvref.validation.isString) : Module * [.type](#rtvref.validation.isString.type) : string * [.check(v, [options])](#rtvref.validation.isString.check) ⇒ boolean * [.isSymbol](#rtvref.validation.isSymbol) : Module * [.type](#rtvref.validation.isSymbol.type) : string * [.check(v)](#rtvref.validation.isSymbol.check) ⇒ boolean * [.isTypeArgs](#rtvref.validation.isTypeArgs) : Module * [.type](#rtvref.validation.isTypeArgs.type) : string * [.check(v)](#rtvref.validation.isTypeArgs.check) ⇒ boolean * [.isTypeset](#rtvref.validation.isTypeset) : Module * [.type](#rtvref.validation.isTypeset.type) : string * [.check(v, [options])](#rtvref.validation.isTypeset.check) ⇒ boolean * [.isWeakMap](#rtvref.validation.isWeakMap) : Module * [.type](#rtvref.validation.isWeakMap.type) : string * [.check(v)](#rtvref.validation.isWeakMap.check) ⇒ boolean * [.isWeakSet](#rtvref.validation.isWeakSet) : Module * [.type](#rtvref.validation.isWeakSet.type) : string * [.check(v)](#rtvref.validation.isWeakSet.check) ⇒ boolean ### validation.method(value) ⇒ boolean

Type Validation Method

Verifies a value is of a certain [type](#rtvref.types). **Kind**: static method of [validation](#rtvref.validation) **Returns**: boolean - `true` if the value matches the type; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | value | \* | The value to validate. | ### validation.isAny : Module Validation Module: isAny **Kind**: static typedef of [validation](#rtvref.validation) * [.isAny](#rtvref.validation.isAny) : Module * [.type](#rtvref.validation.isAny.type) : string * [.check(v)](#rtvref.validation.isAny.check) ⇒ boolean #### isAny.type : string Type: [ANY](#rtvref.types.ANY) **Kind**: static constant of [isAny](#rtvref.validation.isAny) #### isAny.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [ANY](#rtvref.types.ANY) type. **Kind**: static method of [isAny](#rtvref.validation.isAny) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isAnyObject : Module Validation Module: isAnyObject **Kind**: static typedef of [validation](#rtvref.validation) * [.isAnyObject](#rtvref.validation.isAnyObject) : Module * [.type](#rtvref.validation.isAnyObject.type) : string * [.check(v)](#rtvref.validation.isAnyObject.check) ⇒ boolean #### isAnyObject.type : string Type: [ANY_OBJECT](#rtvref.types.ANY_OBJECT) **Kind**: static constant of [isAnyObject](#rtvref.validation.isAnyObject) #### isAnyObject.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [ANY_OBJECT](#rtvref.types.ANY_OBJECT) type. **Kind**: static method of [isAnyObject](#rtvref.validation.isAnyObject) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isArray : Module Validation Module: isArray **Kind**: static typedef of [validation](#rtvref.validation) * [.isArray](#rtvref.validation.isArray) : Module * [.type](#rtvref.validation.isArray.type) : string * [.check(v)](#rtvref.validation.isArray.check) ⇒ boolean #### isArray.type : string Type: [ARRAY](#rtvref.types.ARRAY) **Kind**: static constant of [isArray](#rtvref.validation.isArray) #### isArray.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [ARRAY](#rtvref.types.ARRAY) type. **Kind**: static method of [isArray](#rtvref.validation.isArray) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isBoolean : Module Validation Module: isBoolean **Kind**: static typedef of [validation](#rtvref.validation) * [.isBoolean](#rtvref.validation.isBoolean) : Module * [.type](#rtvref.validation.isBoolean.type) : string * [.check(v)](#rtvref.validation.isBoolean.check) ⇒ boolean #### isBoolean.type : string Type: [BOOLEAN](#rtvref.types.BOOLEAN) **Kind**: static constant of [isBoolean](#rtvref.validation.isBoolean) #### isBoolean.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [BOOLEAN](#rtvref.types.BOOLEAN) type. Determines if a value is a boolean literal __only__ (i.e. a [primitive](#rtvref.types.primitives)). It does not validate `new Boolean(true)`, which is an object that is a boolean. **Kind**: static method of [isBoolean](#rtvref.validation.isBoolean) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isClassObject : Module Validation Module: isClassObject **Kind**: static typedef of [validation](#rtvref.validation) * [.isClassObject](#rtvref.validation.isClassObject) : Module * [.type](#rtvref.validation.isClassObject.type) : string * [.check(v)](#rtvref.validation.isClassObject.check) ⇒ boolean #### isClassObject.type : string Type: [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) **Kind**: static constant of [isClassObject](#rtvref.validation.isClassObject) #### isClassObject.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) type. **Kind**: static method of [isClassObject](#rtvref.validation.isClassObject) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isCustomValidator : Module Validation Module: isCustomValidator **Kind**: static typedef of [validation](#rtvref.validation) * [.isCustomValidator](#rtvref.validation.isCustomValidator) : Module * [.type](#rtvref.validation.isCustomValidator.type) : string * [.check(v)](#rtvref.validation.isCustomValidator.check) ⇒ boolean #### isCustomValidator.type : string Type: `undefined`, [custom validator](#rtvref.types.custom_validator) pseudo-type. **Kind**: static constant of [isCustomValidator](#rtvref.validation.isCustomValidator) #### isCustomValidator.check(v) ⇒ boolean Determines if a value is a [custom validator](#rtvref.types.custom_validator). **Kind**: static method of [isCustomValidator](#rtvref.validation.isCustomValidator) **Returns**: boolean - `true` if it is; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isDate : Module Validation Module: isDate **Kind**: static typedef of [validation](#rtvref.validation) * [.isDate](#rtvref.validation.isDate) : Module * [.type](#rtvref.validation.isDate.type) : string * [.check(v)](#rtvref.validation.isDate.check) ⇒ boolean #### isDate.type : string Type: [DATE](#rtvref.types.DATE) **Kind**: static constant of [isDate](#rtvref.validation.isDate) #### isDate.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [DATE](#rtvref.types.DATE) type. **Kind**: static method of [isDate](#rtvref.validation.isDate) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isError : Module Validation Module: isError **Kind**: static typedef of [validation](#rtvref.validation) * [.isError](#rtvref.validation.isError) : Module * [.type](#rtvref.validation.isError.type) : string * [.check(v)](#rtvref.validation.isError.check) ⇒ boolean #### isError.type : string Type: [ERROR](#rtvref.types.ERROR) **Kind**: static constant of [isError](#rtvref.validation.isError) #### isError.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [ERROR](#rtvref.types.ERROR) type. **Kind**: static method of [isError](#rtvref.validation.isError) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isFalsy : Module Validation Module: isFalsy **Kind**: static typedef of [validation](#rtvref.validation) * [.isFalsy](#rtvref.validation.isFalsy) : Module * [.type](#rtvref.validation.isFalsy.type) : string * [.check(v)](#rtvref.validation.isFalsy.check) ⇒ boolean #### isFalsy.type : string Type: `undefined`, [falsy value](#rtvref.types.falsy_values) pseudo-type. **Kind**: static constant of [isFalsy](#rtvref.validation.isFalsy) #### isFalsy.check(v) ⇒ boolean Determines if a value is a JavaScript [falsy value](#rtvref.types.falsy_values). **Kind**: static method of [isFalsy](#rtvref.validation.isFalsy) **Returns**: boolean - `true` if it is; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isFinite : Module Validation Module: isFinite **Kind**: static typedef of [validation](#rtvref.validation) * [.isFinite](#rtvref.validation.isFinite) : Module * [.type](#rtvref.validation.isFinite.type) : string * [.check(v)](#rtvref.validation.isFinite.check) ⇒ boolean #### isFinite.type : string Type: [FINITE](#rtvref.types.FINITE) **Kind**: static constant of [isFinite](#rtvref.validation.isFinite) #### isFinite.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [FINITE](#rtvref.types.FINITE) type. Determines if a value is a finite number literal __only__ (i.e. a [primitive](#rtvref.types.primitives)). It does not validate `new Number(1)`, which is an object that is a number. **Kind**: static method of [isFinite](#rtvref.validation.isFinite) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isFloat : Module Validation Module: isFloat **Kind**: static typedef of [validation](#rtvref.validation) * [.isFloat](#rtvref.validation.isFloat) : Module * [.type](#rtvref.validation.isFloat.type) : string * [.check(v)](#rtvref.validation.isFloat.check) ⇒ boolean #### isFloat.type : string Type: [FLOAT](#rtvref.types.FLOAT) **Kind**: static constant of [isFloat](#rtvref.validation.isFloat) #### isFloat.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [FLOAT](#rtvref.types.FLOAT) type. Determines if a value is a floating point literal __only__ (i.e. a [primitive](#rtvref.types.primitives)). It does not validate `new Number(1.5)`, which is an object that is a number. **Kind**: static method of [isFloat](#rtvref.validation.isFloat) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isFunction : Module Validation Module: isFunction **Kind**: static typedef of [validation](#rtvref.validation) * [.isFunction](#rtvref.validation.isFunction) : Module * [.type](#rtvref.validation.isFunction.type) : string * [.check(v)](#rtvref.validation.isFunction.check) ⇒ boolean #### isFunction.type : string Type: [FUNCTION](#rtvref.types.FUNCTION) **Kind**: static constant of [isFunction](#rtvref.validation.isFunction) #### isFunction.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [FUNCTION](#rtvref.types.FUNCTION) type. **Kind**: static method of [isFunction](#rtvref.validation.isFunction) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isHashMap : Module Validation Module: isHashMap **Kind**: static typedef of [validation](#rtvref.validation) * [.isHashMap](#rtvref.validation.isHashMap) : Module * [.type](#rtvref.validation.isHashMap.type) : string * [.check(v)](#rtvref.validation.isHashMap.check) ⇒ boolean #### isHashMap.type : string Type: [HASH_MAP](#rtvref.types.HASH_MAP) **Kind**: static constant of [isHashMap](#rtvref.validation.isHashMap) #### isHashMap.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [HASH_MAP](#rtvref.types.HASH_MAP) type. **Kind**: static method of [isHashMap](#rtvref.validation.isHashMap) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isInt : Module Validation Module: isInt **Kind**: static typedef of [validation](#rtvref.validation) * [.isInt](#rtvref.validation.isInt) : Module * [.type](#rtvref.validation.isInt.type) : string * [.check(v)](#rtvref.validation.isInt.check) ⇒ boolean #### isInt.type : string Type: [INT](#rtvref.types.INT) **Kind**: static constant of [isInt](#rtvref.validation.isInt) #### isInt.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [INT](#rtvref.types.INT) type. Determines if a value is an integer literal __only__ (i.e. a [primitive](#rtvref.types.primitives)). It does not validate `new Number(1)`, which is an object that is a number. **Kind**: static method of [isInt](#rtvref.validation.isInt) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isJson : Module Validation Module: isJson **Kind**: static typedef of [validation](#rtvref.validation) * [.isJson](#rtvref.validation.isJson) : Module * [.type](#rtvref.validation.isJson.type) : string * [.check(v)](#rtvref.validation.isJson.check) ⇒ boolean #### isJson.type : string Type: [JSON](#rtvref.types.JSON) **Kind**: static constant of [isJson](#rtvref.validation.isJson) #### isJson.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [JSON](#rtvref.types.JSON) type. **Kind**: static method of [isJson](#rtvref.validation.isJson) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isMap : Module Validation Module: isMap **Kind**: static typedef of [validation](#rtvref.validation) * [.isMap](#rtvref.validation.isMap) : Module * [.type](#rtvref.validation.isMap.type) : string * [.check(v)](#rtvref.validation.isMap.check) ⇒ boolean #### isMap.type : string Type: [MAP](#rtvref.types.MAP) **Kind**: static constant of [isMap](#rtvref.validation.isMap) #### isMap.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [MAP](#rtvref.types.MAP) type. **Kind**: static method of [isMap](#rtvref.validation.isMap) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isNull : Module Validation Module: isNull **Kind**: static typedef of [validation](#rtvref.validation) * [.isNull](#rtvref.validation.isNull) : Module * [.type](#rtvref.validation.isNull.type) : string * [.check(v)](#rtvref.validation.isNull.check) ⇒ boolean #### isNull.type : string Type: [NULL](#rtvref.types.NULL) **Kind**: static constant of [isNull](#rtvref.validation.isNull) #### isNull.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [NULL](#rtvref.types.NULL) type. **Kind**: static method of [isNull](#rtvref.validation.isNull) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isNumber : Module Validation Module: isNumber **Kind**: static typedef of [validation](#rtvref.validation) * [.isNumber](#rtvref.validation.isNumber) : Module * [.type](#rtvref.validation.isNumber.type) : string * [.check(v)](#rtvref.validation.isNumber.check) ⇒ boolean #### isNumber.type : string Type: [NUMBER](#rtvref.types.NUMBER) **Kind**: static constant of [isNumber](#rtvref.validation.isNumber) #### isNumber.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [NUMBER](#rtvref.types.NUMBER) type. Determines if a value is a number literal __only__ (i.e. a [primitive](#rtvref.types.primitives)). It does not validate `new Number(1)`, which is an object that is a number, neither does it validate `NaN`. **Kind**: static method of [isNumber](#rtvref.validation.isNumber) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isObject : Module Validation Module: isObject **Kind**: static typedef of [validation](#rtvref.validation) * [.isObject](#rtvref.validation.isObject) : Module * [.type](#rtvref.validation.isObject.type) : string * [.check(v)](#rtvref.validation.isObject.check) ⇒ boolean #### isObject.type : string Type: [OBJECT](#rtvref.types.OBJECT) **Kind**: static constant of [isObject](#rtvref.validation.isObject) #### isObject.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [OBJECT](#rtvref.types.OBJECT) type. **Kind**: static method of [isObject](#rtvref.validation.isObject) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isPlainObject : Module Validation Module: isPlainObject **Kind**: static typedef of [validation](#rtvref.validation) * [.isPlainObject](#rtvref.validation.isPlainObject) : Module * [.type](#rtvref.validation.isPlainObject.type) : string * [.check(v)](#rtvref.validation.isPlainObject.check) ⇒ boolean #### isPlainObject.type : string Type: [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) **Kind**: static constant of [isPlainObject](#rtvref.validation.isPlainObject) #### isPlainObject.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) type. **Kind**: static method of [isPlainObject](#rtvref.validation.isPlainObject) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isPrimitive : Module Validation Module: isPrimitive **Kind**: static typedef of [validation](#rtvref.validation) * [.isPrimitive](#rtvref.validation.isPrimitive) : Module * [.type](#rtvref.validation.isPrimitive.type) : string * [.check(v)](#rtvref.validation.isPrimitive.check) ⇒ boolean #### isPrimitive.type : string Type: `undefined`, [primitive](#rtvref.types.primitives) pseudo-type. **Kind**: static constant of [isPrimitive](#rtvref.validation.isPrimitive) #### isPrimitive.check(v) ⇒ boolean Determines if a value is a JavaScript [primitive](#rtvref.types.primitives). **Kind**: static method of [isPrimitive](#rtvref.validation.isPrimitive) **Returns**: boolean - `true` if it is; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isPromise : Module Validation Module: isPromise **Kind**: static typedef of [validation](#rtvref.validation) * [.isPromise](#rtvref.validation.isPromise) : Module * [.type](#rtvref.validation.isPromise.type) : string * [.check(v)](#rtvref.validation.isPromise.check) ⇒ boolean #### isPromise.type : string Type: [PROMISE](#rtvref.types.PROMISE) **Kind**: static constant of [isPromise](#rtvref.validation.isPromise) #### isPromise.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [PROMISE](#rtvref.types.PROMISE) type. **Kind**: static method of [isPromise](#rtvref.validation.isPromise) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isRegExp : Module Validation Module: isRegExp **Kind**: static typedef of [validation](#rtvref.validation) * [.isRegExp](#rtvref.validation.isRegExp) : Module * [.type](#rtvref.validation.isRegExp.type) : string * [.check(v)](#rtvref.validation.isRegExp.check) ⇒ boolean #### isRegExp.type : string Type: [REGEXP](#rtvref.types.REGEXP) **Kind**: static constant of [isRegExp](#rtvref.validation.isRegExp) #### isRegExp.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [REGEXP](#rtvref.types.REGEXP) type. **Kind**: static method of [isRegExp](#rtvref.validation.isRegExp) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isSafeInt : Module Validation Module: isSafeInt **Kind**: static typedef of [validation](#rtvref.validation) * [.isSafeInt](#rtvref.validation.isSafeInt) : Module * [.type](#rtvref.validation.isSafeInt.type) : string * [.check(v)](#rtvref.validation.isSafeInt.check) ⇒ boolean #### isSafeInt.type : string Type: [SAFE_INT](#rtvref.types.SAFE_INT) **Kind**: static constant of [isSafeInt](#rtvref.validation.isSafeInt) #### isSafeInt.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [SAFE_INT](#rtvref.types.SAFE_INT) type. Determines if a value is an integer literal __only__ (i.e. a [primitive](#rtvref.types.primitives)). It does not validate `new Number(1)`, which is an object that is a number. **Kind**: static method of [isSafeInt](#rtvref.validation.isSafeInt) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isSet : Module Validation Module: isSet **Kind**: static typedef of [validation](#rtvref.validation) * [.isSet](#rtvref.validation.isSet) : Module * [.type](#rtvref.validation.isSet.type) : string * [.check(v)](#rtvref.validation.isSet.check) ⇒ boolean #### isSet.type : string Type: [SET](#rtvref.types.SET) **Kind**: static constant of [isSet](#rtvref.validation.isSet) #### isSet.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [SET](#rtvref.types.SET) type. **Kind**: static method of [isSet](#rtvref.validation.isSet) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isShape : Module Validation Module: isShape **Kind**: static typedef of [validation](#rtvref.validation) * [.isShape](#rtvref.validation.isShape) : Module * [.type](#rtvref.validation.isShape.type) : string * [.check(v)](#rtvref.validation.isShape.check) ⇒ boolean #### isShape.type : string Type: `undefined`, [shape](#rtvref.types.shape_descriptor) pseudo-type. **Kind**: static constant of [isShape](#rtvref.validation.isShape) #### isShape.check(v) ⇒ boolean Determines if a value is a [shape](#rtvref.types.shape_descriptor). **Kind**: static method of [isShape](#rtvref.validation.isShape) **Returns**: boolean - `true` if it is; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isString : Module Validation Module: isString **Kind**: static typedef of [validation](#rtvref.validation) * [.isString](#rtvref.validation.isString) : Module * [.type](#rtvref.validation.isString.type) : string * [.check(v, [options])](#rtvref.validation.isString.check) ⇒ boolean #### isString.type : string Type: [STRING](#rtvref.types.STRING) **Kind**: static constant of [isString](#rtvref.validation.isString) #### isString.check(v, [options]) ⇒ boolean [Validation](#rtvref.validation.method) for the [STRING](#rtvref.types.STRING) type. Determines if a value is a string literal __only__ (i.e. a [primitive](#rtvref.types.primitives)), __including an empty string__. It does not validate `new String('value')`, which is an object that is a string. **Kind**: static method of [isString](#rtvref.validation.isString) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Default | Description | | --- | --- | --- | --- | | v | \* | | Value to validate. | | [options] | Object | | Validation options. | | [options.allowEmpty] | boolean | false | If truthy, empty strings are permitted. | ### validation.isSymbol : Module Validation Module: isSymbol **Kind**: static typedef of [validation](#rtvref.validation) * [.isSymbol](#rtvref.validation.isSymbol) : Module * [.type](#rtvref.validation.isSymbol.type) : string * [.check(v)](#rtvref.validation.isSymbol.check) ⇒ boolean #### isSymbol.type : string Type: [SYMBOL](#rtvref.types.SYMBOL) **Kind**: static constant of [isSymbol](#rtvref.validation.isSymbol) #### isSymbol.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [SYMBOL](#rtvref.types.SYMBOL) type. **Kind**: static method of [isSymbol](#rtvref.validation.isSymbol) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isTypeArgs : Module Validation Module: isTypeArgs **Kind**: static typedef of [validation](#rtvref.validation) * [.isTypeArgs](#rtvref.validation.isTypeArgs) : Module * [.type](#rtvref.validation.isTypeArgs.type) : string * [.check(v)](#rtvref.validation.isTypeArgs.check) ⇒ boolean #### isTypeArgs.type : string Type: `undefined`, [type arguments](#rtvref.types.type_arguments) pseudo-type. **Kind**: static constant of [isTypeArgs](#rtvref.validation.isTypeArgs) #### isTypeArgs.check(v) ⇒ boolean Determines if a value is a [type arguments](#rtvref.types.type_arguments) object. **Kind**: static method of [isTypeArgs](#rtvref.validation.isTypeArgs) **Returns**: boolean - `true` if it is; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isTypeset : Module Validation Module: isTypeset **Kind**: static typedef of [validation](#rtvref.validation) * [.isTypeset](#rtvref.validation.isTypeset) : Module * [.type](#rtvref.validation.isTypeset.type) : string * [.check(v, [options])](#rtvref.validation.isTypeset.check) ⇒ boolean #### isTypeset.type : string Type: `undefined`, [typeset](#rtvref.types.typeset) pseudo-type. **Kind**: static constant of [isTypeset](#rtvref.validation.isTypeset) #### isTypeset.check(v, [options]) ⇒ boolean Determines if a value is a typeset. **Kind**: static method of [isTypeset](#rtvref.validation.isTypeset) **Returns**: boolean - `true` if it is; `false` otherwise. **See**: [typeset](#rtvref.types.typeset) | Param | Type | Default | Description | | --- | --- | --- | --- | | v | \* | | Value to validate. | | [options] | Object | | Validation options. | | [options.deep] | boolean | false | If truthy, deeply-validates any nested typesets. Note that typesets in nested shapes are also deeply-validated. | | [options.fullyQualified] | boolean | false | If truthy, the typeset must be fully-qualified to be valid. | | [options.rootCause] | string \| undefined | | (Output property) If an options object is specified, this property will be added and set to a failure message IIF the validation fails. | ### validation.isWeakMap : Module Validation Module: isWeakMap **Kind**: static typedef of [validation](#rtvref.validation) * [.isWeakMap](#rtvref.validation.isWeakMap) : Module * [.type](#rtvref.validation.isWeakMap.type) : string * [.check(v)](#rtvref.validation.isWeakMap.check) ⇒ boolean #### isWeakMap.type : string Type: [WEAK_MAP](#rtvref.types.WEAK_MAP) **Kind**: static constant of [isWeakMap](#rtvref.validation.isWeakMap) #### isWeakMap.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [WEAK_MAP](#rtvref.types.WEAK_MAP) type. **Kind**: static method of [isWeakMap](#rtvref.validation.isWeakMap) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ### validation.isWeakSet : Module Validation Module: isWeakSet **Kind**: static typedef of [validation](#rtvref.validation) * [.isWeakSet](#rtvref.validation.isWeakSet) : Module * [.type](#rtvref.validation.isWeakSet.type) : string * [.check(v)](#rtvref.validation.isWeakSet.check) ⇒ boolean #### isWeakSet.type : string Type: [WEAK_SET](#rtvref.types.WEAK_SET) **Kind**: static constant of [isWeakSet](#rtvref.validation.isWeakSet) #### isWeakSet.check(v) ⇒ boolean [Validation](#rtvref.validation.method) for the [WEAK_SET](#rtvref.types.WEAK_SET) type. **Kind**: static method of [isWeakSet](#rtvref.validation.isWeakSet) **Returns**: boolean - `true` if validated; `false` otherwise. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | ## rtvref.validator : object

RTV.js Type Validators

This namespace provides validators for each supported [type](#rtvref.types), capable of fully validating a value against that type. Validators differ from type _validations_ provided by the [validation](#rtvref.validation) module in that validators verify a value against a single, specific type, considering [qualifiers](#rtvref.qualifiers) as well as [type arguments](#rtvref.types.type_arguments). __Every validator module must provide the following interface:__ - `{function} validate`: The [type validator](#rtvref.validator.type_validator) itself. - `{string} type`: The [type](#rtvref.types) verified. - `{function} config`: The [configuration function](#rtvref.validator.validator_config). Validator modules should be named as `val` such that their default export is named `val`. There can only be one validator for any given type. Where possible, each validator should use applicable [type validations](#rtvref.validation) rather than third-party code (e.g. lodash) to ensure that the semantics of each type is properly interpreted. If the validator introduces an entirely new type, then it should use whatever means necessary to properly identify the type which it validates. **Kind**: static namespace of [rtvref](#rtvref) * [.validator](#rtvref.validator) : object * [.type_validator(value, qualifier, args, context)](#rtvref.validator.type_validator) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.validator_config(settings)](#rtvref.validator.validator_config) * [.valAny](#rtvref.validator.valAny) : Module * [.type](#rtvref.validator.valAny.type) : string * [.config(settings)](#rtvref.validator.valAny.config) * [.validate(v, [q])](#rtvref.validator.valAny.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valAnyObject](#rtvref.validator.valAnyObject) : Module * [.type](#rtvref.validator.valAnyObject.type) : string * [.config(settings)](#rtvref.validator.valAnyObject.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valAnyObject.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valArray](#rtvref.validator.valArray) : Module * [.type](#rtvref.validator.valArray.type) : string * [.config(settings)](#rtvref.validator.valArray.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valArray.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valBoolean](#rtvref.validator.valBoolean) : Module * [.type](#rtvref.validator.valBoolean.type) : string * [.config(settings)](#rtvref.validator.valBoolean.config) * [.validate(v, [q])](#rtvref.validator.valBoolean.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valClassObject](#rtvref.validator.valClassObject) : Module * [.type](#rtvref.validator.valClassObject.type) : string * [.config(settings)](#rtvref.validator.valClassObject.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valClassObject.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valDate](#rtvref.validator.valDate) : Module * [.type](#rtvref.validator.valDate.type) : string * [.config(settings)](#rtvref.validator.valDate.config) * [.validate(v, [q])](#rtvref.validator.valDate.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valError](#rtvref.validator.valError) : Module * [.type](#rtvref.validator.valError.type) : string * [.config(settings)](#rtvref.validator.valError.config) * [.validate(v, [q])](#rtvref.validator.valError.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valFinite](#rtvref.validator.valFinite) : Module * [.type](#rtvref.validator.valFinite.type) : string * [.config(settings)](#rtvref.validator.valFinite.config) * [.validate(v, [q], [args])](#rtvref.validator.valFinite.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valFloat](#rtvref.validator.valFloat) : Module * [.type](#rtvref.validator.valFloat.type) : string * [.config(settings)](#rtvref.validator.valFloat.config) * [.validate(v, [q], [args])](#rtvref.validator.valFloat.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valFunction](#rtvref.validator.valFunction) : Module * [.type](#rtvref.validator.valFunction.type) : string * [.config(settings)](#rtvref.validator.valFunction.config) * [.validate(v, [q])](#rtvref.validator.valFunction.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valHashMap](#rtvref.validator.valHashMap) : Module * [.type](#rtvref.validator.valHashMap.type) : string * [.config(settings)](#rtvref.validator.valHashMap.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valHashMap.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.type_validator_context_options](#rtvref.validator.type_validator_context_options) : Object * [.type_validator_context](#rtvref.validator.type_validator_context) : Object * [.validator_config_settings](#rtvref.validator.validator_config_settings) : Object * [.valInt](#rtvref.validator.valInt) : Module * [.type](#rtvref.validator.valInt.type) : string * [.config(settings)](#rtvref.validator.valInt.config) * [.validate(v, [q], [args])](#rtvref.validator.valInt.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valJson](#rtvref.validator.valJson) : Module * [.type](#rtvref.validator.valJson.type) : string * [.config(settings)](#rtvref.validator.valJson.config) * [.validate(v, [q])](#rtvref.validator.valJson.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valMap](#rtvref.validator.valMap) : Module * [.type](#rtvref.validator.valMap.type) : string * [.config(settings)](#rtvref.validator.valMap.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valMap.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valNull](#rtvref.validator.valNull) : Module * [.type](#rtvref.validator.valNull.type) : string * [.config(settings)](#rtvref.validator.valNull.config) * [.validate(v, [q])](#rtvref.validator.valNull.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valNumber](#rtvref.validator.valNumber) : Module * [.type](#rtvref.validator.valNumber.type) : string * [.config(settings)](#rtvref.validator.valNumber.config) * [.validate(v, [q], [args])](#rtvref.validator.valNumber.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valObject](#rtvref.validator.valObject) : Module * [.type](#rtvref.validator.valObject.type) : string * [.config(settings)](#rtvref.validator.valObject.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valObject.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valPlainObject](#rtvref.validator.valPlainObject) : Module * [.type](#rtvref.validator.valPlainObject.type) : string * [.config(settings)](#rtvref.validator.valPlainObject.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valPlainObject.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valPromise](#rtvref.validator.valPromise) : Module * [.type](#rtvref.validator.valPromise.type) : string * [.config(settings)](#rtvref.validator.valPromise.config) * [.validate(v, [q])](#rtvref.validator.valPromise.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valRegExp](#rtvref.validator.valRegExp) : Module * [.type](#rtvref.validator.valRegExp.type) : string * [.config(settings)](#rtvref.validator.valRegExp.config) * [.validate(v, [q])](#rtvref.validator.valRegExp.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valSafeInt](#rtvref.validator.valSafeInt) : Module * [.type](#rtvref.validator.valSafeInt.type) : string * [.config(settings)](#rtvref.validator.valSafeInt.config) * [.validate(v, [q], [args])](#rtvref.validator.valSafeInt.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valSet](#rtvref.validator.valSet) : Module * [.type](#rtvref.validator.valSet.type) : string * [.config(settings)](#rtvref.validator.valSet.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valSet.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valString](#rtvref.validator.valString) : Module * [.type](#rtvref.validator.valString.type) : string * [.config(settings)](#rtvref.validator.valString.config) * [.validate(v, [q], [args])](#rtvref.validator.valString.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valSymbol](#rtvref.validator.valSymbol) : Module * [.type](#rtvref.validator.valSymbol.type) : string * [.config(settings)](#rtvref.validator.valSymbol.config) * [.validate(v, [q], [args])](#rtvref.validator.valSymbol.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valWeakMap](#rtvref.validator.valWeakMap) : Module * [.type](#rtvref.validator.valWeakMap.type) : string * [.config(settings)](#rtvref.validator.valWeakMap.config) * [.validate(v, [q])](#rtvref.validator.valWeakMap.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.valWeakSet](#rtvref.validator.valWeakSet) : Module * [.type](#rtvref.validator.valWeakSet.type) : string * [.config(settings)](#rtvref.validator.valWeakSet.config) * [.validate(v, [q])](#rtvref.validator.valWeakSet.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) ### validator.type\_validator(value, qualifier, args, context) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError)

Type Validator Function

NOTE: A validator must always give __precedence__ to [qualifier rules](#rtvref.types.qualifier_rules) for the type it's validating, over any arguments specified. For example, __NOTE:__ A validator must support all its qualifier rules, including proper handling of `null` values when [EXPECTED](#rtvref.qualifiers.EXPECTED) and `undefined` values when [OPTIONAL](#rtvref.qualifiers.OPTIONAL), __in addition to__ any type-specific qualifier rules. For example, the [STRING](#rtvref.types.STRING) type permits empty strings when not [REQUIRED](#rtvref.qualifiers.REQUIRED). **Kind**: static method of [validator](#rtvref.validator) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | value | \* | The value to validate. | | qualifier | string | The validation qualifier from the immediate [typeset](#rtvref.types.typeset) in which the pertaining type was specified. Validators should always explicitly default to [REQUIRED](#rtvref.qualifiers.REQUIRED) to maintain consistent behavior. | | args | Object | The arguments object, if any/applicable, for the type being validated. For example, [string args](#rtvref.types.STRING_args) in a typeset such as `[rtv.STRING, {min: 5}]` (a required string of at least 5 characters in length). | | context | [type\_validator\_context](#rtvref.validator.type_validator_context) | Additional context for the validation. | ### validator.validator\_config(settings)

Type Validator Configuration Function

This function is called to provide the [type validator](#rtvref.validator.type_validator) with access to internal utilities. **Kind**: static method of [validator](#rtvref.validator) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | ### validator.valAny : Module Validator Module: valAny **Kind**: static typedef of [validator](#rtvref.validator) * [.valAny](#rtvref.validator.valAny) : Module * [.type](#rtvref.validator.valAny.type) : string * [.config(settings)](#rtvref.validator.valAny.config) * [.validate(v, [q])](#rtvref.validator.valAny.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valAny.type : string Type: [ANY](#rtvref.types.ANY) **Kind**: static constant of [valAny](#rtvref.validator.valAny) #### valAny.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valAny](#rtvref.validator.valAny) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valAny.validate(v, [q]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [ANY](#rtvref.types.ANY) type. **Kind**: static method of [valAny](#rtvref.validator.valAny) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | ### validator.valAnyObject : Module Validator Module: valAnyObject **Kind**: static typedef of [validator](#rtvref.validator) * [.valAnyObject](#rtvref.validator.valAnyObject) : Module * [.type](#rtvref.validator.valAnyObject.type) : string * [.config(settings)](#rtvref.validator.valAnyObject.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valAnyObject.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valAnyObject.type : string Type: [ANY_OBJECT](#rtvref.types.ANY_OBJECT) **Kind**: static constant of [valAnyObject](#rtvref.validator.valAnyObject) #### valAnyObject.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valAnyObject](#rtvref.validator.valAnyObject) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valAnyObject.validate(v, [q], [args], [context]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [ANY_OBJECT](#rtvref.types.ANY_OBJECT) type. **Kind**: static method of [valAnyObject](#rtvref.validator.valAnyObject) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [shape\_object\_args](#rtvref.types.shape_object_args) | Type arguments. | | [context] | [type\_validator\_context](#rtvref.validator.type_validator_context) | Validation context. | ### validator.valArray : Module Validator Module: valArray **Kind**: static typedef of [validator](#rtvref.validator) * [.valArray](#rtvref.validator.valArray) : Module * [.type](#rtvref.validator.valArray.type) : string * [.config(settings)](#rtvref.validator.valArray.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valArray.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valArray.type : string Type: [ARRAY](#rtvref.types.ARRAY) **Kind**: static constant of [valArray](#rtvref.validator.valArray) #### valArray.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valArray](#rtvref.validator.valArray) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valArray.validate(v, [q], [args], [context]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [ARRAY](#rtvref.types.ARRAY) type. **Kind**: static method of [valArray](#rtvref.validator.valArray) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [ARRAY\_args](#rtvref.types.ARRAY_args) | Type arguments. | | [context] | [type\_validator\_context](#rtvref.validator.type_validator_context) | Validation context. | ### validator.valBoolean : Module Validator Module: valBoolean **Kind**: static typedef of [validator](#rtvref.validator) * [.valBoolean](#rtvref.validator.valBoolean) : Module * [.type](#rtvref.validator.valBoolean.type) : string * [.config(settings)](#rtvref.validator.valBoolean.config) * [.validate(v, [q])](#rtvref.validator.valBoolean.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valBoolean.type : string Type: [BOOLEAN](#rtvref.types.BOOLEAN) **Kind**: static constant of [valBoolean](#rtvref.validator.valBoolean) #### valBoolean.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valBoolean](#rtvref.validator.valBoolean) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valBoolean.validate(v, [q]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [BOOLEAN](#rtvref.types.BOOLEAN) type. Determines if a value is a boolean literal __only__ (i.e. a [primitive](#rtvref.types.primitives)). It does not validate `new Boolean(true)`, which is an object that is a boolean. **Kind**: static method of [valBoolean](#rtvref.validator.valBoolean) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | ### validator.valClassObject : Module Validator Module: valClassObject **Kind**: static typedef of [validator](#rtvref.validator) * [.valClassObject](#rtvref.validator.valClassObject) : Module * [.type](#rtvref.validator.valClassObject.type) : string * [.config(settings)](#rtvref.validator.valClassObject.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valClassObject.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valClassObject.type : string Type: [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) **Kind**: static constant of [valClassObject](#rtvref.validator.valClassObject) #### valClassObject.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valClassObject](#rtvref.validator.valClassObject) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valClassObject.validate(v, [q], [args], [context]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [CLASS_OBJECT](#rtvref.types.CLASS_OBJECT) type. **Kind**: static method of [valClassObject](#rtvref.validator.valClassObject) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [shape\_object\_args](#rtvref.types.shape_object_args) | Type arguments. | | [context] | [type\_validator\_context](#rtvref.validator.type_validator_context) | Validation context. | ### validator.valDate : Module Validator Module: valDate **Kind**: static typedef of [validator](#rtvref.validator) * [.valDate](#rtvref.validator.valDate) : Module * [.type](#rtvref.validator.valDate.type) : string * [.config(settings)](#rtvref.validator.valDate.config) * [.validate(v, [q])](#rtvref.validator.valDate.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valDate.type : string Type: [DATE](#rtvref.types.DATE) **Kind**: static constant of [valDate](#rtvref.validator.valDate) #### valDate.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valDate](#rtvref.validator.valDate) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valDate.validate(v, [q]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [DATE](#rtvref.types.DATE) type. **Kind**: static method of [valDate](#rtvref.validator.valDate) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | ### validator.valError : Module Validator Module: valError **Kind**: static typedef of [validator](#rtvref.validator) * [.valError](#rtvref.validator.valError) : Module * [.type](#rtvref.validator.valError.type) : string * [.config(settings)](#rtvref.validator.valError.config) * [.validate(v, [q])](#rtvref.validator.valError.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valError.type : string Type: [ERROR](#rtvref.types.ERROR) **Kind**: static constant of [valError](#rtvref.validator.valError) #### valError.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valError](#rtvref.validator.valError) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valError.validate(v, [q]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [ERROR](#rtvref.types.ERROR) type. **Kind**: static method of [valError](#rtvref.validator.valError) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | ### validator.valFinite : Module Validator Module: valFinite **Kind**: static typedef of [validator](#rtvref.validator) * [.valFinite](#rtvref.validator.valFinite) : Module * [.type](#rtvref.validator.valFinite.type) : string * [.config(settings)](#rtvref.validator.valFinite.config) * [.validate(v, [q], [args])](#rtvref.validator.valFinite.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valFinite.type : string Type: [FINITE](#rtvref.types.FINITE) **Kind**: static constant of [valFinite](#rtvref.validator.valFinite) #### valFinite.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valFinite](#rtvref.validator.valFinite) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valFinite.validate(v, [q], [args]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [FINITE](#rtvref.types.FINITE) type. Determines if a value is a number literal __only__ (i.e. a [primitive](#rtvref.types.primitives)). It does not validate `new Number(1)`, which is an object that is a number. **Kind**: static method of [valFinite](#rtvref.validator.valFinite) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [numeric\_args](#rtvref.types.numeric_args) | Type arguments. | ### validator.valFloat : Module Validator Module: valFloat **Kind**: static typedef of [validator](#rtvref.validator) * [.valFloat](#rtvref.validator.valFloat) : Module * [.type](#rtvref.validator.valFloat.type) : string * [.config(settings)](#rtvref.validator.valFloat.config) * [.validate(v, [q], [args])](#rtvref.validator.valFloat.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valFloat.type : string Type: [FLOAT](#rtvref.types.FLOAT) **Kind**: static constant of [valFloat](#rtvref.validator.valFloat) #### valFloat.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valFloat](#rtvref.validator.valFloat) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valFloat.validate(v, [q], [args]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [FLOAT](#rtvref.types.FLOAT) type. Determines if a value is a number literal __only__ (i.e. a [primitive](#rtvref.types.primitives)). It does not validate `new Number(1.5)`, which is an object that is a number. **Kind**: static method of [valFloat](#rtvref.validator.valFloat) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [numeric\_args](#rtvref.types.numeric_args) | Type arguments. | ### validator.valFunction : Module Validator Module: valFunction **Kind**: static typedef of [validator](#rtvref.validator) * [.valFunction](#rtvref.validator.valFunction) : Module * [.type](#rtvref.validator.valFunction.type) : string * [.config(settings)](#rtvref.validator.valFunction.config) * [.validate(v, [q])](#rtvref.validator.valFunction.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valFunction.type : string Type: [FUNCTION](#rtvref.types.FUNCTION) **Kind**: static constant of [valFunction](#rtvref.validator.valFunction) #### valFunction.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valFunction](#rtvref.validator.valFunction) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valFunction.validate(v, [q]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [FUNCTION](#rtvref.types.FUNCTION) type. **Kind**: static method of [valFunction](#rtvref.validator.valFunction) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | ### validator.valHashMap : Module Validator Module: valHashMap **Kind**: static typedef of [validator](#rtvref.validator) * [.valHashMap](#rtvref.validator.valHashMap) : Module * [.type](#rtvref.validator.valHashMap.type) : string * [.config(settings)](#rtvref.validator.valHashMap.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valHashMap.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valHashMap.type : string Type: [HASH_MAP](#rtvref.types.HASH_MAP) **Kind**: static constant of [valHashMap](#rtvref.validator.valHashMap) #### valHashMap.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valHashMap](#rtvref.validator.valHashMap) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valHashMap.validate(v, [q], [args], [context]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [HASH_MAP](#rtvref.types.HASH_MAP) type. **Kind**: static method of [valHashMap](#rtvref.validator.valHashMap) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [collection\_args](#rtvref.types.collection_args) | Type arguments. | | [context] | [type\_validator\_context](#rtvref.validator.type_validator_context) | Validation context. | ### validator.type\_validator\_context\_options : Object

Type Validator Context Options

General options for configuring the behavior of one or more [validators](#rtvref.validator) invoked during a [check](#rtv.check) or [verification](#rtv.verify) based on the specified [typeset](#rtvref.types.typeset). __All__ validators will receive these options. Validator-specific _options_ are known as [type arguments](#rtvref.types.type_arguments) and are specified inline within a [typeset](#rtvref.types.typeset). **Kind**: static typedef of [validator](#rtvref.validator) **Properties** | Name | Type | Description | | --- | --- | --- | | [exactShapes] | boolean | If `true`, any [shape](#rtvref.types.shape_descriptor) encountered, top-level or nested, unless specifically configured not to, will require that the related object's own-properties be _exactly_ those specified in the shape, no more, no less, as long as a shape is specified. By default, extra properties on the object (i.e. not in the shape) being verified are ignored. If a shape isn't specified on a given object-related typeset, this flag will be ignored for that typeset. This flag can be overridden on an individual shape basis with the shape's [exact argument](#rtvref.types.shape_object_args). | ### validator.type\_validator\_context : Object

Type Validator Context

This object provides important information to a [type validator](#rtvref.validator.type_validator), including a [custom validator](#rtvref.types.custom_validator), about the context of the current validation check. For example, a call to `rtv.verify({foo: 1}, {foo: validator})` would provide the following `context` to the invoked `validator`:
{
  originalValue: {foo: 1},
  parent: {foo: 1},
  parentKey: 'foo'
}
// and here, the validator's `value` parameter would be set to 1.
**Kind**: static typedef of [validator](#rtvref.validator) **Properties** | Name | Type | Description | | --- | --- | --- | | originalValue | \* | The original/first value given to [rtv.check()](#rtv.check) or [rtv.verify()](#rtv.verify). | | parent | Object \| Array \| Map \| Set \| undefined | Reference to the immediate parent of the property or element being validated. For example, if we have this object:
const foods = {    fruits: ['apple', 'orange', 'banana'],    vegetables: ['celery', 'cucumber', 'kale']  }  
and we validate it with the following typeset:
[rtv.HASH_MAP, {    keyExp: '\\w+',    $values: [[rtv.STRING, (value, match, typeset, context) => {      // called for each element of both arrays      value; // 'apple', 'orange', ..., 'cucumber', 'kale'      context.originalValue; // `foods`      context.parent; // first `fruits`, then `vegetables`    }]]  }]  
we see (in the comments) how `originalValue` and `parent` differ. `parent` gives more immediate context than `originalValue` does since it changes as the validation digs into the object hierarchy. `parent` will be `undefined` if the custom validator is placed at the top top of the typeset since there is no parent to reference in that case. For example:
[    rtv.HASH_MAP,    {      keyExp: '\\w+',      $values: [[rtv.STRING]]    },    (value, match, typeset, context) => {      // called once for the hash map itself      value; // `foods`      context.originalValue; // `foods`      context.parent; // `undefined`    }  ]  
| | parentKey | \* | Reference to the key/index in the `parent` that is being validated. The associated value is provided as the first parameter to the [custom validator](#rtvref.types.custom_validator). `parentKey` differs depending on the type of `parent`: - `Set`: `undefined` since Sets do not have indexes. Use the `value` parameter provided to the [custom validator](#rtvref.types.custom_validator) as the key into the `parent` in this case. - `Map`: When validating __keys__, always `undefined`. Use the `value` parameter provided to the [custom validator](#rtvref.types.custom_validator) to know which key is being validated. When validating __values__, `parentKey` will be any value that is a valid key in a `Map`. - `Object` (i.e. [HASH_MAP](#rtvref.types.HASH_MAP)): `string`, the key name. - `Array`: `number`, the element's index. - `undefined`: `undefined`. | | [options] | [type\_validator\_context\_options](#rtvref.validator.type_validator_context_options) | Configuration options. | ### validator.validator\_config\_settings : Object

Type Validator Configuration Settings

The settings provided to the [configuration function](#rtvref.validator.validator_config). **Kind**: static typedef of [validator](#rtvref.validator) **Properties** | Name | Type | Description | | --- | --- | --- | | impl | [impl](#rtvref.impl) | Reference to the `impl` module. | ### validator.valInt : Module Validator Module: valInt **Kind**: static typedef of [validator](#rtvref.validator) * [.valInt](#rtvref.validator.valInt) : Module * [.type](#rtvref.validator.valInt.type) : string * [.config(settings)](#rtvref.validator.valInt.config) * [.validate(v, [q], [args])](#rtvref.validator.valInt.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valInt.type : string Type: [INT](#rtvref.types.INT) **Kind**: static constant of [valInt](#rtvref.validator.valInt) #### valInt.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valInt](#rtvref.validator.valInt) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valInt.validate(v, [q], [args]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [INT](#rtvref.types.INT) type. Determines if a value is a number literal __only__ (i.e. a [primitive](#rtvref.types.primitives)). It does not validate `new Number(1)`, which is an object that is a number. **Kind**: static method of [valInt](#rtvref.validator.valInt) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [numeric\_args](#rtvref.types.numeric_args) | Type arguments. | ### validator.valJson : Module Validator Module: valJson **Kind**: static typedef of [validator](#rtvref.validator) * [.valJson](#rtvref.validator.valJson) : Module * [.type](#rtvref.validator.valJson.type) : string * [.config(settings)](#rtvref.validator.valJson.config) * [.validate(v, [q])](#rtvref.validator.valJson.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valJson.type : string Type: [JSON](#rtvref.types.JSON) **Kind**: static constant of [valJson](#rtvref.validator.valJson) #### valJson.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valJson](#rtvref.validator.valJson) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valJson.validate(v, [q]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [JSON](#rtvref.types.JSON) type. **Kind**: static method of [valJson](#rtvref.validator.valJson) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | ### validator.valMap : Module Validator Module: valMap **Kind**: static typedef of [validator](#rtvref.validator) * [.valMap](#rtvref.validator.valMap) : Module * [.type](#rtvref.validator.valMap.type) : string * [.config(settings)](#rtvref.validator.valMap.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valMap.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valMap.type : string Type: [MAP](#rtvref.types.MAP) **Kind**: static constant of [valMap](#rtvref.validator.valMap) #### valMap.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valMap](#rtvref.validator.valMap) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valMap.validate(v, [q], [args], [context]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [MAP](#rtvref.types.MAP) type. **Kind**: static method of [valMap](#rtvref.validator.valMap) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [collection\_args](#rtvref.types.collection_args) | Type arguments. | | [context] | [type\_validator\_context](#rtvref.validator.type_validator_context) | Validation context. | ### validator.valNull : Module Validator Module: valNull **Kind**: static typedef of [validator](#rtvref.validator) * [.valNull](#rtvref.validator.valNull) : Module * [.type](#rtvref.validator.valNull.type) : string * [.config(settings)](#rtvref.validator.valNull.config) * [.validate(v, [q])](#rtvref.validator.valNull.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valNull.type : string Type: [NULL](#rtvref.types.NULL) **Kind**: static constant of [valNull](#rtvref.validator.valNull) #### valNull.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valNull](#rtvref.validator.valNull) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valNull.validate(v, [q]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [NULL](#rtvref.types.NULL) type. **Kind**: static method of [valNull](#rtvref.validator.valNull) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | ### validator.valNumber : Module Validator Module: valNumber **Kind**: static typedef of [validator](#rtvref.validator) * [.valNumber](#rtvref.validator.valNumber) : Module * [.type](#rtvref.validator.valNumber.type) : string * [.config(settings)](#rtvref.validator.valNumber.config) * [.validate(v, [q], [args])](#rtvref.validator.valNumber.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valNumber.type : string Type: [NUMBER](#rtvref.types.NUMBER) **Kind**: static constant of [valNumber](#rtvref.validator.valNumber) #### valNumber.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valNumber](#rtvref.validator.valNumber) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valNumber.validate(v, [q], [args]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [NUMBER](#rtvref.types.NUMBER) type. Determines if a value is a number literal __only__ (i.e. a [primitive](#rtvref.types.primitives)). It does not validate `new Number(1)`, which is an object that is a number. **Kind**: static method of [valNumber](#rtvref.validator.valNumber) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [numeric\_args](#rtvref.types.numeric_args) | Type arguments. | ### validator.valObject : Module Validator Module: valObject **Kind**: static typedef of [validator](#rtvref.validator) * [.valObject](#rtvref.validator.valObject) : Module * [.type](#rtvref.validator.valObject.type) : string * [.config(settings)](#rtvref.validator.valObject.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valObject.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valObject.type : string Type: [OBJECT](#rtvref.types.OBJECT) **Kind**: static constant of [valObject](#rtvref.validator.valObject) #### valObject.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valObject](#rtvref.validator.valObject) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valObject.validate(v, [q], [args], [context]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [OBJECT](#rtvref.types.OBJECT) type. **Kind**: static method of [valObject](#rtvref.validator.valObject) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [shape\_object\_args](#rtvref.types.shape_object_args) | Type arguments. | | [context] | [type\_validator\_context](#rtvref.validator.type_validator_context) | Validation context. | ### validator.valPlainObject : Module Validator Module: valPlainObject **Kind**: static typedef of [validator](#rtvref.validator) * [.valPlainObject](#rtvref.validator.valPlainObject) : Module * [.type](#rtvref.validator.valPlainObject.type) : string * [.config(settings)](#rtvref.validator.valPlainObject.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valPlainObject.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valPlainObject.type : string Type: [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) **Kind**: static constant of [valPlainObject](#rtvref.validator.valPlainObject) #### valPlainObject.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valPlainObject](#rtvref.validator.valPlainObject) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valPlainObject.validate(v, [q], [args], [context]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [PLAIN_OBJECT](#rtvref.types.PLAIN_OBJECT) type. **Kind**: static method of [valPlainObject](#rtvref.validator.valPlainObject) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [shape\_object\_args](#rtvref.types.shape_object_args) | Type arguments. | | [context] | [type\_validator\_context](#rtvref.validator.type_validator_context) | Validation context. | ### validator.valPromise : Module Validator Module: valPromise **Kind**: static typedef of [validator](#rtvref.validator) * [.valPromise](#rtvref.validator.valPromise) : Module * [.type](#rtvref.validator.valPromise.type) : string * [.config(settings)](#rtvref.validator.valPromise.config) * [.validate(v, [q])](#rtvref.validator.valPromise.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valPromise.type : string Type: [PROMISE](#rtvref.types.PROMISE) **Kind**: static constant of [valPromise](#rtvref.validator.valPromise) #### valPromise.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valPromise](#rtvref.validator.valPromise) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valPromise.validate(v, [q]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [PROMISE](#rtvref.types.PROMISE) type. **Kind**: static method of [valPromise](#rtvref.validator.valPromise) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | ### validator.valRegExp : Module Validator Module: valRegExp **Kind**: static typedef of [validator](#rtvref.validator) * [.valRegExp](#rtvref.validator.valRegExp) : Module * [.type](#rtvref.validator.valRegExp.type) : string * [.config(settings)](#rtvref.validator.valRegExp.config) * [.validate(v, [q])](#rtvref.validator.valRegExp.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valRegExp.type : string Type: [REGEXP](#rtvref.types.REGEXP) **Kind**: static constant of [valRegExp](#rtvref.validator.valRegExp) #### valRegExp.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valRegExp](#rtvref.validator.valRegExp) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valRegExp.validate(v, [q]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [REGEXP](#rtvref.types.REGEXP) type. **Kind**: static method of [valRegExp](#rtvref.validator.valRegExp) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | ### validator.valSafeInt : Module Validator Module: valSafeInt **Kind**: static typedef of [validator](#rtvref.validator) * [.valSafeInt](#rtvref.validator.valSafeInt) : Module * [.type](#rtvref.validator.valSafeInt.type) : string * [.config(settings)](#rtvref.validator.valSafeInt.config) * [.validate(v, [q], [args])](#rtvref.validator.valSafeInt.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valSafeInt.type : string Type: [SAFE_INT](#rtvref.types.SAFE_INT) **Kind**: static constant of [valSafeInt](#rtvref.validator.valSafeInt) #### valSafeInt.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valSafeInt](#rtvref.validator.valSafeInt) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valSafeInt.validate(v, [q], [args]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [SAFE_INT](#rtvref.types.SAFE_INT) type. Determines if a value is a number literal __only__ (i.e. a [primitive](#rtvref.types.primitives)). It does not validate `new Number(1)`, which is an object that is a number. **Kind**: static method of [valSafeInt](#rtvref.validator.valSafeInt) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [numeric\_args](#rtvref.types.numeric_args) | Type arguments. | ### validator.valSet : Module Validator Module: valSet **Kind**: static typedef of [validator](#rtvref.validator) * [.valSet](#rtvref.validator.valSet) : Module * [.type](#rtvref.validator.valSet.type) : string * [.config(settings)](#rtvref.validator.valSet.config) * [.validate(v, [q], [args], [context])](#rtvref.validator.valSet.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valSet.type : string Type: [SET](#rtvref.types.SET) **Kind**: static constant of [valSet](#rtvref.validator.valSet) #### valSet.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valSet](#rtvref.validator.valSet) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valSet.validate(v, [q], [args], [context]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [SET](#rtvref.types.SET) type. **Kind**: static method of [valSet](#rtvref.validator.valSet) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [collection\_args](#rtvref.types.collection_args) | Type arguments. | | [context] | [type\_validator\_context](#rtvref.validator.type_validator_context) | Validation context. | ### validator.valString : Module Validator Module: valString **Kind**: static typedef of [validator](#rtvref.validator) * [.valString](#rtvref.validator.valString) : Module * [.type](#rtvref.validator.valString.type) : string * [.config(settings)](#rtvref.validator.valString.config) * [.validate(v, [q], [args])](#rtvref.validator.valString.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valString.type : string Type: [STRING](#rtvref.types.STRING) **Kind**: static constant of [valString](#rtvref.validator.valString) #### valString.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valString](#rtvref.validator.valString) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valString.validate(v, [q], [args]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [STRING](#rtvref.types.STRING) type. Determines if a value is a string literal __only__ (i.e. a [primitive](#rtvref.types.primitives)). It does not validate `new String('value')`, which is an object that is a string. **Kind**: static method of [valString](#rtvref.validator.valString) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [STRING\_args](#rtvref.types.STRING_args) | Type arguments. | ### validator.valSymbol : Module Validator Module: valSymbol **Kind**: static typedef of [validator](#rtvref.validator) * [.valSymbol](#rtvref.validator.valSymbol) : Module * [.type](#rtvref.validator.valSymbol.type) : string * [.config(settings)](#rtvref.validator.valSymbol.config) * [.validate(v, [q], [args])](#rtvref.validator.valSymbol.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valSymbol.type : string Type: [SYMBOL](#rtvref.types.SYMBOL) **Kind**: static constant of [valSymbol](#rtvref.validator.valSymbol) #### valSymbol.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valSymbol](#rtvref.validator.valSymbol) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valSymbol.validate(v, [q], [args]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [SYMBOL](#rtvref.types.SYMBOL) type. **Kind**: static method of [valSymbol](#rtvref.validator.valSymbol) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | | [args] | [numeric\_args](#rtvref.types.numeric_args) | Type arguments. | ### validator.valWeakMap : Module Validator Module: valWeakMap **Kind**: static typedef of [validator](#rtvref.validator) * [.valWeakMap](#rtvref.validator.valWeakMap) : Module * [.type](#rtvref.validator.valWeakMap.type) : string * [.config(settings)](#rtvref.validator.valWeakMap.config) * [.validate(v, [q])](#rtvref.validator.valWeakMap.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valWeakMap.type : string Type: [WEAK_MAP](#rtvref.types.WEAK_MAP) **Kind**: static constant of [valWeakMap](#rtvref.validator.valWeakMap) #### valWeakMap.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valWeakMap](#rtvref.validator.valWeakMap) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valWeakMap.validate(v, [q]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [WEAK_MAP](#rtvref.types.WEAK_MAP) type. **Kind**: static method of [valWeakMap](#rtvref.validator.valWeakMap) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | ### validator.valWeakSet : Module Validator Module: valWeakSet **Kind**: static typedef of [validator](#rtvref.validator) * [.valWeakSet](#rtvref.validator.valWeakSet) : Module * [.type](#rtvref.validator.valWeakSet.type) : string * [.config(settings)](#rtvref.validator.valWeakSet.config) * [.validate(v, [q])](#rtvref.validator.valWeakSet.validate) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) #### valWeakSet.type : string Type: [WEAK_SET](#rtvref.types.WEAK_SET) **Kind**: static constant of [valWeakSet](#rtvref.validator.valWeakSet) #### valWeakSet.config(settings) [Configuration Function](#rtvref.validator.validator_config) **Kind**: static method of [valWeakSet](#rtvref.validator.valWeakSet) | Param | Type | Description | | --- | --- | --- | | settings | [validator\_config\_settings](#rtvref.validator.validator_config_settings) | Configuration settings. | #### valWeakSet.validate(v, [q]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) [Validator](#rtvref.validator.type_validator) for the [WEAK_SET](#rtvref.types.WEAK_SET) type. **Kind**: static method of [valWeakSet](#rtvref.validator.valWeakSet) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - An `RtvSuccess` if valid; `RtvError` if not. | Param | Type | Description | | --- | --- | --- | | v | \* | Value to validate. | | [q] | string | Validation qualifier. Defaults to [REQUIRED](#rtvref.qualifiers.REQUIRED). | # rtv : object

RTV.js Public Interface

Provides the externally-facing API. It wraps the [implementation](#rtvref.impl), adding a bit of syntactic sugar, and adds the [configuration](#rtv.config) facilities. **Kind**: global namespace * [rtv](#rtv) : object * [.types](#rtv.types) : [Enumeration](#rtvref.Enumeration) * [.qualifiers](#rtv.qualifiers) : [Enumeration](#rtvref.Enumeration) * [.version](#rtv.version) : string * [.config](#rtv.config) : object * [.enabled](#rtv.config.enabled) : boolean * [.isTypeset()](#rtv.isTypeset) * [.fullyQualify()](#rtv.fullyQualify) * [.RtvSuccess()](#rtv.RtvSuccess) * [.RtvError()](#rtv.RtvError) * [.check(value, typeset, [options])](#rtv.check) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) * [.verify(value, typeset, [options])](#rtv.verify) ⇒ [RtvSuccess](#rtvref.RtvSuccess) ## rtv.types : [Enumeration](#rtvref.Enumeration) Enumeration of [types](#rtvref.types.types). __For convenience, each type is also available directly from this module__, e.g. `STRING`, `FINITE`, etc. The Enumeration can be used to perform additional validations (e.g. `types.verify('foo')` would throw because "foo" is not a valid type), however whether the type is referenced as `STRING` or `types.STRING` makes no difference to typeset validation. **Kind**: static property of [rtv](#rtv) **Read only**: true ## rtv.qualifiers : [Enumeration](#rtvref.Enumeration) Enumeration of [qualifiers](#rtvref.qualifiers.qualifiers). __For convenience, each qualifier is also available directly from this module__, e.g. `EXPECTED`, `OPTIONAL`, etc. The Enumeration can be used to perform additional validations (e.g. `qualifiers.verify('x')` would throw because "x" is not a valid qualifier), however whether the qualifier is referenced as `EXPECTED` or `qualifiers.EXPECTED`` makes no difference to typeset validation. **Kind**: static property of [rtv](#rtv) **Read only**: true ## rtv.version : string Library version. **Kind**: static property of [rtv](#rtv) **Read only**: true ## rtv.config : object

RTV.js Configuration

**Kind**: static namespace of [rtv](#rtv) ### config.enabled : boolean Globally enables or disables [verify](#rtv.verify) and [check](#rtv.check). When set to `false`, these methods are no-ops and always return success. Use this to enable code optimization when building source with a bundler that supports _tree shaking_, like [Rollup](https://rollupjs.org/) or [Webpack](https://webpack.js.org/). The following plugins can redefine the statement `rtv.config.enabled` as `false` prior to code optimizations that remove unreachable code: - Rollup: [rollup-plugin-replace](https://github.com/rollup/rollup-plugin-replace) - Webpack: [DefinePlugin](https://webpack.js.org/plugins/define-plugin/)

Enabled Example: Rollup

By conditionally calling [verify](#rtv.verify) based on the state of [enabled](#rtv.config.enabled), a bundler can be configured to completely remove the code from a production build. Given this module code snippet:
...

if (rtv.config.enabled) {
 rtv.verify(jsonResult, expectedShape);
}

rtv.config.enabled && rtv.verify(jsonResult, expectedShape); // a bit shorter

...
And using this `rollup.config.js` snippet:
const replacePlugin = require('rollup-plugin-replace');

module.exports = {
  ...
  plugins: [
    // invoke this plugin _before_ any other plugins
    replacePlugin({
      'rtv.config.enabled': JSON.stringify(false)
    }),
    ...
  ]
};
You could also define your own global to achieve the same result:
...
DO_TYPE_CHECKS && rtv.verify(...);
const replacePlugin = require('rollup-plugin-replace');

module.exports = {
  ...
  plugins: [
    // invoke this plugin _before_ any other plugins
    replacePlugin({
      DO_TYPE_CHECKS: JSON.stringify(false)
    }),
    ...
  ]
};
The code in the module snippet above would be completely removed from the build's output, thereby removing any rtv.js overhead from production. If you're using Webpack, be sure to also _not_ explicitly mark the `rtvjs` module as an external when disabling RTV.js: Doing so will result in the module always being required as an external, even when tree shaking eliminates all the code that comes from it. **Kind**: static property of [config](#rtv.config) **See** - [check](#rtv.check) - [verify](#rtv.verify) ## rtv.isTypeset() Determines if a value is a typeset. **Kind**: static method of [rtv](#rtv) **See**: [isTypeset](#rtvref.validation.isTypeset) ## rtv.fullyQualify() Fully-qualifies a given typeset. **Kind**: static method of [rtv](#rtv) **See**: [fullyQualify](#rtvref.impl.fullyQualify) ## rtv.RtvSuccess() Reference to the [RtvSuccess](#rtvref.RtvSuccess) class/constructor. This can be used to determine, for example, if the result of [rtv.check()](#rtv.check) is the success indicator: `if (result instanceof rtv.RtvSuccess) ...` Note that both [RtvSuccess](#rtvref.RtvSuccess) and [RtvError](#rtvref.RtvError) have a `valid: boolean` property which you can also use to easily test for success or failure. **Kind**: static method of [rtv](#rtv) **See**: [RtvSuccess](#rtvref.RtvSuccess) ## rtv.RtvError() Reference to the [RtvError](#rtvref.RtvError) class/constructor. This is useful if you need to determine whether an `Error` is an `RtvError` using the `instanceof` operator: `if (err instanceof rtv.RtvError) ...` **Kind**: static method of [rtv](#rtv) **See**: [RtvError](#rtvref.RtvError) ## rtv.check(value, typeset, [options]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) Checks a value against a typeset for compliance. **Kind**: static method of [rtv](#rtv) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) \| [RtvError](#rtvref.RtvError) - Success indicator if the `value` is compliant to the `shape`; `RtvError` if not. __Unlike [verify()](#rtv.verify), an exception is not thrown__ if the `value` is non-compliant. Since both [RtvSuccess](#rtvref.RtvSuccess) (returned when the check succeeds) as well as [RtvError](#rtvref.RtvError) (returned when the check fails) have a `valid: boolean` property in common, it's easy to test for success/failure like this: `if (rtv.check(2, rtv.FINITE).valid) {...}`. __NOTE:__ This method always returns a success indicator if RTV.js is currently [disabled](#rtv.config.enabled). **Throws**: - Error If `typeset` is not a valid typeset. **See** - [verify](#rtv.verify) - [enabled](#rtv.config.enabled) - [types](#rtvref.types) - [shape_descriptor](#rtvref.types.shape_descriptor) | Param | Type | Description | | --- | --- | --- | | value | \* | Value to check. | | typeset | [typeset](#rtvref.types.typeset) | Expected shape of (or typeset describing) the `value`. A shape is a kind of typeset. Normally, this is a [shape descriptor](#rtvref.types.shape_descriptor). | | [options] | [type\_validator\_context\_options](#rtvref.validator.type_validator_context_options) | Configuration options. | ## rtv.verify(value, typeset, [options]) ⇒ [RtvSuccess](#rtvref.RtvSuccess) __Requires__ a value to be compliant to a shape. __NOTE:__ This method always returns a success indicator if RTV.js is currently [disabled](#rtv.config.enabled). **Kind**: static method of [rtv](#rtv) **Returns**: [RtvSuccess](#rtvref.RtvSuccess) - Success indicator IIF the `value` is compliant to the `shape`. Otherwise, an [RtvError](#rtvref.RtvError) __is thrown__. **Throws**: - [RtvError](#rtvref.RtvError) If the `value` is not compliant to the `shape`. - Error If `typeset` is not a valid typeset. **See** - [check](#rtv.check) - [enabled](#rtv.config.enabled) - [types](#rtvref.types) - [shape_descriptor](#rtvref.types.shape_descriptor) | Param | Type | Description | | --- | --- | --- | | value | \* | Value to check. | | typeset | [typeset](#rtvref.types.typeset) | Expected shape of (or typeset describing) the `value`. A shape is a kind of typeset. Normally, this is a [shape descriptor](#rtvref.types.shape_descriptor). | | [options] | [type\_validator\_context\_options](#rtvref.validator.type_validator_context_options) | Configuration options. |