UNPKG

nope-validator

Version:
978 lines (957 loc) 37.3 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.index = {})); })(this, (function (exports) { 'use strict'; var NopeReference = /** @class */ (function () { function NopeReference(key) { this.key = key; } return NopeReference; }()); function resolvePathFromContext(path, context) { var optionWithPath = path.split('../'); var depth = optionWithPath.length - 1; var key = optionWithPath[optionWithPath.length - 1]; var ctx = context; for (var i = 0; i < depth; i++) { ctx = ctx === null || ctx === void 0 ? void 0 : ctx.___parent; } if (ctx && key !== undefined && key !== null) { return ctx[key]; } return key; } function resolveNopeRefsFromKeys(options, context) { var resolvedOptions = options.map(function (option) { return resolvePathFromContext(option, context); }); return resolvedOptions; } function resolveNopeRef(option, context) { if (option instanceof NopeReference) { return resolvePathFromContext(option.key, context); } return option; } function deepEquals(a, b) { if (typeof a == 'object' && a != null && typeof b == 'object' && b != null) { if (a === b) { return true; } var aCount = 0; var bCount = 0; // eslint-disable-next-line @typescript-eslint/no-unused-vars for (var _ in a) { aCount++; } // eslint-disable-next-line @typescript-eslint/no-unused-vars for (var _ in b) { bCount++; } if (aCount - bCount !== 0) { return false; } for (var key in a) { if (!(key in b) || !deepEquals(a[key], b[key])) { return false; } } for (var key in b) { if (!(key in a) || !deepEquals(b[key], a[key])) { return false; } } return true; } return a === b; } function pathToArray(path) { return path.split(/[,[\].]/g).filter(Boolean); } function getFromPath(path, entry, dropLast) { if (dropLast === void 0) { dropLast = false; } if (!path) { return undefined; } var pathArray = pathToArray(path); pathArray = dropLast ? pathArray.slice(0, -1) : pathArray; var value = entry; for (var _i = 0, pathArray_1 = pathArray; _i < pathArray_1.length; _i++) { var key = pathArray_1[_i]; value = value[key]; } return value; } function runValidators(tasks, entry, context) { var done = false; return tasks.reduce(function (previous, next) { if (done) { return previous; } return previous .then(function (error) { if (error) { done = true; return error; } return next(entry, context); })["catch"](function (error) { if (error) { done = true; return error; } return next(entry, context); }); }, Promise.resolve()); } function isNil(entry) { return !!(entry === undefined || entry === null); } var NopeObject = /** @class */ (function () { function NopeObject(objectShape) { this.validationRules = []; this._type = 'object'; this.objectShape = objectShape || {}; } NopeObject.prototype.getType = function () { return this._type; }; NopeObject.prototype.shape = function (shape) { Object.assign(this.objectShape, shape); return this; }; NopeObject.prototype.extend = function (Base) { Object.assign(this.objectShape, Base.objectShape); return this; }; NopeObject.prototype.noUnknown = function (message) { var _this = this; if (message === void 0) { message = 'Input contains invalid keys'; } var rule = function (entry) { var objectIsDefined = false; // eslint-disable-next-line @typescript-eslint/no-unused-vars for (var _ in _this.objectShape) { objectIsDefined = true; break; } if (!objectIsDefined) { throw Error('noUnknown must be used with a schema'); } var unknownKeys = false; for (var key in entry) { unknownKeys = unknownKeys || !(key in _this.objectShape); } if (unknownKeys) { return message; } }; this.validationRules.push(rule); return this; }; NopeObject.prototype.validate = function (entry, context, options) { for (var _i = 0, _a = this.validationRules; _i < _a.length; _i++) { var rule = _a[_i]; var localErrors = rule(entry); if (localErrors) { return localErrors; } } var areErrors = false; var abortEarly = options === null || options === void 0 ? void 0 : options.abortEarly; var errors = {}; var ctx = Object.assign({ ___parent: context }, entry); for (var key in this.objectShape) { var validator = this.objectShape[key]; var error = validator.validate(entry[key], ctx, options); if (error) { areErrors = true; errors[key] = error; if (abortEarly) { return errors; } } } if (areErrors) { return errors; } return undefined; }; NopeObject.prototype.validateAsync = function (entry, context, options) { var _this = this; return runValidators(this.validationRules, entry, context).then(function (localError) { if (localError) { return localError; } var keys = []; var results = []; var ctx = Object.assign({ ___parent: context }, entry); for (var key in _this.objectShape) { var validator = _this.objectShape[key]; var error = validator.validateAsync(entry[key], ctx, options); keys.push(key); results.push(error); } return Promise.all(results).then(function (resolvedErrors) { var errors = {}; var areErrors = false; for (var i = 0; i < keys.length; i++) { var error = resolvedErrors[i]; if (error) { areErrors = true; errors[keys[i]] = error; } } if (areErrors) { return errors; } return undefined; }); }); }; NopeObject.prototype.validateAt = function (path, entry) { var _a, _b; var arrayPath = pathToArray(path); var validator = this.objectShape; for (var _i = 0, arrayPath_1 = arrayPath; _i < arrayPath_1.length; _i++) { var p = arrayPath_1[_i]; if (!isNaN(parseInt(p, 10))) { continue; } if ((_a = validator[p]) === null || _a === void 0 ? void 0 : _a.objectShape) { validator = validator[p].objectShape; } else if ((_b = validator[p]) === null || _b === void 0 ? void 0 : _b.ofShape) { validator = validator[p].ofShape.objectShape || validator[p].ofShape; } else { validator = validator[p]; } } var parentValue = getFromPath(path, entry, true); var value = getFromPath(path, entry); return validator.validate(value, parentValue); }; return NopeObject; }()); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } function __spreadArray(to, from) { for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i]; return to; } var emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i; var urlRegex = /^([a-z][a-z0-9\*\-\.]*):\/\/(?:(?:(?:[\w\.\-\+!$&'\(\)*\+,;=]|%[0-9a-f]{2})+:)*(?:[\w\.\-\+%!$&'\(\)*\+,;=]|%[0-9a-f]{2})+@)?(?:(?:[a-z0-9\-\.]|%[0-9a-f]{2})+|(?:\[(?:[0-9a-f]{0,4}:)*(?:[0-9a-f]{0,4})\]))(?::[0-9]+)?(?:[\/|\?](?:[\w#!:\.\?\+=&@!$'~*,;\/\(\)\[\]\-]|%[0-9a-f]{2})*)?$/i; var NopePrimitive = /** @class */ (function () { function NopePrimitive() { this.validationRules = []; this._type = 'undefined'; } NopePrimitive.prototype.getType = function () { return this._type; }; NopePrimitive.prototype.isEmpty = function (entry) { return isNil(entry); }; NopePrimitive.prototype.required = function (message) { var _this = this; if (message === void 0) { message = 'This field is required'; } var rule = function (entry) { if (_this.isEmpty(entry)) { return message; } }; return this.test(rule); }; NopePrimitive.prototype.notAllowed = function (message) { var _this = this; if (message === void 0) { message = 'Field is not allowed'; } var rule = function (entry) { if (!_this.isEmpty(entry)) { return message; } }; return this.test(rule); }; NopePrimitive.prototype.when = function (keys, conditionObject) { var ctxKeys = Array.isArray(keys) ? keys : [keys]; var rule = function (_, context) { var resolvedConditionValues = resolveNopeRefsFromKeys(ctxKeys, context); var values = __spreadArray([], resolvedConditionValues); var condIs = conditionObject.is; var result = typeof condIs === 'function' ? condIs.apply(void 0, values) : resolvedConditionValues.every(function (val) { return val === condIs; }); return result ? conditionObject.then : conditionObject.otherwise; }; return this.test(rule); }; NopePrimitive.prototype.oneOf = function (options, message) { if (message === void 0) { message = 'Invalid option'; } var rule = function (entry, context) { if (entry === undefined) { return; } var resolved; if (options instanceof NopeReference) { resolved = resolveNopeRef(options, context); } else { resolved = options.map(function (option) { return resolveNopeRef(option, context); }); } if (resolved.indexOf(entry) === -1) { return message; } }; return this.test(rule); }; NopePrimitive.prototype.notOneOf = function (options, message) { if (message === void 0) { message = 'Invalid Option'; } var rule = function (entry, context) { var resolvedOptions = options.map(function (option) { return resolveNopeRef(option, context); }); if (resolvedOptions.indexOf(entry) !== -1) { return message; } }; return this.test(rule); }; NopePrimitive.prototype.test = function (rule) { this.validationRules.push(rule); return this; }; /** * @param entry - The value to be validated * @param context - Used for internal reference resolving. Do not pass this. */ NopePrimitive.prototype.validate = function (entry, context) { this._entry = entry; for (var _i = 0, _a = this.validationRules; _i < _a.length; _i++) { var rule = _a[_i]; var error = rule(this._entry, context); if (error instanceof NopePrimitive) { return error.validate(this._entry, context); } else if (error) { return error; } } }; NopePrimitive.prototype.validateAsync = function (entry, context) { var _this = this; var _a; return runValidators(this.validationRules, (_a = this._entry) !== null && _a !== void 0 ? _a : entry, context).then(function (error) { var _a; if (error instanceof NopePrimitive) { return error.validateAsync((_a = _this._entry) !== null && _a !== void 0 ? _a : entry, context); } else if (error) { return error; } }); }; return NopePrimitive; }()); var NopeString = /** @class */ (function (_super) { __extends(NopeString, _super); function NopeString() { var _this = _super !== null && _super.apply(this, arguments) || this; _this._type = 'string'; return _this; } NopeString.prototype.validate = function (entry, context) { var value = !!entry ? String(entry) : entry; return _super.prototype.validate.call(this, value, context); }; NopeString.prototype.validateAsync = function (entry, context) { var value = !!entry ? String(entry) : entry; return _super.prototype.validateAsync.call(this, value, context); }; NopeString.prototype.isEmpty = function (value) { return isNil(value) || value.trim().length === 0; }; NopeString.prototype.regex = function (regex, message) { var _this = this; if (message === void 0) { message = "Doesn't satisfy the rule"; } var rule = function (entry) { if (_this.isEmpty(entry)) { return; } if (!regex.test(entry)) { return message; } }; return this.test(rule); }; NopeString.prototype.url = function (message) { if (message === void 0) { message = 'Input is not a valid url'; } this.regex(urlRegex, message); return this; }; NopeString.prototype.email = function (message) { if (message === void 0) { message = 'Input is not a valid email'; } this.regex(emailRegex, message); return this; }; NopeString.prototype.min = function (length, message) { this.greaterThan(length, message); return this; }; NopeString.prototype.max = function (length, message) { this.lessThan(length, message); return this; }; NopeString.prototype.greaterThan = function (length, message) { var _this = this; if (message === void 0) { message = 'Input is too short'; } var rule = function (entry) { if (_this.isEmpty(entry)) { return; } var value = entry; if (value.length <= length) { return message; } }; return this.test(rule); }; NopeString.prototype.lessThan = function (length, message) { var _this = this; if (message === void 0) { message = 'Input is too long'; } var rule = function (entry) { if (_this.isEmpty(entry)) { return; } var value = entry; if (value.length >= length) { return message; } }; return this.test(rule); }; NopeString.prototype.atLeast = function (length, message) { var _this = this; if (message === void 0) { message = 'Input is too short'; } var rule = function (entry) { if (_this.isEmpty(entry)) { return; } var value = entry; if (value.length < length) { return message; } }; return this.test(rule); }; NopeString.prototype.atMost = function (length, message) { var _this = this; if (message === void 0) { message = 'Input is too long'; } var rule = function (entry) { if (_this.isEmpty(entry)) { return; } var value = entry; if (value.length > length) { return message; } }; return this.test(rule); }; NopeString.prototype.between = function (startLength, endLength, atLeastMessage, atMostMessage) { if (atLeastMessage === void 0) { atLeastMessage = 'Input is too short'; } if (atMostMessage === void 0) { atMostMessage = 'Input is too long'; } if (startLength && endLength && startLength > endLength) { var rule = function () { throw Error('between must receive an initial length (startLength) smaller than the final length (endLength) parameter'); }; return this.test(rule); } this.atLeast(startLength, atLeastMessage); this.atMost(endLength, atMostMessage); return this; }; NopeString.prototype.exactLength = function (length, message) { var _this = this; if (message === void 0) { message = "Must be at exactly of length ".concat(length); } var rule = function (entry) { if (_this.isEmpty(entry)) { return; } var value = entry; if (value.length !== length) { return message; } }; return this.test(rule); }; NopeString.prototype.trim = function () { var _this = this; var rule = function (entry) { _this._entry = entry.trim(); return; }; return this.test(rule); }; return NopeString; }(NopePrimitive)); var NopeNumber = /** @class */ (function (_super) { __extends(NopeNumber, _super); function NopeNumber(message) { if (message === void 0) { message = 'The field is not a valid number'; } var _this = _super.call(this) || this; _this.message = 'The field is not a number'; _this._type = 'number'; _this.message = message; return _this; } NopeNumber.prototype.integer = function (message) { var _this = this; if (message === void 0) { message = 'Input must be an integer'; } var rule = function (entry) { if (_this.isEmpty(entry)) { return; } if (entry !== Math.floor(entry)) { return message; } }; return this.test(rule); }; NopeNumber.prototype.min = function (size, message) { this.greaterThan(size, message); return this; }; NopeNumber.prototype.max = function (size, message) { this.lessThan(size, message); return this; }; NopeNumber.prototype.greaterThan = function (size, message) { var _this = this; if (message === void 0) { message = 'Input is too small'; } var rule = function (entry) { if (_this.isEmpty(entry)) { return; } if (entry <= size) { return message; } }; return this.test(rule); }; NopeNumber.prototype.lessThan = function (size, message) { var _this = this; if (message === void 0) { message = 'Input is too large'; } var rule = function (entry) { if (_this.isEmpty(entry)) { return; } if (entry >= size) { return message; } }; return this.test(rule); }; NopeNumber.prototype.atLeast = function (size, message) { var _this = this; if (message === void 0) { message = 'Input is too small'; } var rule = function (entry) { if (_this.isEmpty(entry)) { return; } if (entry < size) { return message; } }; return this.test(rule); }; NopeNumber.prototype.atMost = function (size, message) { var _this = this; if (message === void 0) { message = 'Input is too large'; } var rule = function (entry) { if (_this.isEmpty(entry)) { return; } if (entry > size) { return message; } }; return this.test(rule); }; NopeNumber.prototype.between = function (sizeStart, sizeEnd, atLeastMessage, atMostMessage) { if (atLeastMessage === void 0) { atLeastMessage = 'Input is too small'; } if (atMostMessage === void 0) { atMostMessage = 'Input is too large'; } if (sizeStart && sizeEnd && sizeStart > sizeEnd) { var rule = function () { throw Error('between must receive an initial size (sizeStart) smaller than the final size (sizeEnd) parameter'); }; return this.test(rule); } this.atLeast(sizeStart, atLeastMessage); this.atMost(sizeEnd, atMostMessage); return this; }; NopeNumber.prototype.positive = function (message) { if (message === void 0) { message = 'Input must be positive'; } this.greaterThan(0, message); return this; }; NopeNumber.prototype.negative = function (message) { if (message === void 0) { message = 'Input must be negative'; } this.lessThan(0, message); return this; }; NopeNumber.prototype.validate = function (entry, context) { var value = !!entry ? Number(entry) : entry; if (!this.isEmpty(value) && Number.isNaN(value)) { return this.message; } return _super.prototype.validate.call(this, value, context); }; NopeNumber.prototype.validateAsync = function (entry, context) { var value = !!entry ? Number(entry) : entry; if (!this.isEmpty(value) && Number.isNaN(value)) { return Promise.resolve(this.message); } return _super.prototype.validateAsync.call(this, value, context); }; return NopeNumber; }(NopePrimitive)); var NopeBoolean = /** @class */ (function (_super) { __extends(NopeBoolean, _super); function NopeBoolean() { var _this = _super !== null && _super.apply(this, arguments) || this; _this._type = 'boolean'; return _this; } NopeBoolean.prototype["true"] = function (message) { var _this = this; if (message === void 0) { message = 'Input must be true'; } var rule = function (entry) { if (_this.isEmpty(entry)) { return; } if (entry !== true) { return message; } }; return this.test(rule); }; NopeBoolean.prototype["false"] = function (message) { var _this = this; if (message === void 0) { message = 'Input must be false'; } var rule = function (entry) { if (_this.isEmpty(entry)) { return; } if (entry !== false) { return message; } }; return this.test(rule); }; NopeBoolean.prototype.validate = function (entry, context) { var value = isNil(entry) ? entry : !!entry; return _super.prototype.validate.call(this, value, context); }; NopeBoolean.prototype.validateAsync = function (entry, context) { var value = isNil(entry) ? entry : !!entry; return _super.prototype.validateAsync.call(this, value, context); }; return NopeBoolean; }(NopePrimitive)); function ofType(entry, primitive) { var done = false; return entry.reduce(function (previous, next) { if (done) { return previous; } return previous.then(function (error) { if (error) { done = true; return error; } return primitive.validateAsync(next); }); }, Promise.resolve()); } var NopeArray = /** @class */ (function () { function NopeArray() { this._type = 'object'; this.validationRules = []; this.ofShape = null; } NopeArray.prototype.getType = function () { return this._type; }; NopeArray.prototype.required = function (message) { if (message === void 0) { message = 'This field is required'; } var rule = function (entry) { if (isNil(entry)) { return message; } }; return this.test(rule); }; NopeArray.prototype.of = function (primitive, message) { if (message === void 0) { message = 'One or more elements are of invalid type'; } this.ofShape = primitive; var rule = function (entry) { if (isNil(entry)) { return; } if (entry.some(function (value) { return primitive.getType() !== typeof value; })) { return message; } var error = entry.find(function (value) { return primitive.validate(value); }); if (error) { return message; } }; return this.test(rule); }; NopeArray.prototype.ofAsync = function (primitive, message) { if (message === void 0) { message = 'One or more elements are of invalid type'; } this.ofShape = primitive; var rule = function (entry) { if (isNil(entry)) { return; } if (entry.some(function (value) { return primitive.getType() !== typeof value; })) { return message; } return ofType(entry, primitive).then(function (error) { return (error && message) || undefined; }); }; return this.test(rule); }; NopeArray.prototype.minLength = function (length, message) { if (message === void 0) { message = 'Input is too short'; } var rule = function (entry) { if (isNil(entry)) { return; } if (entry.length <= length) { return message; } }; return this.test(rule); }; NopeArray.prototype.maxLength = function (length, message) { if (message === void 0) { message = 'Input is too long'; } var rule = function (entry) { if (isNil(entry)) { return; } if (entry.length >= length) { return message; } }; return this.test(rule); }; NopeArray.prototype.mustContain = function (value, message) { if (message === void 0) { message = 'Input does not contain required value'; } var rule = function (entry) { if (isNil(entry)) { return; } if (entry.indexOf(value) === -1) { return message; } }; return this.test(rule); }; NopeArray.prototype.hasOnly = function (values, message) { if (message === void 0) { message = 'Input elements must correspond to value values'; } var rule = function (entry) { if (isNil(entry)) { return; } if (entry.some(function (value) { if (typeof value === 'object') { return !values.find(function (v) { return deepEquals(value, v); }); } return values.indexOf(value) === -1; })) { return message; } }; return this.test(rule); }; NopeArray.prototype.every = function (callback, message) { if (message === void 0) { message = 'Input does not satisfy condition'; } var rule = function (entry) { if (isNil(entry)) { return; } if (entry.some(function (value) { return !callback(value); })) { return message; } }; return this.test(rule); }; NopeArray.prototype.some = function (callback, message) { if (message === void 0) { message = 'Input does not satisfy condition'; } var rule = function (entry) { if (isNil(entry) || entry.length === 0) { return; } if (!entry.some(function (value) { return callback(value); })) { return message; } }; return this.test(rule); }; NopeArray.prototype.test = function (rule) { this.validationRules.push(rule); return this; }; NopeArray.prototype.validate = function (entry, context) { for (var _i = 0, _a = this.validationRules; _i < _a.length; _i++) { var rule = _a[_i]; var error = rule(entry, context); if (error instanceof NopePrimitive) { return error.validate(entry, context); } else if (error) { return "".concat(error); } } }; NopeArray.prototype.validateAsync = function (entry, context) { return runValidators(this.validationRules, entry, context).then(function (error) { if (error instanceof NopePrimitive) { return error.validateAsync(entry, context); } else if (error) { return error; } }); }; return NopeArray; }()); var NopeDate = /** @class */ (function (_super) { __extends(NopeDate, _super); function NopeDate(message) { if (message === void 0) { message = 'The field is not a valid date'; } var _this = _super.call(this) || this; _this._type = 'object'; _this.message = message; return _this; } NopeDate.prototype.before = function (beforeDate, message) { var _this = this; if (message === void 0) { message = "Date must be before ".concat(beforeDate.toString()); } var rule = function (entry, context) { if (_this.isEmpty(entry)) { return; } var resolvedBeforeDate = beforeDate instanceof NopeReference && context ? context[beforeDate.key] : beforeDate; if (new Date(entry) >= new Date(resolvedBeforeDate)) { return message; } }; return this.test(rule); }; NopeDate.prototype.after = function (afterDate, message) { var _this = this; if (message === void 0) { message = "Date must be after ".concat(afterDate); } var rule = function (entry, context) { if (_this.isEmpty(entry)) { return; } var resolvedAfterDate = afterDate instanceof NopeReference && context ? context[afterDate.key] : afterDate; if (new Date(entry) <= new Date(resolvedAfterDate)) { return message; } }; return this.test(rule); }; NopeDate.prototype.parseDate = function (entry) { var value = entry; if (this.isEmpty(entry) || entry instanceof Date) { value = entry; } else if (!isNaN(+new Date(entry))) { value = new Date(entry); } else { var ms = new Date(entry); if (isNaN(+ms)) { throw this.message; } value = new Date(ms); } return value; }; NopeDate.prototype.validate = function (entry, context) { var value; try { value = this.parseDate(entry); } catch (error) { return error; } return _super.prototype.validate.call(this, value, context); }; NopeDate.prototype.validateAsync = function (entry, context) { var value; try { value = this.parseDate(entry); } catch (error) { return Promise.resolve(error); } return _super.prototype.validateAsync.call(this, value, context); }; return NopeDate; }(NopePrimitive)); var object = function () { return new NopeObject(); }; var string = function () { return new NopeString(); }; var number = function (message) { return new NopeNumber(message); }; var boolean = function () { return new NopeBoolean(); }; var date = function (message) { return new NopeDate(message); }; var array = function () { return new NopeArray(); }; var ref = function (key) { return new NopeReference(key); }; var Nope = { object: object, string: string, number: number, boolean: boolean, date: date, array: array, ref: ref }; exports.Nope = Nope; exports.array = array; exports.boolean = boolean; exports.date = date; exports["default"] = Nope; exports.number = number; exports.object = object; exports.ref = ref; exports.string = string; Object.defineProperty(exports, '__esModule', { value: true }); })); //# sourceMappingURL=index.js.map