New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-types

Package Overview
Dependencies
Maintainers
0
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-types - npm Package Compare versions

Comparing version

to
0.0.0-20240701051251

20

dist/index.d.ts

@@ -32,10 +32,4 @@ import { toType, toValidableType, validateType, fromType } from './utils';

};
readonly object: VueTypeValidableDef<{
[key: string]: any;
}, import("./types").ValidatorFunction<{
[key: string]: any;
}>> & {
default: () => {
[key: string]: any;
};
readonly object: VueTypeValidableDef<Record<string, any>, import("./types").ValidatorFunction<Record<string, any>>> & {
default: () => Record<string, any>;
};

@@ -79,10 +73,4 @@ readonly integer: VueTypeDef<number> & {

};
readonly object: VueTypeValidableDef<{
[key: string]: any;
}, import("./types").ValidatorFunction<{
[key: string]: any;
}>> & {
default: () => {
[key: string]: any;
};
readonly object: VueTypeValidableDef<Record<string, any>, import("./types").ValidatorFunction<Record<string, any>>> & {
default: () => Record<string, any>;
};

@@ -89,0 +77,0 @@ readonly integer: VueTypeDef<number> & {

2

dist/shim.d.ts

@@ -54,3 +54,3 @@ import { config } from './config';

};
export declare function validateType<T, U>(type: T, value: U, silent?: boolean): string | boolean;
export declare function validateType<T, U>(_type: T, _value: U, _silent?: boolean): string | boolean;
declare const VueTypes_base: {

@@ -57,0 +57,0 @@ new (): {};

export type Prop<T = any> =
| {
// eslint-disable-next-line @typescript-eslint/ban-types
new (...args: any[]): T & object
}
| {
(): T
}
| (new (...args: any[]) => T & object)
| (() => T)
| PropMethod<T>

@@ -35,3 +30,2 @@

| ((props: Record<string, unknown>) => D)
// eslint-disable-next-line @typescript-eslint/ban-types
| object

@@ -45,3 +39,3 @@ validator?(value: T): boolean

: T extends ObjectConstructor | { type: ObjectConstructor }
? { [key: string]: any }
? Record<string, any>
: T extends Prop<infer V>

@@ -93,4 +87,4 @@ ? V

T,
DefaultFactory<Partial<T & { [key: string]: any }>>,
() => Partial<T> & { [key: string]: any }
DefaultFactory<Partial<T & Record<string, any>>>,
() => Partial<T> & Record<string, any>
> {

@@ -107,3 +101,3 @@ readonly loose: VueTypeLooseShape<T>

array: () => any[]
object: () => { [key: string]: any }
object: () => Record<string, any>
integer: number

@@ -110,0 +104,0 @@ }

@@ -5,5 +5,3 @@ import { VueTypeDef, VueTypeValidableDef, VueProp, InferType, PropOptions, VueTypesConfig } from './types';

export declare function getNativeType(value: any): string;
type PlainObject = {
[key: string]: any;
};
type PlainObject = Record<string, any>;
export declare const isPlainObject: (obj: any) => obj is PlainObject;

@@ -20,3 +18,3 @@ /**

export declare const identity: (arg: any) => any;
declare let warn: (msg: string, level?: VueTypesConfig['logLevel']) => string | void;
declare let warn: (msg: string, level?: VueTypesConfig['logLevel']) => void;
export { warn };

@@ -23,0 +21,0 @@ /**

@@ -8,7 +8,5 @@ import { PropOptions } from '../types';

export declare const array: <T>() => import("../types").VueTypeValidableDef<T[], import("../types").ValidatorFunction<T[]>>;
export declare const object: <T extends {
[key: string]: any;
}>() => import("../types").VueTypeValidableDef<T, import("../types").ValidatorFunction<T>>;
export declare const object: <T extends Record<string, any>>() => import("../types").VueTypeValidableDef<T, import("../types").ValidatorFunction<T>>;
export declare const integer: <T extends number = number>() => import("../types").VueTypeDef<T>;
export declare const symbol: () => import("../types").VueTypeDef<symbol>;
export declare const nullable: () => PropOptions<null, null>;
import { Prop, VueProp, InferType } from '../types';
export default function objectOf<T extends VueProp<any> | Prop<any>>(type: T): import("../types").VueTypeDef<{
[key: string]: InferType<T>;
}>;
export default function objectOf<T extends VueProp<any> | Prop<any>>(type: T): import("../types").VueTypeDef<Record<string, InferType<T>>>;

@@ -1,2 +0,2 @@

import{isPlainObject as e}from"is-plain-object";function t(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function n(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,t(i.key),i)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,u(e,t)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function a(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var f={silent:!1,logLevel:"warn"},l=["validator"],c=Object.prototype,s=c.toString,v=c.hasOwnProperty,d=/^\s*function (\w+)/;function p(e){var t,n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){var r=n.toString().match(d);return r?r[1]:""}return""}var y=e,h=function(e){return e},b=h;if("production"!==process.env.NODE_ENV){var g="undefined"!=typeof console;b=g?function(e,t){void 0===t&&(t=f.logLevel),!1===f.silent&&console[t]("[VueTypes warn]: "+e)}:h}var O=function(e,t){return v.call(e,t)},m=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},j=Array.isArray||function(e){return"[object Array]"===s.call(e)},_=function(e){return"[object Function]"===s.call(e)},T=function(e,t){return y(e)&&O(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t)},w=function(e){return y(e)&&(O(e,"type")||["_vueTypes_name","validator","default","required"].some(function(t){return O(e,t)}))};function P(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function k(e,t,n){var r;void 0===n&&(n=!1);var i=!0,o="";r=y(e)?e:{type:e};var u=T(r)?r._vueTypes_name+" - ":"";if(w(r)&&null!==r.type){if(void 0===r.type||!0===r.type)return i;if(!r.required&&null==t)return i;j(r.type)?(i=r.type.some(function(e){return!0===k(e,t,!0)}),o=r.type.map(function(e){return p(e)}).join(" or ")):i="Array"===(o=p(r))?j(t):"Object"===o?y(t):"String"===o||"Number"===o||"Boolean"===o||"Function"===o?function(e){if(null==e)return"";var t=e.constructor.toString().match(d);return t?t[1].replace(/^Async/,""):""}(t)===o:t instanceof r.type}if(!i){var a=u+'value "'+t+'" should be of type "'+o+'"';return!1===n?(b(a),!1):a}if(O(r,"validator")&&_(r.validator)){var f=b,l=[];if(b=function(e){l.push(e)},i=r.validator(t),b=f,!i){var c=(l.length>1?"* ":"")+l.join("\n* ");return l.length=0,!1===n?(b(c),i):c}}return i}function x(e,t){var n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get:function(){return this.required=!0,this}},def:{value:function(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(O(this,"default")&&delete this.default,this):_(e)||!0===k(this,e,!0)?(this.default=j(e)?function(){return[].concat(e)}:y(e)?function(){return Object.assign({},e)}:e,this):(b(this._vueTypes_name+' - invalid default value: "'+e+'"'),this)}}}),r=n.validator;return _(r)&&(n.validator=P(r,n)),n}function S(e,t){var n=x(e,t);return Object.defineProperty(n,"validate",{value:function(e){return _(this.validator)&&b(this._vueTypes_name+" - calling .validate() will overwrite the current custom validator function. Validator info:\n"+JSON.stringify(this)),this.validator=P(e,this),this}})}function A(e,t,n){var r,i,o=(r=t,i={},Object.getOwnPropertyNames(r).forEach(function(e){i[e]=Object.getOwnPropertyDescriptor(r,e)}),Object.defineProperties({},i));if(o._vueTypes_name=e,!y(n))return o;var u,f,c=n.validator,s=a(n,l);if(_(c)){var v=o.validator;v&&(v=null!==(f=(u=v).__original)&&void 0!==f?f:u),o.validator=P(v?function(e){return v.call(this,e)&&c.call(this,e)}:c,o)}return Object.assign(o,s)}function E(e){return e.replace(/^(?!\s*$)/gm," ")}var N=function(){return S("any",{})},V=function(){return S("function",{type:Function})},q=function(){return S("boolean",{type:Boolean})},L=function(){return S("string",{type:String})},B=function(){return S("number",{type:Number})},D=function(){return S("array",{type:Array})},F=function(){return S("object",{type:Object})},Y=function(){return x("integer",{type:Number,validator:function(e){var t=m(e);return!1===t&&b('integer - "'+e+'" is not an integer'),t}})},I=function(){return x("symbol",{validator:function(e){var t="symbol"==typeof e;return!1===t&&b('symbol - invalid value "'+e+'"'),t}})},J=function(){return Object.defineProperty({type:null,validator:function(e){var t=null===e;return!1===t&&b("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"})};function M(e,t){if(void 0===t&&(t="custom validation failed"),"function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return x(e.name||"<<anonymous function>>",{type:null,validator:function(n){var r=e(n);return r||b(this._vueTypes_name+" - "+t),r}})}function R(e){if(!j(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");var t='oneOf - value should be one of "'+e.map(function(e){return"symbol"==typeof e?e.toString():e}).join('", "')+'".',n={validator:function(n){var r=-1!==e.indexOf(n);return r||b(t),r}};if(-1===e.indexOf(null)){var r=e.reduce(function(e,t){if(null!=t){var n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e},[]);r.length>0&&(n.type=r)}return x("oneOf",n)}function U(e){if(!j(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");for(var t=!1,n=!1,r=[],i=0;i<e.length;i+=1){var o=e[i];if(w(o)){if(_(o.validator)&&(t=!0),T(o,"oneOf")&&o.type){r=r.concat(o.type);continue}if(T(o,"nullable")){n=!0;continue}if(!0===o.type||!o.type){b('oneOfType - invalid usage of "true" and "null" as types.');continue}r=r.concat(o.type)}else r.push(o)}r=r.filter(function(e,t){return r.indexOf(e)===t});var u=!1===n&&r.length>0?r:null;return x("oneOfType",t?{type:u,validator:function(t){var n=[],r=e.some(function(e){var r=k(e,t,!0);return"string"==typeof r&&n.push(r),!0===r});return r||b("oneOfType - provided value does not match any of the "+n.length+" passed-in validators:\n"+E(n.join("\n"))),r}}:{type:u})}function $(e){return x("arrayOf",{type:Array,validator:function(t){var n="",r=t.every(function(t){return!0===(n=k(e,t,!0))});return r||b("arrayOf - value validation error:\n"+E(n)),r}})}function z(e){return x("instanceOf",{type:e})}function C(e){return x("objectOf",{type:Object,validator:function(t){var n="",r=Object.keys(t).every(function(r){return!0===(n=k(e,t[r],!0))});return r||b("objectOf - value validation error:\n"+E(n)),r}})}function G(e){var t=Object.keys(e),n=t.filter(function(t){var n;return!(null===(n=e[t])||void 0===n||!n.required)}),r=x("shape",{type:Object,validator:function(r){var i=this;if(!y(r))return!1;var o=Object.keys(r);if(n.length>0&&n.some(function(e){return-1===o.indexOf(e)})){var u=n.filter(function(e){return-1===o.indexOf(e)});return b(1===u.length?'shape - required property "'+u[0]+'" is not defined.':'shape - required properties "'+u.join('", "')+'" are not defined.'),!1}return o.every(function(n){if(-1===t.indexOf(n))return!0===i._vueTypes_isLoose||(b('shape - shape definition does not include a "'+n+'" property. Allowed keys: "'+t.join('", "')+'".'),!1);var o=k(e[n],r[n],!0);return"string"==typeof o&&b('shape - "'+n+'" property validation error:\n '+E(o)),!0===o})}});return Object.defineProperty(r,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(r,"loose",{get:function(){return this._vueTypes_isLoose=!0,this}}),r}var H=["name","validate","getter"],K=/*#__PURE__*/function(e){return e=/*#__PURE__*/function(){function e(){}return e.extend=function(e){var t=this;if(b("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),j(e))return e.forEach(function(e){return t.extend(e)}),this;var n=e.name,r=e.validate,i=void 0!==r&&r,o=e.getter,u=void 0!==o&&o,f=a(e,H);if(O(this,n))throw new TypeError('[VueTypes error]: Type "'+n+'" already defined');var l,c=f.type;return T(c)?(delete f.type,Object.defineProperty(this,n,u?{get:function(){return A(n,c,f)}}:{value:function(){var e,t=A(n,c,f);return t.validator&&(t.validator=(e=t.validator).bind.apply(e,[t].concat([].slice.call(arguments)))),t}})):(l=u?{get:function(){var e=Object.assign({},f);return i?S(n,e):x(n,e)},enumerable:!0}:{value:function(){var e,t,r=Object.assign({},f);return e=i?S(n,r):x(n,r),r.validator&&(e.validator=(t=r.validator).bind.apply(t,[e].concat([].slice.call(arguments)))),e},enumerable:!0},Object.defineProperty(this,n,l))},r(e,null,[{key:"any",get:function(){return N()}},{key:"func",get:function(){return V().def(this.defaults.func)}},{key:"bool",get:function(){return void 0===this.defaults.bool?q():q().def(this.defaults.bool)}},{key:"string",get:function(){return L().def(this.defaults.string)}},{key:"number",get:function(){return B().def(this.defaults.number)}},{key:"array",get:function(){return D().def(this.defaults.array)}},{key:"object",get:function(){return F().def(this.defaults.object)}},{key:"integer",get:function(){return Y().def(this.defaults.integer)}},{key:"symbol",get:function(){return I()}},{key:"nullable",get:function(){return J()}}])}(),e.defaults={},e.sensibleDefaults=void 0,e.config=f,e.custom=M,e.oneOf=R,e.instanceOf=z,e.oneOfType=U,e.arrayOf=$,e.objectOf=C,e.shape=G,e.utils={validate:function(e,t){return!0===k(t,e,!0)},toType:function(e,t,n){return void 0===n&&(n=!1),n?S(e,t):x(e,t)}},e}();function Q(e){var t;return void 0===e&&(e={func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0}),t=/*#__PURE__*/function(t){function n(){return t.apply(this,arguments)||this}return o(n,t),r(n,null,[{key:"sensibleDefaults",get:function(){return i({},this.defaults)},set:function(t){this.defaults=!1!==t?i({},!0!==t?t:e):{}}}])}(K),t.defaults=i({},e),t}var W=/*#__PURE__*/function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(Q());export{N as any,D as array,$ as arrayOf,q as bool,f as config,Q as createTypes,M as custom,W as default,A as fromType,V as func,z as instanceOf,Y as integer,J as nullable,B as number,F as object,C as objectOf,R as oneOf,U as oneOfType,G as shape,L as string,I as symbol,x as toType,S as toValidableType,k as validateType};
import{isPlainObject as e}from"is-plain-object";function t(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function n(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,t(i.key),i)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,u(e,t)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function a(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var f={silent:!1,logLevel:"warn"},l=["validator"],c=Object.prototype,s=c.toString,v=c.hasOwnProperty,d=/^\s*function (\w+)/;function p(e){var t,n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){var r=n.toString().match(d);return r?r[1]:""}return""}var y=e;function h(){}var b=h;if("production"!==process.env.NODE_ENV){var g="undefined"!=typeof console;b=g?function(e,t){void 0===t&&(t=f.logLevel),!1===f.silent&&console[t]("[VueTypes warn]: "+e)}:h}var O=function(e,t){return v.call(e,t)},m=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},j=Array.isArray||function(e){return"[object Array]"===s.call(e)},_=function(e){return"[object Function]"===s.call(e)},T=function(e,t){return y(e)&&O(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t)},w=function(e){return y(e)&&(O(e,"type")||["_vueTypes_name","validator","default","required"].some(function(t){return O(e,t)}))};function P(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function k(e,t,n){var r;void 0===n&&(n=!1);var i=!0,o="";r=y(e)?e:{type:e};var u=T(r)?r._vueTypes_name+" - ":"";if(w(r)&&null!==r.type){if(void 0===r.type||!0===r.type)return i;if(!r.required&&null==t)return i;j(r.type)?(i=r.type.some(function(e){return!0===k(e,t,!0)}),o=r.type.map(function(e){return p(e)}).join(" or ")):i="Array"===(o=p(r))?j(t):"Object"===o?y(t):"String"===o||"Number"===o||"Boolean"===o||"Function"===o?function(e){if(null==e)return"";var t=e.constructor.toString().match(d);return t?t[1].replace(/^Async/,""):""}(t)===o:t instanceof r.type}if(!i){var a=u+'value "'+t+'" should be of type "'+o+'"';return!1===n?(b(a),!1):a}if(O(r,"validator")&&_(r.validator)){var f=b,l=[];if(b=function(e){l.push(e)},i=r.validator(t),b=f,!i){var c=(l.length>1?"* ":"")+l.join("\n* ");return l.length=0,!1===n?(b(c),i):c}}return i}function x(e,t){var n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get:function(){return this.required=!0,this}},def:{value:function(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(O(this,"default")&&delete this.default,this):_(e)||!0===k(this,e,!0)?(this.default=j(e)?function(){return[].concat(e)}:y(e)?function(){return Object.assign({},e)}:e,this):(b(this._vueTypes_name+' - invalid default value: "'+e+'"'),this)}}}),r=n.validator;return _(r)&&(n.validator=P(r,n)),n}function S(e,t){var n=x(e,t);return Object.defineProperty(n,"validate",{value:function(e){return _(this.validator)&&b(this._vueTypes_name+" - calling .validate() will overwrite the current custom validator function. Validator info:\n"+JSON.stringify(this)),this.validator=P(e,this),this}})}function A(e,t,n){var r,i,o=(r=t,i={},Object.getOwnPropertyNames(r).forEach(function(e){i[e]=Object.getOwnPropertyDescriptor(r,e)}),Object.defineProperties({},i));if(o._vueTypes_name=e,!y(n))return o;var u,f,c=n.validator,s=a(n,l);if(_(c)){var v=o.validator;v&&(v=null!==(f=(u=v).__original)&&void 0!==f?f:u),o.validator=P(v?function(e){return v.call(this,e)&&c.call(this,e)}:c,o)}return Object.assign(o,s)}function E(e){return e.replace(/^(?!\s*$)/gm," ")}var N=function(){return S("any",{})},V=function(){return S("function",{type:Function})},q=function(){return S("boolean",{type:Boolean})},L=function(){return S("string",{type:String})},B=function(){return S("number",{type:Number})},D=function(){return S("array",{type:Array})},F=function(){return S("object",{type:Object})},Y=function(){return x("integer",{type:Number,validator:function(e){var t=m(e);return!1===t&&b('integer - "'+e+'" is not an integer'),t}})},I=function(){return x("symbol",{validator:function(e){var t="symbol"==typeof e;return!1===t&&b('symbol - invalid value "'+e+'"'),t}})},J=function(){return Object.defineProperty({type:null,validator:function(e){var t=null===e;return!1===t&&b("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"})};function M(e,t){if(void 0===t&&(t="custom validation failed"),"function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return x(e.name||"<<anonymous function>>",{type:null,validator:function(n){var r=e(n);return r||b(this._vueTypes_name+" - "+t),r}})}function R(e){if(!j(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");var t='oneOf - value should be one of "'+e.map(function(e){return"symbol"==typeof e?e.toString():e}).join('", "')+'".',n={validator:function(n){var r=-1!==e.indexOf(n);return r||b(t),r}};if(-1===e.indexOf(null)){var r=e.reduce(function(e,t){if(null!=t){var n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e},[]);r.length>0&&(n.type=r)}return x("oneOf",n)}function U(e){if(!j(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");for(var t=!1,n=!1,r=[],i=0;i<e.length;i+=1){var o=e[i];if(w(o)){if(_(o.validator)&&(t=!0),T(o,"oneOf")&&o.type){r=r.concat(o.type);continue}if(T(o,"nullable")){n=!0;continue}if(!0===o.type||!o.type){b('oneOfType - invalid usage of "true" and "null" as types.');continue}r=r.concat(o.type)}else r.push(o)}r=r.filter(function(e,t){return r.indexOf(e)===t});var u=!1===n&&r.length>0?r:null;return x("oneOfType",t?{type:u,validator:function(t){var n=[],r=e.some(function(e){var r=k(e,t,!0);return"string"==typeof r&&n.push(r),!0===r});return r||b("oneOfType - provided value does not match any of the "+n.length+" passed-in validators:\n"+E(n.join("\n"))),r}}:{type:u})}function $(e){return x("arrayOf",{type:Array,validator:function(t){var n="",r=t.every(function(t){return!0===(n=k(e,t,!0))});return r||b("arrayOf - value validation error:\n"+E(n)),r}})}function z(e){return x("instanceOf",{type:e})}function C(e){return x("objectOf",{type:Object,validator:function(t){var n="",r=Object.keys(t).every(function(r){return!0===(n=k(e,t[r],!0))});return r||b("objectOf - value validation error:\n"+E(n)),r}})}function G(e){var t=Object.keys(e),n=t.filter(function(t){var n;return!(null===(n=e[t])||void 0===n||!n.required)}),r=x("shape",{type:Object,validator:function(r){var i=this;if(!y(r))return!1;var o=Object.keys(r);if(n.length>0&&n.some(function(e){return-1===o.indexOf(e)})){var u=n.filter(function(e){return-1===o.indexOf(e)});return b(1===u.length?'shape - required property "'+u[0]+'" is not defined.':'shape - required properties "'+u.join('", "')+'" are not defined.'),!1}return o.every(function(n){if(-1===t.indexOf(n))return!0===i._vueTypes_isLoose||(b('shape - shape definition does not include a "'+n+'" property. Allowed keys: "'+t.join('", "')+'".'),!1);var o=k(e[n],r[n],!0);return"string"==typeof o&&b('shape - "'+n+'" property validation error:\n '+E(o)),!0===o})}});return Object.defineProperty(r,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(r,"loose",{get:function(){return this._vueTypes_isLoose=!0,this}}),r}var H=["name","validate","getter"],K=/*#__PURE__*/function(e){return e=/*#__PURE__*/function(){function e(){}return e.extend=function(e){var t=this;if(b("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),j(e))return e.forEach(function(e){return t.extend(e)}),this;var n=e.name,r=e.validate,i=void 0!==r&&r,o=e.getter,u=void 0!==o&&o,f=a(e,H);if(O(this,n))throw new TypeError('[VueTypes error]: Type "'+n+'" already defined');var l,c=f.type;return T(c)?(delete f.type,Object.defineProperty(this,n,u?{get:function(){return A(n,c,f)}}:{value:function(){var e,t=A(n,c,f);return t.validator&&(t.validator=(e=t.validator).bind.apply(e,[t].concat([].slice.call(arguments)))),t}})):(l=u?{get:function(){var e=Object.assign({},f);return i?S(n,e):x(n,e)},enumerable:!0}:{value:function(){var e,t,r=Object.assign({},f);return e=i?S(n,r):x(n,r),r.validator&&(e.validator=(t=r.validator).bind.apply(t,[e].concat([].slice.call(arguments)))),e},enumerable:!0},Object.defineProperty(this,n,l))},r(e,null,[{key:"any",get:function(){return N()}},{key:"func",get:function(){return V().def(this.defaults.func)}},{key:"bool",get:function(){return void 0===this.defaults.bool?q():q().def(this.defaults.bool)}},{key:"string",get:function(){return L().def(this.defaults.string)}},{key:"number",get:function(){return B().def(this.defaults.number)}},{key:"array",get:function(){return D().def(this.defaults.array)}},{key:"object",get:function(){return F().def(this.defaults.object)}},{key:"integer",get:function(){return Y().def(this.defaults.integer)}},{key:"symbol",get:function(){return I()}},{key:"nullable",get:function(){return J()}}])}(),e.defaults={},e.sensibleDefaults=void 0,e.config=f,e.custom=M,e.oneOf=R,e.instanceOf=z,e.oneOfType=U,e.arrayOf=$,e.objectOf=C,e.shape=G,e.utils={validate:function(e,t){return!0===k(t,e,!0)},toType:function(e,t,n){return void 0===n&&(n=!1),n?S(e,t):x(e,t)}},e}();function Q(e){var t;return void 0===e&&(e={func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0}),t=/*#__PURE__*/function(t){function n(){return t.apply(this,arguments)||this}return o(n,t),r(n,null,[{key:"sensibleDefaults",get:function(){return i({},this.defaults)},set:function(t){this.defaults=!1!==t?i({},!0!==t?t:e):{}}}])}(K),t.defaults=i({},e),t}var W=/*#__PURE__*/function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(Q());export{N as any,D as array,$ as arrayOf,q as bool,f as config,Q as createTypes,M as custom,W as default,A as fromType,V as func,z as instanceOf,Y as integer,J as nullable,B as number,F as object,C as objectOf,R as oneOf,U as oneOfType,G as shape,L as string,I as symbol,x as toType,S as toValidableType,k as validateType};
//# sourceMappingURL=vue-types.m.js.map

@@ -1,2 +0,2 @@

import{isPlainObject as e}from"is-plain-object";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.apply(this,arguments)}function n(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const r={silent:!1,logLevel:"warn"},i=["validator"],o=Object.prototype,a=o.toString,s=o.hasOwnProperty,u=/^\s*function (\w+)/;function l(e){var t;const n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){const e=n.toString().match(u);return e?e[1]:""}return""}const c=e,f=e=>e;let d=f;if("production"!==process.env.NODE_ENV){const e="undefined"!=typeof console;d=e?function(e,t=r.logLevel){!1===r.silent&&console[t](`[VueTypes warn]: ${e}`)}:f}const p=(e,t)=>s.call(e,t),y=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},v=Array.isArray||function(e){return"[object Array]"===a.call(e)},h=e=>"[object Function]"===a.call(e),b=(e,t)=>c(e)&&p(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t),g=e=>c(e)&&(p(e,"type")||["_vueTypes_name","validator","default","required"].some(t=>p(e,t)));function O(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function m(e,t,n=!1){let r,i=!0,o="";r=c(e)?e:{type:e};const a=b(r)?r._vueTypes_name+" - ":"";if(g(r)&&null!==r.type){if(void 0===r.type||!0===r.type)return i;if(!r.required&&null==t)return i;v(r.type)?(i=r.type.some(e=>!0===m(e,t,!0)),o=r.type.map(e=>l(e)).join(" or ")):(o=l(r),i="Array"===o?v(t):"Object"===o?c(t):"String"===o||"Number"===o||"Boolean"===o||"Function"===o?function(e){if(null==e)return"";const t=e.constructor.toString().match(u);return t?t[1].replace(/^Async/,""):""}(t)===o:t instanceof r.type)}if(!i){const e=`${a}value "${t}" should be of type "${o}"`;return!1===n?(d(e),!1):e}if(p(r,"validator")&&h(r.validator)){const e=d,o=[];if(d=e=>{o.push(e)},i=r.validator(t),d=e,!i){const e=(o.length>1?"* ":"")+o.join("\n* ");return o.length=0,!1===n?(d(e),i):e}}return i}function j(e,t){const n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(p(this,"default")&&delete this.default,this):h(e)||!0===m(this,e,!0)?(this.default=v(e)?()=>[...e]:c(e)?()=>Object.assign({},e):e,this):(d(`${this._vueTypes_name} - invalid default value: "${e}"`),this)}}}),{validator:r}=n;return h(r)&&(n.validator=O(r,n)),n}function _(e,t){const n=j(e,t);return Object.defineProperty(n,"validate",{value(e){return h(this.validator)&&d(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=O(e,this),this}})}function T(e,t,r){const o=function(e){const t={};return Object.getOwnPropertyNames(e).forEach(n=>{t[n]=Object.getOwnPropertyDescriptor(e,n)}),Object.defineProperties({},t)}(t);if(o._vueTypes_name=e,!c(r))return o;const{validator:a}=r,s=n(r,i);if(h(a)){let{validator:e}=o;e&&(e=null!==(l=(u=e).__original)&&void 0!==l?l:u),o.validator=O(e?function(t){return e.call(this,t)&&a.call(this,t)}:a,o)}var u,l;return Object.assign(o,s)}function $(e){return e.replace(/^(?!\s*$)/gm," ")}const w=()=>_("any",{}),x=()=>_("function",{type:Function}),P=()=>_("boolean",{type:Boolean}),A=()=>_("string",{type:String}),E=()=>_("number",{type:Number}),S=()=>_("array",{type:Array}),N=()=>_("object",{type:Object}),V=()=>j("integer",{type:Number,validator(e){const t=y(e);return!1===t&&d(`integer - "${e}" is not an integer`),t}}),q=()=>j("symbol",{validator(e){const t="symbol"==typeof e;return!1===t&&d(`symbol - invalid value "${e}"`),t}}),k=()=>Object.defineProperty({type:null,validator(e){const t=null===e;return!1===t&&d("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"});function D(e,t="custom validation failed"){if("function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return j(e.name||"<<anonymous function>>",{type:null,validator(n){const r=e(n);return r||d(`${this._vueTypes_name} - ${t}`),r}})}function L(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.map(e=>"symbol"==typeof e?e.toString():e).join('", "')}".`,n={validator(n){const r=-1!==e.indexOf(n);return r||d(t),r}};if(-1===e.indexOf(null)){const t=e.reduce((e,t)=>{if(null!=t){const n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e},[]);t.length>0&&(n.type=t)}return j("oneOf",n)}function B(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,n=!1,r=[];for(let i=0;i<e.length;i+=1){const o=e[i];if(g(o)){if(h(o.validator)&&(t=!0),b(o,"oneOf")&&o.type){r=r.concat(o.type);continue}if(b(o,"nullable")){n=!0;continue}if(!0===o.type||!o.type){d('oneOfType - invalid usage of "true" and "null" as types.');continue}r=r.concat(o.type)}else r.push(o)}r=r.filter((e,t)=>r.indexOf(e)===t);const i=!1===n&&r.length>0?r:null;return j("oneOfType",t?{type:i,validator(t){const n=[],r=e.some(e=>{const r=m(e,t,!0);return"string"==typeof r&&n.push(r),!0===r});return r||d(`oneOfType - provided value does not match any of the ${n.length} passed-in validators:\n${$(n.join("\n"))}`),r}}:{type:i})}function F(e){return j("arrayOf",{type:Array,validator(t){let n="";const r=t.every(t=>(n=m(e,t,!0),!0===n));return r||d(`arrayOf - value validation error:\n${$(n)}`),r}})}function Y(e){return j("instanceOf",{type:e})}function I(e){return j("objectOf",{type:Object,validator(t){let n="";const r=Object.keys(t).every(r=>(n=m(e,t[r],!0),!0===n));return r||d(`objectOf - value validation error:\n${$(n)}`),r}})}function J(e){const t=Object.keys(e),n=t.filter(t=>{var n;return!(null===(n=e[t])||void 0===n||!n.required)}),r=j("shape",{type:Object,validator(r){if(!c(r))return!1;const i=Object.keys(r);if(n.length>0&&n.some(e=>-1===i.indexOf(e))){const e=n.filter(e=>-1===i.indexOf(e));return d(1===e.length?`shape - required property "${e[0]}" is not defined.`:`shape - required properties "${e.join('", "')}" are not defined.`),!1}return i.every(n=>{if(-1===t.indexOf(n))return!0===this._vueTypes_isLoose||(d(`shape - shape definition does not include a "${n}" property. Allowed keys: "${t.join('", "')}".`),!1);const i=m(e[n],r[n],!0);return"string"==typeof i&&d(`shape - "${n}" property validation error:\n ${$(i)}`),!0===i})}});return Object.defineProperty(r,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(r,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),r}const M=["name","validate","getter"],R=/*#__PURE__*/(e=>((e=class{static get any(){return w()}static get func(){return x().def(this.defaults.func)}static get bool(){return void 0===this.defaults.bool?P():P().def(this.defaults.bool)}static get string(){return A().def(this.defaults.string)}static get number(){return E().def(this.defaults.number)}static get array(){return S().def(this.defaults.array)}static get object(){return N().def(this.defaults.object)}static get integer(){return V().def(this.defaults.integer)}static get symbol(){return q()}static get nullable(){return k()}static extend(e){if(d("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),v(e))return e.forEach(e=>this.extend(e)),this;const{name:t,validate:r=!1,getter:i=!1}=e,o=n(e,M);if(p(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:a}=o;if(b(a))return delete o.type,Object.defineProperty(this,t,i?{get:()=>T(t,a,o)}:{value(...e){const n=T(t,a,o);return n.validator&&(n.validator=n.validator.bind(n,...e)),n}});let s;return s=i?{get(){const e=Object.assign({},o);return r?_(t,e):j(t,e)},enumerable:!0}:{value(...e){const n=Object.assign({},o);let i;return i=r?_(t,n):j(t,n),n.validator&&(i.validator=n.validator.bind(i,...e)),i},enumerable:!0},Object.defineProperty(this,t,s)}}).defaults={},e.sensibleDefaults=void 0,e.config=r,e.custom=D,e.oneOf=L,e.instanceOf=Y,e.oneOfType=B,e.arrayOf=F,e.objectOf=I,e.shape=J,e.utils={validate:(e,t)=>!0===m(t,e,!0),toType:(e,t,n=!1)=>n?_(e,t):j(e,t)},e))();function U(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){var n;return(n=class extends R{static get sensibleDefaults(){return t({},this.defaults)}static set sensibleDefaults(n){this.defaults=!1!==n?t({},!0!==n?n:e):{}}}).defaults=t({},e),n}class z extends(U()){}export{w as any,S as array,F as arrayOf,P as bool,r as config,U as createTypes,D as custom,z as default,T as fromType,x as func,Y as instanceOf,V as integer,k as nullable,E as number,N as object,I as objectOf,L as oneOf,B as oneOfType,J as shape,A as string,q as symbol,j as toType,_ as toValidableType,m as validateType};
import{isPlainObject as e}from"is-plain-object";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.apply(this,arguments)}function n(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const r={silent:!1,logLevel:"warn"},i=["validator"],o=Object.prototype,a=o.toString,s=o.hasOwnProperty,u=/^\s*function (\w+)/;function l(e){var t;const n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){const e=n.toString().match(u);return e?e[1]:""}return""}const c=e;function f(){}let d=f;if("production"!==process.env.NODE_ENV){const e="undefined"!=typeof console;d=e?function(e,t=r.logLevel){!1===r.silent&&console[t](`[VueTypes warn]: ${e}`)}:f}const p=(e,t)=>s.call(e,t),y=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},v=Array.isArray||function(e){return"[object Array]"===a.call(e)},h=e=>"[object Function]"===a.call(e),b=(e,t)=>c(e)&&p(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t),g=e=>c(e)&&(p(e,"type")||["_vueTypes_name","validator","default","required"].some(t=>p(e,t)));function O(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function m(e,t,n=!1){let r,i=!0,o="";r=c(e)?e:{type:e};const a=b(r)?r._vueTypes_name+" - ":"";if(g(r)&&null!==r.type){if(void 0===r.type||!0===r.type)return i;if(!r.required&&null==t)return i;v(r.type)?(i=r.type.some(e=>!0===m(e,t,!0)),o=r.type.map(e=>l(e)).join(" or ")):(o=l(r),i="Array"===o?v(t):"Object"===o?c(t):"String"===o||"Number"===o||"Boolean"===o||"Function"===o?function(e){if(null==e)return"";const t=e.constructor.toString().match(u);return t?t[1].replace(/^Async/,""):""}(t)===o:t instanceof r.type)}if(!i){const e=`${a}value "${t}" should be of type "${o}"`;return!1===n?(d(e),!1):e}if(p(r,"validator")&&h(r.validator)){const e=d,o=[];if(d=e=>{o.push(e)},i=r.validator(t),d=e,!i){const e=(o.length>1?"* ":"")+o.join("\n* ");return o.length=0,!1===n?(d(e),i):e}}return i}function j(e,t){const n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(p(this,"default")&&delete this.default,this):h(e)||!0===m(this,e,!0)?(this.default=v(e)?()=>[...e]:c(e)?()=>Object.assign({},e):e,this):(d(`${this._vueTypes_name} - invalid default value: "${e}"`),this)}}}),{validator:r}=n;return h(r)&&(n.validator=O(r,n)),n}function _(e,t){const n=j(e,t);return Object.defineProperty(n,"validate",{value(e){return h(this.validator)&&d(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=O(e,this),this}})}function T(e,t,r){const o=function(e){const t={};return Object.getOwnPropertyNames(e).forEach(n=>{t[n]=Object.getOwnPropertyDescriptor(e,n)}),Object.defineProperties({},t)}(t);if(o._vueTypes_name=e,!c(r))return o;const{validator:a}=r,s=n(r,i);if(h(a)){let{validator:e}=o;e&&(e=null!==(l=(u=e).__original)&&void 0!==l?l:u),o.validator=O(e?function(t){return e.call(this,t)&&a.call(this,t)}:a,o)}var u,l;return Object.assign(o,s)}function $(e){return e.replace(/^(?!\s*$)/gm," ")}const w=()=>_("any",{}),x=()=>_("function",{type:Function}),P=()=>_("boolean",{type:Boolean}),A=()=>_("string",{type:String}),E=()=>_("number",{type:Number}),S=()=>_("array",{type:Array}),N=()=>_("object",{type:Object}),V=()=>j("integer",{type:Number,validator(e){const t=y(e);return!1===t&&d(`integer - "${e}" is not an integer`),t}}),q=()=>j("symbol",{validator(e){const t="symbol"==typeof e;return!1===t&&d(`symbol - invalid value "${e}"`),t}}),k=()=>Object.defineProperty({type:null,validator(e){const t=null===e;return!1===t&&d("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"});function D(e,t="custom validation failed"){if("function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return j(e.name||"<<anonymous function>>",{type:null,validator(n){const r=e(n);return r||d(`${this._vueTypes_name} - ${t}`),r}})}function L(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.map(e=>"symbol"==typeof e?e.toString():e).join('", "')}".`,n={validator(n){const r=-1!==e.indexOf(n);return r||d(t),r}};if(-1===e.indexOf(null)){const t=e.reduce((e,t)=>{if(null!=t){const n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e},[]);t.length>0&&(n.type=t)}return j("oneOf",n)}function B(e){if(!v(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,n=!1,r=[];for(let i=0;i<e.length;i+=1){const o=e[i];if(g(o)){if(h(o.validator)&&(t=!0),b(o,"oneOf")&&o.type){r=r.concat(o.type);continue}if(b(o,"nullable")){n=!0;continue}if(!0===o.type||!o.type){d('oneOfType - invalid usage of "true" and "null" as types.');continue}r=r.concat(o.type)}else r.push(o)}r=r.filter((e,t)=>r.indexOf(e)===t);const i=!1===n&&r.length>0?r:null;return j("oneOfType",t?{type:i,validator(t){const n=[],r=e.some(e=>{const r=m(e,t,!0);return"string"==typeof r&&n.push(r),!0===r});return r||d(`oneOfType - provided value does not match any of the ${n.length} passed-in validators:\n${$(n.join("\n"))}`),r}}:{type:i})}function F(e){return j("arrayOf",{type:Array,validator(t){let n="";const r=t.every(t=>(n=m(e,t,!0),!0===n));return r||d(`arrayOf - value validation error:\n${$(n)}`),r}})}function Y(e){return j("instanceOf",{type:e})}function I(e){return j("objectOf",{type:Object,validator(t){let n="";const r=Object.keys(t).every(r=>(n=m(e,t[r],!0),!0===n));return r||d(`objectOf - value validation error:\n${$(n)}`),r}})}function J(e){const t=Object.keys(e),n=t.filter(t=>{var n;return!(null===(n=e[t])||void 0===n||!n.required)}),r=j("shape",{type:Object,validator(r){if(!c(r))return!1;const i=Object.keys(r);if(n.length>0&&n.some(e=>-1===i.indexOf(e))){const e=n.filter(e=>-1===i.indexOf(e));return d(1===e.length?`shape - required property "${e[0]}" is not defined.`:`shape - required properties "${e.join('", "')}" are not defined.`),!1}return i.every(n=>{if(-1===t.indexOf(n))return!0===this._vueTypes_isLoose||(d(`shape - shape definition does not include a "${n}" property. Allowed keys: "${t.join('", "')}".`),!1);const i=m(e[n],r[n],!0);return"string"==typeof i&&d(`shape - "${n}" property validation error:\n ${$(i)}`),!0===i})}});return Object.defineProperty(r,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(r,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),r}const M=["name","validate","getter"],R=/*#__PURE__*/(e=>((e=class{static get any(){return w()}static get func(){return x().def(this.defaults.func)}static get bool(){return void 0===this.defaults.bool?P():P().def(this.defaults.bool)}static get string(){return A().def(this.defaults.string)}static get number(){return E().def(this.defaults.number)}static get array(){return S().def(this.defaults.array)}static get object(){return N().def(this.defaults.object)}static get integer(){return V().def(this.defaults.integer)}static get symbol(){return q()}static get nullable(){return k()}static extend(e){if(d("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),v(e))return e.forEach(e=>this.extend(e)),this;const{name:t,validate:r=!1,getter:i=!1}=e,o=n(e,M);if(p(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:a}=o;if(b(a))return delete o.type,Object.defineProperty(this,t,i?{get:()=>T(t,a,o)}:{value(...e){const n=T(t,a,o);return n.validator&&(n.validator=n.validator.bind(n,...e)),n}});let s;return s=i?{get(){const e=Object.assign({},o);return r?_(t,e):j(t,e)},enumerable:!0}:{value(...e){const n=Object.assign({},o);let i;return i=r?_(t,n):j(t,n),n.validator&&(i.validator=n.validator.bind(i,...e)),i},enumerable:!0},Object.defineProperty(this,t,s)}}).defaults={},e.sensibleDefaults=void 0,e.config=r,e.custom=D,e.oneOf=L,e.instanceOf=Y,e.oneOfType=B,e.arrayOf=F,e.objectOf=I,e.shape=J,e.utils={validate:(e,t)=>!0===m(t,e,!0),toType:(e,t,n=!1)=>n?_(e,t):j(e,t)},e))();function U(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){var n;return(n=class extends R{static get sensibleDefaults(){return t({},this.defaults)}static set sensibleDefaults(n){this.defaults=!1!==n?t({},!0!==n?n:e):{}}}).defaults=t({},e),n}class z extends(U()){}export{w as any,S as array,F as arrayOf,P as bool,r as config,U as createTypes,D as custom,z as default,T as fromType,x as func,Y as instanceOf,V as integer,k as nullable,E as number,N as object,I as objectOf,L as oneOf,B as oneOfType,J as shape,A as string,q as symbol,j as toType,_ as toValidableType,m as validateType};
//# sourceMappingURL=vue-types.modern.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("is-plain-object")):"function"==typeof define&&define.amd?define(["exports","is-plain-object"],t):t((e||self).VueTypes={},e.isPlainObject)}(this,function(e,t){function n(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function r(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}function u(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,a(e,t)}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function f(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var l={silent:!1,logLevel:"warn"},c=["validator"],s=Object.prototype,y=s.toString,p=s.hasOwnProperty,d=/^\s*function (\w+)/;function v(e){var t,n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){var r=n.toString().match(d);return r?r[1]:""}return""}var b=t.isPlainObject,h=function(e){return e},g=function(e,t){return p.call(e,t)},O=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},m=Array.isArray||function(e){return"[object Array]"===y.call(e)},j=function(e){return"[object Function]"===y.call(e)},T=function(e,t){return b(e)&&g(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t)},_=function(e){return b(e)&&(g(e,"type")||["_vueTypes_name","validator","default","required"].some(function(t){return g(e,t)}))};function w(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function P(e,t,n){var r;void 0===n&&(n=!1);var i=!0,o="";r=b(e)?e:{type:e};var u=T(r)?r._vueTypes_name+" - ":"";if(_(r)&&null!==r.type){if(void 0===r.type||!0===r.type)return i;if(!r.required&&null==t)return i;m(r.type)?(i=r.type.some(function(e){return!0===P(e,t,!0)}),o=r.type.map(function(e){return v(e)}).join(" or ")):i="Array"===(o=v(r))?m(t):"Object"===o?b(t):"String"===o||"Number"===o||"Boolean"===o||"Function"===o?function(e){if(null==e)return"";var t=e.constructor.toString().match(d);return t?t[1].replace(/^Async/,""):""}(t)===o:t instanceof r.type}if(!i){var a=u+'value "'+t+'" should be of type "'+o+'"';return!1===n?(h(a),!1):a}if(g(r,"validator")&&j(r.validator)){var f=h,l=[];if(h=function(e){l.push(e)},i=r.validator(t),h=f,!i){var c=(l.length>1?"* ":"")+l.join("\n* ");return l.length=0,!1===n?(h(c),i):c}}return i}function k(e,t){var n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get:function(){return this.required=!0,this}},def:{value:function(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(g(this,"default")&&delete this.default,this):j(e)||!0===P(this,e,!0)?(this.default=m(e)?function(){return[].concat(e)}:b(e)?function(){return Object.assign({},e)}:e,this):(h(this._vueTypes_name+' - invalid default value: "'+e+'"'),this)}}}),r=n.validator;return j(r)&&(n.validator=w(r,n)),n}function x(e,t){var n=k(e,t);return Object.defineProperty(n,"validate",{value:function(e){return j(this.validator)&&h(this._vueTypes_name+" - calling .validate() will overwrite the current custom validator function. Validator info:\n"+JSON.stringify(this)),this.validator=w(e,this),this}})}function S(e,t,n){var r,i,o=(r=t,i={},Object.getOwnPropertyNames(r).forEach(function(e){i[e]=Object.getOwnPropertyDescriptor(r,e)}),Object.defineProperties({},i));if(o._vueTypes_name=e,!b(n))return o;var u,a,l=n.validator,s=f(n,c);if(j(l)){var y=o.validator;y&&(y=null!==(a=(u=y).__original)&&void 0!==a?a:u),o.validator=w(y?function(e){return y.call(this,e)&&l.call(this,e)}:l,o)}return Object.assign(o,s)}function A(e){return e.replace(/^(?!\s*$)/gm," ")}var q=function(){return x("any",{})},E=function(){return x("function",{type:Function})},V=function(){return x("boolean",{type:Boolean})},N=function(){return x("string",{type:String})},B=function(){return x("number",{type:Number})},F=function(){return x("array",{type:Array})},L=function(){return x("object",{type:Object})},D=function(){return k("integer",{type:Number,validator:function(e){var t=O(e);return!1===t&&h('integer - "'+e+'" is not an integer'),t}})},Y=function(){return k("symbol",{validator:function(e){var t="symbol"==typeof e;return!1===t&&h('symbol - invalid value "'+e+'"'),t}})},I=function(){return Object.defineProperty({type:null,validator:function(e){var t=null===e;return!1===t&&h("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"})};function J(e,t){if(void 0===t&&(t="custom validation failed"),"function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return k(e.name||"<<anonymous function>>",{type:null,validator:function(n){var r=e(n);return r||h(this._vueTypes_name+" - "+t),r}})}function M(e){if(!m(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");var t='oneOf - value should be one of "'+e.map(function(e){return"symbol"==typeof e?e.toString():e}).join('", "')+'".',n={validator:function(n){var r=-1!==e.indexOf(n);return r||h(t),r}};if(-1===e.indexOf(null)){var r=e.reduce(function(e,t){if(null!=t){var n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e},[]);r.length>0&&(n.type=r)}return k("oneOf",n)}function R(e){if(!m(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");for(var t=!1,n=!1,r=[],i=0;i<e.length;i+=1){var o=e[i];if(_(o)){if(j(o.validator)&&(t=!0),T(o,"oneOf")&&o.type){r=r.concat(o.type);continue}if(T(o,"nullable")){n=!0;continue}if(!0===o.type||!o.type){h('oneOfType - invalid usage of "true" and "null" as types.');continue}r=r.concat(o.type)}else r.push(o)}r=r.filter(function(e,t){return r.indexOf(e)===t});var u=!1===n&&r.length>0?r:null;return k("oneOfType",t?{type:u,validator:function(t){var n=[],r=e.some(function(e){var r=P(e,t,!0);return"string"==typeof r&&n.push(r),!0===r});return r||h("oneOfType - provided value does not match any of the "+n.length+" passed-in validators:\n"+A(n.join("\n"))),r}}:{type:u})}function U(e){return k("arrayOf",{type:Array,validator:function(t){var n="",r=t.every(function(t){return!0===(n=P(e,t,!0))});return r||h("arrayOf - value validation error:\n"+A(n)),r}})}function $(e){return k("instanceOf",{type:e})}function z(e){return k("objectOf",{type:Object,validator:function(t){var n="",r=Object.keys(t).every(function(r){return!0===(n=P(e,t[r],!0))});return r||h("objectOf - value validation error:\n"+A(n)),r}})}function C(e){var t=Object.keys(e),n=t.filter(function(t){var n;return!(null===(n=e[t])||void 0===n||!n.required)}),r=k("shape",{type:Object,validator:function(r){var i=this;if(!b(r))return!1;var o=Object.keys(r);if(n.length>0&&n.some(function(e){return-1===o.indexOf(e)})){var u=n.filter(function(e){return-1===o.indexOf(e)});return h(1===u.length?'shape - required property "'+u[0]+'" is not defined.':'shape - required properties "'+u.join('", "')+'" are not defined.'),!1}return o.every(function(n){if(-1===t.indexOf(n))return!0===i._vueTypes_isLoose||(h('shape - shape definition does not include a "'+n+'" property. Allowed keys: "'+t.join('", "')+'".'),!1);var o=P(e[n],r[n],!0);return"string"==typeof o&&h('shape - "'+n+'" property validation error:\n '+A(o)),!0===o})}});return Object.defineProperty(r,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(r,"loose",{get:function(){return this._vueTypes_isLoose=!0,this}}),r}var G=["name","validate","getter"],H=/*#__PURE__*/function(e){return e=/*#__PURE__*/function(){function e(){}return e.extend=function(e){var t=this;if(h("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),m(e))return e.forEach(function(e){return t.extend(e)}),this;var n=e.name,r=e.validate,i=void 0!==r&&r,o=e.getter,u=void 0!==o&&o,a=f(e,G);if(g(this,n))throw new TypeError('[VueTypes error]: Type "'+n+'" already defined');var l,c=a.type;return T(c)?(delete a.type,Object.defineProperty(this,n,u?{get:function(){return S(n,c,a)}}:{value:function(){var e,t=S(n,c,a);return t.validator&&(t.validator=(e=t.validator).bind.apply(e,[t].concat([].slice.call(arguments)))),t}})):(l=u?{get:function(){var e=Object.assign({},a);return i?x(n,e):k(n,e)},enumerable:!0}:{value:function(){var e,t,r=Object.assign({},a);return e=i?x(n,r):k(n,r),r.validator&&(e.validator=(t=r.validator).bind.apply(t,[e].concat([].slice.call(arguments)))),e},enumerable:!0},Object.defineProperty(this,n,l))},i(e,null,[{key:"any",get:function(){return q()}},{key:"func",get:function(){return E().def(this.defaults.func)}},{key:"bool",get:function(){return void 0===this.defaults.bool?V():V().def(this.defaults.bool)}},{key:"string",get:function(){return N().def(this.defaults.string)}},{key:"number",get:function(){return B().def(this.defaults.number)}},{key:"array",get:function(){return F().def(this.defaults.array)}},{key:"object",get:function(){return L().def(this.defaults.object)}},{key:"integer",get:function(){return D().def(this.defaults.integer)}},{key:"symbol",get:function(){return Y()}},{key:"nullable",get:function(){return I()}}])}(),e.defaults={},e.sensibleDefaults=void 0,e.config=l,e.custom=J,e.oneOf=M,e.instanceOf=$,e.oneOfType=R,e.arrayOf=U,e.objectOf=z,e.shape=C,e.utils={validate:function(e,t){return!0===P(t,e,!0)},toType:function(e,t,n){return void 0===n&&(n=!1),n?x(e,t):k(e,t)}},e}();function K(e){var t;return void 0===e&&(e={func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0}),t=/*#__PURE__*/function(t){function n(){return t.apply(this,arguments)||this}return u(n,t),i(n,null,[{key:"sensibleDefaults",get:function(){return o({},this.defaults)},set:function(t){this.defaults=!1!==t?o({},!0!==t?t:e):{}}}])}(H),t.defaults=o({},e),t}var Q=/*#__PURE__*/function(e){function t(){return e.apply(this,arguments)||this}return u(t,e),t}(K());e.any=q,e.array=F,e.arrayOf=U,e.bool=V,e.config=l,e.createTypes=K,e.custom=J,e.default=Q,e.fromType=S,e.func=E,e.instanceOf=$,e.integer=D,e.nullable=I,e.number=B,e.object=L,e.objectOf=z,e.oneOf=M,e.oneOfType=R,e.shape=C,e.string=N,e.symbol=Y,e.toType=k,e.toValidableType=x,e.validateType=P});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("is-plain-object")):"function"==typeof define&&define.amd?define(["exports","is-plain-object"],t):t((e||self).VueTypes={},e.isPlainObject)}(this,function(e,t){function n(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function r(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(this,arguments)}function u(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,a(e,t)}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function f(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var l={silent:!1,logLevel:"warn"},c=["validator"],s=Object.prototype,y=s.toString,p=s.hasOwnProperty,d=/^\s*function (\w+)/;function v(e){var t,n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){var r=n.toString().match(d);return r?r[1]:""}return""}var b=t.isPlainObject,h=function(){},g=function(e,t){return p.call(e,t)},O=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},m=Array.isArray||function(e){return"[object Array]"===y.call(e)},j=function(e){return"[object Function]"===y.call(e)},T=function(e,t){return b(e)&&g(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t)},_=function(e){return b(e)&&(g(e,"type")||["_vueTypes_name","validator","default","required"].some(function(t){return g(e,t)}))};function w(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function P(e,t,n){var r;void 0===n&&(n=!1);var i=!0,o="";r=b(e)?e:{type:e};var u=T(r)?r._vueTypes_name+" - ":"";if(_(r)&&null!==r.type){if(void 0===r.type||!0===r.type)return i;if(!r.required&&null==t)return i;m(r.type)?(i=r.type.some(function(e){return!0===P(e,t,!0)}),o=r.type.map(function(e){return v(e)}).join(" or ")):i="Array"===(o=v(r))?m(t):"Object"===o?b(t):"String"===o||"Number"===o||"Boolean"===o||"Function"===o?function(e){if(null==e)return"";var t=e.constructor.toString().match(d);return t?t[1].replace(/^Async/,""):""}(t)===o:t instanceof r.type}if(!i){var a=u+'value "'+t+'" should be of type "'+o+'"';return!1===n?(h(a),!1):a}if(g(r,"validator")&&j(r.validator)){var f=h,l=[];if(h=function(e){l.push(e)},i=r.validator(t),h=f,!i){var c=(l.length>1?"* ":"")+l.join("\n* ");return l.length=0,!1===n?(h(c),i):c}}return i}function k(e,t){var n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get:function(){return this.required=!0,this}},def:{value:function(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(g(this,"default")&&delete this.default,this):j(e)||!0===P(this,e,!0)?(this.default=m(e)?function(){return[].concat(e)}:b(e)?function(){return Object.assign({},e)}:e,this):(h(this._vueTypes_name+' - invalid default value: "'+e+'"'),this)}}}),r=n.validator;return j(r)&&(n.validator=w(r,n)),n}function x(e,t){var n=k(e,t);return Object.defineProperty(n,"validate",{value:function(e){return j(this.validator)&&h(this._vueTypes_name+" - calling .validate() will overwrite the current custom validator function. Validator info:\n"+JSON.stringify(this)),this.validator=w(e,this),this}})}function S(e,t,n){var r,i,o=(r=t,i={},Object.getOwnPropertyNames(r).forEach(function(e){i[e]=Object.getOwnPropertyDescriptor(r,e)}),Object.defineProperties({},i));if(o._vueTypes_name=e,!b(n))return o;var u,a,l=n.validator,s=f(n,c);if(j(l)){var y=o.validator;y&&(y=null!==(a=(u=y).__original)&&void 0!==a?a:u),o.validator=w(y?function(e){return y.call(this,e)&&l.call(this,e)}:l,o)}return Object.assign(o,s)}function A(e){return e.replace(/^(?!\s*$)/gm," ")}var q=function(){return x("any",{})},E=function(){return x("function",{type:Function})},V=function(){return x("boolean",{type:Boolean})},N=function(){return x("string",{type:String})},B=function(){return x("number",{type:Number})},F=function(){return x("array",{type:Array})},L=function(){return x("object",{type:Object})},D=function(){return k("integer",{type:Number,validator:function(e){var t=O(e);return!1===t&&h('integer - "'+e+'" is not an integer'),t}})},Y=function(){return k("symbol",{validator:function(e){var t="symbol"==typeof e;return!1===t&&h('symbol - invalid value "'+e+'"'),t}})},I=function(){return Object.defineProperty({type:null,validator:function(e){var t=null===e;return!1===t&&h("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"})};function J(e,t){if(void 0===t&&(t="custom validation failed"),"function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return k(e.name||"<<anonymous function>>",{type:null,validator:function(n){var r=e(n);return r||h(this._vueTypes_name+" - "+t),r}})}function M(e){if(!m(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");var t='oneOf - value should be one of "'+e.map(function(e){return"symbol"==typeof e?e.toString():e}).join('", "')+'".',n={validator:function(n){var r=-1!==e.indexOf(n);return r||h(t),r}};if(-1===e.indexOf(null)){var r=e.reduce(function(e,t){if(null!=t){var n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e},[]);r.length>0&&(n.type=r)}return k("oneOf",n)}function R(e){if(!m(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");for(var t=!1,n=!1,r=[],i=0;i<e.length;i+=1){var o=e[i];if(_(o)){if(j(o.validator)&&(t=!0),T(o,"oneOf")&&o.type){r=r.concat(o.type);continue}if(T(o,"nullable")){n=!0;continue}if(!0===o.type||!o.type){h('oneOfType - invalid usage of "true" and "null" as types.');continue}r=r.concat(o.type)}else r.push(o)}r=r.filter(function(e,t){return r.indexOf(e)===t});var u=!1===n&&r.length>0?r:null;return k("oneOfType",t?{type:u,validator:function(t){var n=[],r=e.some(function(e){var r=P(e,t,!0);return"string"==typeof r&&n.push(r),!0===r});return r||h("oneOfType - provided value does not match any of the "+n.length+" passed-in validators:\n"+A(n.join("\n"))),r}}:{type:u})}function U(e){return k("arrayOf",{type:Array,validator:function(t){var n="",r=t.every(function(t){return!0===(n=P(e,t,!0))});return r||h("arrayOf - value validation error:\n"+A(n)),r}})}function $(e){return k("instanceOf",{type:e})}function z(e){return k("objectOf",{type:Object,validator:function(t){var n="",r=Object.keys(t).every(function(r){return!0===(n=P(e,t[r],!0))});return r||h("objectOf - value validation error:\n"+A(n)),r}})}function C(e){var t=Object.keys(e),n=t.filter(function(t){var n;return!(null===(n=e[t])||void 0===n||!n.required)}),r=k("shape",{type:Object,validator:function(r){var i=this;if(!b(r))return!1;var o=Object.keys(r);if(n.length>0&&n.some(function(e){return-1===o.indexOf(e)})){var u=n.filter(function(e){return-1===o.indexOf(e)});return h(1===u.length?'shape - required property "'+u[0]+'" is not defined.':'shape - required properties "'+u.join('", "')+'" are not defined.'),!1}return o.every(function(n){if(-1===t.indexOf(n))return!0===i._vueTypes_isLoose||(h('shape - shape definition does not include a "'+n+'" property. Allowed keys: "'+t.join('", "')+'".'),!1);var o=P(e[n],r[n],!0);return"string"==typeof o&&h('shape - "'+n+'" property validation error:\n '+A(o)),!0===o})}});return Object.defineProperty(r,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(r,"loose",{get:function(){return this._vueTypes_isLoose=!0,this}}),r}var G=["name","validate","getter"],H=/*#__PURE__*/function(e){return e=/*#__PURE__*/function(){function e(){}return e.extend=function(e){var t=this;if(h("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),m(e))return e.forEach(function(e){return t.extend(e)}),this;var n=e.name,r=e.validate,i=void 0!==r&&r,o=e.getter,u=void 0!==o&&o,a=f(e,G);if(g(this,n))throw new TypeError('[VueTypes error]: Type "'+n+'" already defined');var l,c=a.type;return T(c)?(delete a.type,Object.defineProperty(this,n,u?{get:function(){return S(n,c,a)}}:{value:function(){var e,t=S(n,c,a);return t.validator&&(t.validator=(e=t.validator).bind.apply(e,[t].concat([].slice.call(arguments)))),t}})):(l=u?{get:function(){var e=Object.assign({},a);return i?x(n,e):k(n,e)},enumerable:!0}:{value:function(){var e,t,r=Object.assign({},a);return e=i?x(n,r):k(n,r),r.validator&&(e.validator=(t=r.validator).bind.apply(t,[e].concat([].slice.call(arguments)))),e},enumerable:!0},Object.defineProperty(this,n,l))},i(e,null,[{key:"any",get:function(){return q()}},{key:"func",get:function(){return E().def(this.defaults.func)}},{key:"bool",get:function(){return void 0===this.defaults.bool?V():V().def(this.defaults.bool)}},{key:"string",get:function(){return N().def(this.defaults.string)}},{key:"number",get:function(){return B().def(this.defaults.number)}},{key:"array",get:function(){return F().def(this.defaults.array)}},{key:"object",get:function(){return L().def(this.defaults.object)}},{key:"integer",get:function(){return D().def(this.defaults.integer)}},{key:"symbol",get:function(){return Y()}},{key:"nullable",get:function(){return I()}}])}(),e.defaults={},e.sensibleDefaults=void 0,e.config=l,e.custom=J,e.oneOf=M,e.instanceOf=$,e.oneOfType=R,e.arrayOf=U,e.objectOf=z,e.shape=C,e.utils={validate:function(e,t){return!0===P(t,e,!0)},toType:function(e,t,n){return void 0===n&&(n=!1),n?x(e,t):k(e,t)}},e}();function K(e){var t;return void 0===e&&(e={func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0}),t=/*#__PURE__*/function(t){function n(){return t.apply(this,arguments)||this}return u(n,t),i(n,null,[{key:"sensibleDefaults",get:function(){return o({},this.defaults)},set:function(t){this.defaults=!1!==t?o({},!0!==t?t:e):{}}}])}(H),t.defaults=o({},e),t}var Q=/*#__PURE__*/function(e){function t(){return e.apply(this,arguments)||this}return u(t,e),t}(K());e.any=q,e.array=F,e.arrayOf=U,e.bool=V,e.config=l,e.createTypes=K,e.custom=J,e.default=Q,e.fromType=S,e.func=E,e.instanceOf=$,e.integer=D,e.nullable=I,e.number=B,e.object=L,e.objectOf=z,e.oneOf=M,e.oneOfType=R,e.shape=C,e.string=N,e.symbol=Y,e.toType=k,e.toValidableType=x,e.validateType=P});
//# sourceMappingURL=vue-types.umd.js.map
{
"name": "vue-types",
"version": "0.0.0-20240502091121",
"version": "0.0.0-20240701051251",
"description": "Prop types utility for Vue",

@@ -25,2 +25,5 @@ "author": "Marco Solazzi",

},
"./dist/types": {
"types": "./dist/types.d.ts"
},
"./shim": {

@@ -56,3 +59,3 @@ "types": "./dist/shim.d.ts",

"@babel/plugin-proposal-optional-chaining": "7.21.0",
"@types/node": "20.12.7",
"@types/node": "20.14.2",
"babel-plugin-transform-node-env-inline": "0.4.3",

@@ -59,0 +62,0 @@ "cpy-cli": "5.0.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet