Commit 2ffe570e authored by Stefan Cameron's avatar Stefan Cameron

Added Null validator, validators now handle null/undefined, 100% coverage

For properties/values that are expected to be `null`, the `valNull`
validator will now handle it.

Validators must now also handle `null` and `undefined` values according
to the specified qualifier, returning success if the given value is
one or the other, as long as the qualifier permits those values. For
example, if the qualifier is EXPECTED and the value is `null`, then
any validator would return success for that value. Given the same
qualifier, but a value of `undefined`, all validators (except for
the ANY type which is somewhat of an exception) would return an error
because that value is not permitted given that qualifier.

To help with `null` and `undefined` values, a new `nilPermitted()`
method is provided by the `qualifiers` module.

Finally, test coverage is back to 100%!!
parent e91f6706
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -130,7 +130,7 @@ export default class Enumeration {
const result = this.check(value);
if (result === undefined && !silent) {
throw new Error(`Invalid value for ${this.$name ? `${print(this.$name)} ` : ''}enum[${this.$values.map(print).join(', ')}]: ${print(value)}`);
throw new Error(`Invalid value for ${this.$name ? `${print(this.$name)} ` : ''}enumeration (${this.$values.map(print).join(', ')}): ${print(value)}`);
}
return result;
......
This diff is collapsed.
......@@ -4,49 +4,68 @@ import Enumeration from './Enumeration';
/**
* <h2>Qualifiers</h2>
*
* Qualifiers determine the degree at which a value must be of a given type.
*
* @namespace rtvref.qualifiers
*/
/**
* Required qualifier: Property _must_ exist and be of the expected type.
* Depending on the type, additional requirements may be enforced.
* 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 _requires_ the
* property to be defined _somewhere_ within the prototype chain, and does not
* allow its value to be `null` or `undefined`.
* Unless otherwise stated in type-specific rules, this qualifier does not
* allow the value to be `null` or `undefined`.
*
* Note the fact the value cannot be `undefined` implicitly requires a
* {@link rtvref.shape_descriptor shape}'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
* allow it to be `null` or even an empty string.
*
* See specific type for additional rules.
*
* @name rtvref.qualifiers.REQUIRED
* @const {string}
* @see {@link rtvref.types}
* @see {@link rtvref.types.STRING}
*/
const REQUIRED = '!';
/**
* Expected qualifier: Property _should_ exist and be of the expected type.
* Depending on the type, some requirements may not be enforced.
* 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_ allow
* the value to be `undefined`, but does _allow_ it to be `null`.
*
* Unless otherwise stated in type-specific rules, this qualifier _requires_ the
* property to be defined _somewhere_ within the prototype chain, does _not_ allow
* its value to be `undefined`, but does _allow_ its value to be `null`.
* Note the fact the value cannot be `undefined` implicitly requires a
* {@link rtvref.shape_descriptor shape}'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
* allow it to be `null` or even an empty string.
*
* See specific type for additional rules.
*
* @name rtvref.qualifiers.EXPECTED
* @const {string}
* @see {@link rtvref.types}
* @see {@link rtvref.types.STRING}
*/
const EXPECTED = '+';
/**
* Optional qualifier: Property _may_ exist and be of the expected type.
* Depending on the type, some requirements may not be enforced (i.e. less so
* than with the `EXPECTED` qualifier).
* 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 _allows_ a
* property value to be `null` as well as `undefined`, and does _not_ require
* the property to be defined anywhere in the prototype chain.
* the value to be `null` as well as `undefined`,
*
* Note the fact the value can be `undefined` implies it does _not_ require a
* {@link rtvref.shape_descriptor shape}'s property to be defined anywhere in
* its prototype chain.
*
* See specific type for additional rules.
*
......@@ -66,6 +85,37 @@ const OPTIONAL = '?';
*/
export const DEFAULT_QUALIFIER = REQUIRED;
/**
* Convenience function to check if a nil value (either `undefined` or `null`)
* is permitted under basic qualifier rules:
*
* - REQUIRED: Cannot be `undefined` nor `null`.
* - EXPECTED: Can be `null`.
* - OPTIONAL: Can be either `undefined` or `null`.
*
* @function rtvref.qualifiers.checkBasicRules
* @param {*} v Value to check.
* @param {string} [q] Validation qualifier. Defaults to
* {@link rtvref.qualifiers.REQUIRED REQUIRED}.
* @returns {boolean} `true` if the value is _nil_ (either `null` or `undefined`)
* and the basic qualifier's rules allow it to be so; `false` otherwise.
*
* For example, `nilPermitted(null, REQUIRED) === false` while
* `nilPermitted(null, EXPECTED) === true`. Also, `nilPermitted(1, *) === false`
* because the value `1` is not _nil_
*/
export const nilPermitted = function(v, q = REQUIRED) {
if (q === REQUIRED) {
return false;
}
if (q === EXPECTED) {
return (v === null);
}
return (v === undefined || v === null);
};
/**
* Enumeration (`string -> string`) of {@link rtvref.qualifiers qualifiers}.
* @name rtvref.qualifiers.qualifiers
......
This diff is collapsed.
......@@ -46,7 +46,7 @@ export const print = function(printValue) {
}
return value; // keep stringifying since we're returning an object
}
};
const result = replacer(false, undefined, printValue);
......
////// isNull validation
import types from '../types';
/**
* Type: {@link rtvref.types.NULL NULL}
* @const {string} rtvref.validation.isFunction.type
*/
export const type = types.NULL;
/**
* {@link rtvref.validation.method Validation} for the
* {@link rtvref.types.NULL NULL} type.
* @function rtvref.validation.isNull.default
* @param {*} v Value to validate.
* @returns {boolean} `true` if validated; `false` otherwise.
*/
export default function isNull(v) {
return v === null;
}
......@@ -16,5 +16,8 @@ export const type = undefined;
* @returns {boolean} `true` if it is; `false` otherwise.
*/
export default function isTypeArgs(v) {
// NOTE: Since shapes are also type args, this check must always validate a
// shape; and since at this time, OBJECT === shape === type args, we just
// check for an OBJECT type
return isObject(v);
}
This diff is collapsed.
......@@ -6,8 +6,18 @@ import qualifiers from '../qualifiers';
import RtvSuccess from '../RtvSuccess';
import RtvError from '../RtvError';
const {REQUIRED} = qualifiers;
let impl; // @type {rtvref.impl}
/**
* [Internal] __FOR UNIT TESTING ONLY:__ The {@link rtvref.impl} instance
* configured on this validator.
* @private
* @name rtvref.validator.valObject._impl
* @type {rtvref.impl}
*/
export {impl as _impl};
/**
* Type: {@link rtvref.types.ANY ANY}
* @const {string} rtvref.validator.isAny.type
......@@ -16,7 +26,7 @@ export {type};
/**
* {@link rtvref.validator.validator_config Configuration Function}
* @function rtvref.validator.isAny.config
* @function rtvref.validator.valAny.config
* @param {rtvref.validator.validator_config_settings} settings Configuration settings.
*/
export const config = function(settings) {
......@@ -26,13 +36,16 @@ export const config = function(settings) {
/**
* {@link rtvref.validator.type_validator Validator} for the
* {@link rtvref.types.ANY ANY} type.
* @function rtvref.validator.isAny.default
* @function rtvref.validator.valAny.default
* @param {*} v Value to validate.
* @param {string} [q] Validation qualifier. Defaults to
* {@link rtvref.qualifiers.REQUIRED REQUIRED}.
* @returns {(rtvref.RtvSuccess|rtvref.RtvError)} An `RtvSuccess` if valid; `RtvError` if not.
*/
export default function valAny(v, q = qualifiers.REQUIRED) {
export default function valAny(v, q = REQUIRED) {
// NOTE: no point checking basic qualifier rules since this type allows both
// undefined and null regardless of the qualifier
if (isAny(v)) {
return new RtvSuccess();
}
......
////// isAnyObject validator
import _forEach from 'lodash/forEach';
import {type, default as isAnyObject} from '../validation/isAnyObject';
import qualifiers from '../qualifiers';
import {default as qualifiers, nilPermitted} from '../qualifiers';
import RtvSuccess from '../RtvSuccess';
import RtvError from '../RtvError';
import isShape from '../validation/isShape';
const {REQUIRED} = qualifiers;
let impl; // @type {rtvref.impl}
/**
* [Internal] __FOR UNIT TESTING ONLY:__ The {@link rtvref.impl} instance
* configured on this validator.
* @private
* @name rtvref.validator.valObject._impl
* @type {rtvref.impl}
*/
export {impl as _impl};
/**
* Type: {@link rtvref.types.ANY_OBJECT ANY_OBJECT}
* @const {string} rtvref.validator.isAnyObject.type
......@@ -16,7 +29,7 @@ export {type};
/**
* {@link rtvref.validator.validator_config Configuration Function}
* @function rtvref.validator.isAnyObject.config
* @function rtvref.validator.valAnyObject.config
* @param {rtvref.validator.validator_config_settings} settings Configuration settings.
*/
export const config = function(settings) {
......@@ -29,16 +42,37 @@ export const config = function(settings) {
*
* Determines if a value is _any_ type of object except a primitive.
*
* @function rtvref.validator.isAnyObject.default
* @function rtvref.validator.valAnyObject.default
* @param {*} v Value to validate.
* @param {string} [q] Validation qualifier. Defaults to
* {@link rtvref.qualifiers.REQUIRED REQUIRED}.
* @param {rtvref.types.numeric_args} [args] Type arguments.
* @returns {(rtvref.RtvSuccess|rtvref.RtvError)} An `RtvSuccess` if valid; `RtvError` if not.
*/
export default function valAnyObject(v, q = qualifiers.REQUIRED) {
if (isAnyObject(v)) {
export default function valAnyObject(v, q = REQUIRED, args) {
if (nilPermitted(v, q)) {
return new RtvSuccess();
}
return new RtvError(v, impl.toTypeset(type, q), [], impl.toTypeset(type, q, true));
if (!isAnyObject(v)) {
return new RtvError(v, impl.toTypeset(type, q), [], impl.toTypeset(type, q, true));
}
// args is the optional shape: ignore if it isn't a shape, like other validators
// ignore invalid args properties
const shape = isShape(args) ? args : undefined;
let err; // @type {(RtvError|undefined)}
// only consider enumerable, own-properties of the shape
_forEach(shape, function(typeset, prop) {
const result = impl.check(v[prop], typeset); // check prop value against shape prop typeset
if (!result.valid) {
err = new RtvError(v, shape, [prop].concat(result.path), result.cause);
}
return !err; // break on first error
});
return err || (new RtvSuccess());
}
......@@ -5,12 +5,22 @@ import {default as _forEach} from 'lodash/forEach';
import {type, default as isArray} from '../validation/isArray';
import isFinite from '../validation/isFinite';
import qualifiers from '../qualifiers';
import {default as qualifiers, nilPermitted} from '../qualifiers';
import RtvSuccess from '../RtvSuccess';
import RtvError from '../RtvError';
const {REQUIRED} = qualifiers;
let impl; // @type {rtvref.impl}
/**
* [Internal] __FOR UNIT TESTING ONLY:__ The {@link rtvref.impl} instance
* configured on this validator.
* @private
* @name rtvref.validator.valObject._impl
* @type {rtvref.impl}
*/
export {impl as _impl};
/**
* Type: {@link rtvref.types.ARRAY ARRAY}
* @const {string} rtvref.validator.isArray.type
......@@ -19,7 +29,7 @@ export {type};
/**
* {@link rtvref.validator.validator_config Configuration Function}
* @function rtvref.validator.isArray.config
* @function rtvref.validator.valArray.config
* @param {rtvref.validator.validator_config_settings} settings Configuration settings.
*/
export const config = function(settings) {
......@@ -29,14 +39,18 @@ export const config = function(settings) {
/**
* {@link rtvref.validator.type_validator Validator} for the
* {@link rtvref.types.ARRAY ARRAY} type.
* @function rtvref.validator.isArray.default
* @function rtvref.validator.valArray.default
* @param {*} v Value to validate.
* @param {string} [q] Validation qualifier. Defaults to
* {@link rtvref.qualifiers.REQUIRED REQUIRED}.
* @param {rtvref.types.ARRAY_args} [args] Type arguments.
* @returns {(rtvref.RtvSuccess|rtvref.RtvError)} An `RtvSuccess` if valid; `RtvError` if not.
*/
export default function valArray(v, q = qualifiers.REQUIRED, args) {
export default function valArray(v, q = REQUIRED, args) {
if (nilPermitted(v, q)) {
return new RtvSuccess();
}
let valid = isArray(v);
let result; // @type {(rtvref.RtvSuccess|rtvref.RtvError)}
......
......@@ -2,12 +2,22 @@
import {type, default as isBoolean} from '../validation/isBoolean';
import qualifiers from '../qualifiers';
import {default as qualifiers, nilPermitted} from '../qualifiers';
import RtvSuccess from '../RtvSuccess';
import RtvError from '../RtvError';
const {REQUIRED} = qualifiers;
let impl; // @type {rtvref.impl}
/**
* [Internal] __FOR UNIT TESTING ONLY:__ The {@link rtvref.impl} instance
* configured on this validator.
* @private
* @name rtvref.validator.valObject._impl
* @type {rtvref.impl}
*/
export {impl as _impl};
/**
* Type: {@link rtvref.types.BOOLEAN BOOLEAN}
* @const {string} rtvref.validator.isBoolean.type
......@@ -16,7 +26,7 @@ export {type};
/**
* {@link rtvref.validator.validator_config Configuration Function}
* @function rtvref.validator.isBoolean.config
* @function rtvref.validator.valBoolean.config
* @param {rtvref.validator.validator_config_settings} settings Configuration settings.
*/
export const config = function(settings) {
......@@ -31,13 +41,17 @@ export const config = function(settings) {
* {@link rtvref.types.primitives primitive}). It does not validate
* `new Boolean(true)`, which is an object that is a boolean.
*
* @function rtvref.validator.isBoolean.default
* @function rtvref.validator.valBoolean.default
* @param {*} v Value to validate.
* @param {string} [q] Validation qualifier. Defaults to
* {@link rtvref.qualifiers.REQUIRED REQUIRED}.
* @returns {(rtvref.RtvSuccess|rtvref.RtvError)} An `RtvSuccess` if valid; `RtvError` if not.
*/
export default function valBoolean(v, q = qualifiers.REQUIRED) {
export default function valBoolean(v, q = REQUIRED) {
if (nilPermitted(v, q)) {
return new RtvSuccess();
}
if (isBoolean(v)) {
return new RtvSuccess();
}
......
......@@ -2,12 +2,22 @@
import {type, default as isFinite} from '../validation/isFinite';
import qualifiers from '../qualifiers';
import {default as qualifiers, nilPermitted} from '../qualifiers';
import RtvSuccess from '../RtvSuccess';
import RtvError from '../RtvError';
const {REQUIRED} = qualifiers;
let impl; // @type {rtvref.impl}
/**
* [Internal] __FOR UNIT TESTING ONLY:__ The {@link rtvref.impl} instance
* configured on this validator.
* @private
* @name rtvref.validator.valObject._impl
* @type {rtvref.impl}
*/
export {impl as _impl};
/**
* Type: {@link rtvref.types.FINITE FINITE}
* @const {string} rtvref.validator.isFinite.type
......@@ -16,7 +26,7 @@ export {type};
/**
* {@link rtvref.validator.validator_config Configuration Function}
* @function rtvref.validator.isFinite.config
* @function rtvref.validator.valFinite.config
* @param {rtvref.validator.validator_config_settings} settings Configuration settings.
*/
export const config = function(settings) {
......@@ -31,14 +41,18 @@ export const config = function(settings) {
* {@link rtvref.types.primitives primitive}). It does not validate
* `new Number(1)`, which is an object that is a number.
*
* @function rtvref.validator.isFinite.default
* @function rtvref.validator.valFinite.default
* @param {*} v Value to validate.
* @param {string} [q] Validation qualifier. Defaults to
* {@link rtvref.qualifiers.REQUIRED REQUIRED}.
* @param {rtvref.types.numeric_args} [args] Type arguments.
* @returns {(rtvref.RtvSuccess|rtvref.RtvError)} An `RtvSuccess` if valid; `RtvError` if not.
*/
export default function valFinite(v, q = qualifiers.REQUIRED, args) {
export default function valFinite(v, q = REQUIRED, args) {
if (nilPermitted(v, q)) {
return new RtvSuccess();
}
let valid = isFinite(v); // eliminates NaN, +/-Infinity
if (valid && args) { // then check args
......
......@@ -2,10 +2,11 @@
import {type, default as isFunction} from '../validation/isFunction';
import qualifiers from '../qualifiers';
import {default as qualifiers, nilPermitted} from '../qualifiers';
import RtvSuccess from '../RtvSuccess';
import RtvError from '../RtvError';
const {REQUIRED} = qualifiers;
let impl; // @type {rtvref.impl}
/**
......@@ -16,7 +17,7 @@ export {type};
/**
* {@link rtvref.validator.validator_config Configuration Function}
* @function rtvref.validator.isFunction.config
* @function rtvref.validator.valFunction.config
* @param {rtvref.validator.validator_config_settings} settings Configuration settings.
*/
export const config = function(settings) {
......@@ -26,13 +27,17 @@ export const config = function(settings) {
/**
* {@link rtvref.validator.type_validator Validator} for the
* {@link rtvref.types.FUNCTION FUNCTION} type.
* @function rtvref.validator.isFunction.default
* @function rtvref.validator.valFunction.default
* @param {*} v Value to validate.
* @param {string} [q] Validation qualifier. Defaults to
* {@link rtvref.qualifiers.REQUIRED REQUIRED}.
* @returns {(rtvref.RtvSuccess|rtvref.RtvError)} An `RtvSuccess` if valid; `RtvError` if not.
*/
export default function valFunction(v, q = qualifiers.REQUIRE) {
export default function valFunction(v, q = REQUIRED) {
if (nilPermitted(v, q)) {
return new RtvSuccess();
}
if (isFunction(v)) {
return new RtvSuccess();
}
......
......@@ -7,13 +7,23 @@ import isString from '../validation/isString';
import isTypeset from '../validation/isTypeset';
import types from '../types';
import qualifiers from '../qualifiers';
import {default as qualifiers, nilPermitted} from '../qualifiers';
import RtvSuccess from '../RtvSuccess';
import RtvError from '../RtvError';
import {print} from '../util';
const {REQUIRED} = qualifiers;
let impl; // @type {rtvref.impl}
/**
* [Internal] __FOR UNIT TESTING ONLY:__ The {@link rtvref.impl} instance
* configured on this validator.
* @private
* @name rtvref.validator.valObject._impl
* @type {rtvref.impl}
*/
export {impl as _impl};
/**
* Type: {@link rtvref.types.MAP MAP}
* @const {string} rtvref.validator.isMap.type
......@@ -22,7 +32,7 @@ export {type};
/**
* {@link rtvref.validator.validator_config Configuration Function}
* @function rtvref.validator.isMap.config
* @function rtvref.validator.valMap.config
* @param {rtvref.validator.validator_config_settings} settings Configuration settings.
*/
export const config = function(settings) {
......@@ -44,14 +54,18 @@ const isStringTypeset = function(ts) {
/**
* {@link rtvref.validator.type_validator Validator} for the
* {@link rtvref.types.MAP MAP} type.
* @function rtvref.validator.isMap.default
* @function rtvref.validator.valMap.default
* @param {*} v Value to validate.
* @param {string} [q] Validation qualifier. Defaults to
* {@link rtvref.qualifiers.REQUIRED REQUIRED}.
* @param {rtvref.types.collection_args} [args] Type arguments.
* @returns {(rtvref.RtvSuccess|rtvref.RtvError)} An `RtvSuccess` if valid; `RtvError` if not.
*/
export default function valMap(v, q = qualifiers.REQUIRED, args) {
export default function valMap(v, q = REQUIRED, args) {
if (nilPermitted(v, q)) {
return new RtvSuccess();
}
let valid = isMap(v);
let result; // @type {(rtvref.RtvSuccess|rtvref.RtvError)}
......
////// isNull validator
import {type, default as isNull} from '../validation/isNull';
import {default as qualifiers, nilPermitted} from '../qualifiers';
import RtvSuccess from '../RtvSuccess';
import RtvError from '../RtvError';
const {REQUIRED} = qualifiers;
let impl; // @type {rtvref.impl}
/**
* Type: {@link rtvref.types.NULL NULL}
* @const {string} rtvref.validator.valNull.type
*/
export {type};
/**
* {@link rtvref.validator.validator_config Configuration Function}
* @function rtvref.validator.valNull.config
* @param {rtvref.validator.validator_config_settings} settings Configuration settings.
*/
export const config = function(settings) {
impl = settings.impl;
};
/**
* {@link rtvref.validator.type_validator Validator} for the
* {@link rtvref.types.NULL NULL} type.
* @function rtvref.validator.valNull.default
* @param {*} v Value to validate.
* @param {string} [q] Validation qualifier. Defaults to
* {@link rtvref.qualifiers.REQUIRED REQUIRED}.
* @returns {(rtvref.RtvSuccess|rtvref.RtvError)} An `RtvSuccess` if valid; `RtvError` if not.
*/
export default function valNull(v, q = REQUIRED) {
if (nilPermitted(v, q)) {
return new RtvSuccess();
}
if (isNull(v)) {
return new RtvSuccess();
}
return new RtvError(v, impl.toTypeset(type, q), [], impl.toTypeset(type, q, true));
}
......@@ -4,12 +4,22 @@ import {default as _isNaN} from 'lodash/isNaN';
import {type, default as isNumber} from '../validation/isNumber';
import qualifiers from '../qualifiers';
import {default as qualifiers, nilPermitted} from '../qualifiers';
import RtvSuccess from '../RtvSuccess';
import RtvError from '../RtvError';
const {REQUIRED} = qualifiers;
let impl; // @type {rtvref.impl}
/**
* [Internal] __FOR UNIT TESTING ONLY:__ The {@link rtvref.impl} instance
* configured on this validator.
* @private
* @name rtvref.validator.valObject._impl
* @type {rtvref.impl}
*/
export {impl as _impl};
/**
* Type: {@link rtvref.types.NUMBER NUMBER}
* @const {string} rtvref.validator.isNumber.type
......@@ -18,7 +28,7 @@ export {type};
/**
* {@link rtvref.validator.validator_config Configuration Function}
* @function rtvref.validator.isNumber.config
* @function rtvref.validator.valNumber.config
* @param {rtvref.validator.validator_config_settings} settings Configuration settings.
*/
export const config = function(settings) {
......@@ -33,18 +43,22 @@ export const config = function(settings) {
* {@link rtvref.types.primitives primitive}). It does not validate
* `new Number(1)`, which is an object that is a number.
*
* @function rtvref.validator.isNumber.default
* @function rtvref.validator.valNumber.default
* @param {*} v Value to validate.
* @param {string} [q] Validation qualifier. Defaults to
* {@link rtvref.qualifiers.REQUIRED REQUIRED}.
* @param {rtvref.types.numeric_args} [args] Type arguments.
* @returns {(rtvref.RtvSuccess|rtvref.RtvError)} An `RtvSuccess` if valid; `RtvError` if not.
*/
export default function valNumber(v, q = qualifiers.REQUIRED, args) {
export default function valNumber(v, q = REQUIRED, args) {
if (nilPermitted(v, q)) {
return new RtvSuccess();
}
let valid = isNumber(v);
// all qualifiers other than REQUIRED allow NaN
if (q !== qualifiers.REQUIRED && _isNaN(v)) {
if (q !== REQUIRED && _isNaN(v)) {
valid = true;
}
......
////// isObject validator
import _forEach from 'lodash/forEach';
import {type, default as isObject} from '../validation/isObject';
import qualifiers from '../qualifiers';
import {default as qualifiers, nilPermitted} from '../qualifiers';
import RtvSuccess from '../RtvSuccess';
import RtvError from '../RtvError';
import isShape from '../validation/isShape';
const {REQUIRED} = qualifiers;
let impl; // @type {rtvref.impl}
/**
* [Internal] __FOR UNIT TESTING ONLY:__ The {@link rtvref.impl} instance
* configured on this validator.
* @private
* @name rtvref.validator.valObject._impl
* @type {rtvref.impl}
*/
export {impl as _impl};
/**
* Type: {@link rtvref.types.OBJECT OBJECT}
* @const {string} rtvref.validator.isObject.type
......@@ -16,7 +29,7 @@ export {type};
/**
* {@link rtvref.validator.validator_config Configuration Function}
* @function rtvref.validator.isObject.config
* @function rtvref.validator.valObject.config
* @param {rtvref.validator.validator_config_settings} settings Configuration settings.
*/
export const config = function(settings) {
......@@ -30,16 +43,37 @@ export const config = function(settings) {
* Determines if a value is an object that extends from `JavaScript.Object` and