Comparing version 0.0.0-20240701051251 to 0.0.0-20241212014929
@@ -1,13 +0,70 @@ | ||
import { toType, toValidableType, validateType, fromType } from './utils'; | ||
import { VueTypesDefaults, ExtendProps, VueTypeDef, VueTypeValidableDef, VueTypeShape, VueTypeLooseShape } from './types'; | ||
import { PropOptions } from './types'; | ||
import { any, func, bool, string, number, array, integer, symbol, object, nullable } from './validators/native'; | ||
import custom from './validators/custom'; | ||
import oneOf from './validators/oneof'; | ||
import oneOfType from './validators/oneoftype'; | ||
import arrayOf from './validators/arrayof'; | ||
import instanceOf from './validators/instanceof'; | ||
import objectOf from './validators/objectof'; | ||
import shape from './validators/shape'; | ||
import { config } from './config'; | ||
import { P as PropOptions, V as VueTypeDef, a as VueTypeValidableDef, I as InferType, b as ValidatorFunction, c as VueProp, d as Prop, C as Constructor, e as VueTypeShape, f as VueTypesDefaults, g as VueTypesConfig } from './shared/vue-types.d8e57a80.js'; | ||
export { i as VueTypeLooseShape, h as config } from './shared/vue-types.d8e57a80.js'; | ||
import 'vue'; | ||
/** | ||
* Validates a given value against a prop type object. | ||
* | ||
* If `silent` is `false` (default) will return a boolean. If it is set to `true` | ||
* it will return `true` on success or a string error message on failure | ||
* | ||
* @param {Object|*} type - Type to use for validation. Either a type object or a constructor | ||
* @param {*} value - Value to check | ||
* @param {boolean} silent - Silence warnings | ||
*/ | ||
declare function validateType<T, U>(type: T, value: U, silent?: boolean): string | boolean; | ||
/** | ||
* Adds `isRequired` and `def` modifiers to an object | ||
* | ||
* @param {string} name - Type internal name | ||
* @param {object} obj - Object to enhance | ||
*/ | ||
declare function toType<T = any>(name: string, obj: PropOptions<T>): VueTypeDef<T>; | ||
/** | ||
* Like `toType` but also adds the `validate()` method to the type object | ||
* | ||
* @param {string} name - Type internal name | ||
* @param {object} obj - Object to enhance | ||
*/ | ||
declare function toValidableType<T = any>(name: string, obj: PropOptions<T>): VueTypeValidableDef<T>; | ||
/** | ||
* Return a new VueTypes type using another type as base. | ||
* | ||
* Properties in the `props` object will overwrite those defined in the source one | ||
* expect for the `validator` function. In that case both functions will be executed in series. | ||
* | ||
* @param name - Name of the new type | ||
* @param source - Source type | ||
* @param props - Custom type properties | ||
*/ | ||
declare function fromType<T extends VueTypeDef<any>>(name: string, source: T): T; | ||
declare function fromType<T extends VueTypeDef<any>, V extends PropOptions<InferType<T>>>(name: string, source: T, props: V): Omit<T, keyof V> & V; | ||
declare const any: <T = any>() => VueTypeValidableDef<T, ValidatorFunction<T>>; | ||
declare const func: <T extends (...args: any[]) => any>() => VueTypeValidableDef<T, ValidatorFunction<T>>; | ||
declare const bool: () => VueTypeValidableDef<boolean, ValidatorFunction<boolean>>; | ||
declare const string: <T extends string = string>() => VueTypeValidableDef<T, ValidatorFunction<T>>; | ||
declare const number: <T extends number = number>() => VueTypeValidableDef<T, ValidatorFunction<T>>; | ||
declare const array: <T>() => VueTypeValidableDef<T[], ValidatorFunction<T[]>>; | ||
declare const object: <T extends Record<string, any>>() => VueTypeValidableDef<T, ValidatorFunction<T>>; | ||
declare const integer: <T extends number = number>() => VueTypeDef<T>; | ||
declare const symbol: () => VueTypeDef<symbol>; | ||
declare const nullable: () => PropOptions<null>; | ||
declare function custom<T>(validatorFn: ValidatorFunction<T>, warnMsg?: string): VueTypeDef<T>; | ||
declare function oneOf<D, T extends readonly D[] = readonly D[]>(arr: T): VueTypeDef<T[number]>; | ||
declare function oneOfType<D extends V, U extends VueProp<any> | Prop<any> = any, V = InferType<U>>(arr: U[]): VueTypeDef<D>; | ||
declare function arrayOf<T extends VueProp<any> | Prop<any>>(type: T): VueTypeDef<InferType<T>[]>; | ||
declare function instanceOf<C extends Constructor>(instanceConstructor: C): VueTypeDef<InstanceType<C>>; | ||
declare function objectOf<T extends VueProp<any> | Prop<any>>(type: T): VueTypeDef<Record<string, InferType<T>>>; | ||
declare function shape<T extends object>(obj: { | ||
[K in keyof T]: Prop<T[K]> | VueProp<T[K]>; | ||
}): VueTypeShape<T>; | ||
declare function createTypes(defs?: Partial<VueTypesDefaults>): { | ||
@@ -17,18 +74,18 @@ new (): {}; | ||
sensibleDefaults: boolean | Partial<VueTypesDefaults>; | ||
config: import("./types").VueTypesConfig; | ||
readonly any: VueTypeValidableDef<any, import("./types").ValidatorFunction<any>>; | ||
readonly func: VueTypeValidableDef<(...args: any[]) => any, import("./types").ValidatorFunction<(...args: any[]) => any>> & { | ||
config: VueTypesConfig; | ||
readonly any: VueTypeValidableDef<any, ValidatorFunction<any>>; | ||
readonly func: VueTypeValidableDef<(...args: any[]) => any, ValidatorFunction<(...args: any[]) => any>> & { | ||
default: (...args: any[]) => any; | ||
}; | ||
readonly bool: VueTypeValidableDef<boolean, import("./types").ValidatorFunction<boolean>>; | ||
readonly string: VueTypeValidableDef<string, import("./types").ValidatorFunction<string>> & { | ||
readonly bool: VueTypeValidableDef<boolean, ValidatorFunction<boolean>>; | ||
readonly string: VueTypeValidableDef<string, ValidatorFunction<string>> & { | ||
default: string; | ||
}; | ||
readonly number: VueTypeValidableDef<number, import("./types").ValidatorFunction<number>> & { | ||
readonly number: VueTypeValidableDef<number, ValidatorFunction<number>> & { | ||
default: number; | ||
}; | ||
readonly array: VueTypeValidableDef<unknown[], import("./types").ValidatorFunction<unknown[]>> & { | ||
readonly array: VueTypeValidableDef<unknown[], ValidatorFunction<unknown[]>> & { | ||
default: () => unknown[]; | ||
}; | ||
readonly object: VueTypeValidableDef<Record<string, any>, import("./types").ValidatorFunction<Record<string, any>>> & { | ||
readonly object: VueTypeValidableDef<Record<string, any>, ValidatorFunction<Record<string, any>>> & { | ||
default: () => Record<string, any>; | ||
@@ -48,6 +105,6 @@ }; | ||
readonly shape: typeof shape; | ||
extend<T = any>(props: ExtendProps<any> | ExtendProps<any>[]): T; | ||
extend(...args: any[]): void; | ||
utils: { | ||
validate<T_1, U>(value: T_1, type: U): boolean; | ||
toType<T_2 = unknown>(name: string, obj: PropOptions<T_2, T_2>, validable?: boolean): VueTypeDef<T_2> | VueTypeValidableDef<T_2, import("./types").ValidatorFunction<T_2>>; | ||
validate<T, U>(value: T, type: U): boolean; | ||
toType<T = unknown, Validable extends boolean = false>(name: string, obj: PropOptions<T>, validable?: Validable): Validable extends true ? VueTypeValidableDef<T> : VueTypeDef<T>; | ||
}; | ||
@@ -59,18 +116,18 @@ }; | ||
sensibleDefaults: boolean | Partial<VueTypesDefaults>; | ||
config: import("./types").VueTypesConfig; | ||
readonly any: VueTypeValidableDef<any, import("./types").ValidatorFunction<any>>; | ||
readonly func: VueTypeValidableDef<(...args: any[]) => any, import("./types").ValidatorFunction<(...args: any[]) => any>> & { | ||
config: VueTypesConfig; | ||
readonly any: VueTypeValidableDef<any, ValidatorFunction<any>>; | ||
readonly func: VueTypeValidableDef<(...args: any[]) => any, ValidatorFunction<(...args: any[]) => any>> & { | ||
default: (...args: any[]) => any; | ||
}; | ||
readonly bool: VueTypeValidableDef<boolean, import("./types").ValidatorFunction<boolean>>; | ||
readonly string: VueTypeValidableDef<string, import("./types").ValidatorFunction<string>> & { | ||
readonly bool: VueTypeValidableDef<boolean, ValidatorFunction<boolean>>; | ||
readonly string: VueTypeValidableDef<string, ValidatorFunction<string>> & { | ||
default: string; | ||
}; | ||
readonly number: VueTypeValidableDef<number, import("./types").ValidatorFunction<number>> & { | ||
readonly number: VueTypeValidableDef<number, ValidatorFunction<number>> & { | ||
default: number; | ||
}; | ||
readonly array: VueTypeValidableDef<unknown[], import("./types").ValidatorFunction<unknown[]>> & { | ||
readonly array: VueTypeValidableDef<unknown[], ValidatorFunction<unknown[]>> & { | ||
default: () => unknown[]; | ||
}; | ||
readonly object: VueTypeValidableDef<Record<string, any>, import("./types").ValidatorFunction<Record<string, any>>> & { | ||
readonly object: VueTypeValidableDef<Record<string, any>, ValidatorFunction<Record<string, any>>> & { | ||
default: () => Record<string, any>; | ||
@@ -90,12 +147,13 @@ }; | ||
readonly shape: typeof shape; | ||
extend<T = any>(props: ExtendProps<any> | ExtendProps<any>[]): T; | ||
extend(...args: any[]): void; | ||
utils: { | ||
validate<T_1, U>(value: T_1, type: U): boolean; | ||
toType<T_2 = unknown>(name: string, obj: PropOptions<T_2, T_2>, validable?: boolean): VueTypeDef<T_2> | VueTypeValidableDef<T_2, import("./types").ValidatorFunction<T_2>>; | ||
validate<T, U>(value: T, type: U): boolean; | ||
toType<T = unknown, Validable extends boolean = false>(name: string, obj: PropOptions<T>, validable?: Validable): Validable extends true ? VueTypeValidableDef<T> : VueTypeDef<T>; | ||
}; | ||
}; | ||
export default class VueTypes/*#__PURE__*/ extends VueTypes_base { | ||
declare class VueTypes/*#__PURE__*/ extends VueTypes_base { | ||
} | ||
export { any, func, bool, string, number, array, integer, symbol, object, custom, oneOf, oneOfType, arrayOf, instanceOf, objectOf, shape, nullable, createTypes, toType, toValidableType, validateType, fromType, config, }; | ||
export type VueTypesInterface = ReturnType<typeof createTypes>; | ||
export type { VueTypeDef, VueTypeValidableDef, VueTypeShape, VueTypeLooseShape }; | ||
type VueTypesInterface = ReturnType<typeof createTypes>; | ||
export { VueTypeDef, VueTypeShape, VueTypeValidableDef, type VueTypesInterface, any, array, arrayOf, bool, createTypes, custom, VueTypes as default, fromType, func, instanceOf, integer, nullable, number, object, objectOf, oneOf, oneOfType, shape, string, symbol, toType, toValidableType, validateType }; |
@@ -1,31 +0,31 @@ | ||
import { config } from './config'; | ||
import type { VueTypesDefaults } from './types'; | ||
export type { VueTypeDef, VueTypeValidableDef } from './types'; | ||
export { config }; | ||
import { f as VueTypesDefaults, g as VueTypesConfig } from './shared/vue-types.d8e57a80.js'; | ||
export { V as VueTypeDef, a as VueTypeValidableDef, h as config } from './shared/vue-types.d8e57a80.js'; | ||
import 'vue'; | ||
type TypeShim = <T = any>(...args: any[]) => any; | ||
export declare const any: TypeShim; | ||
export declare const func: TypeShim; | ||
export declare const bool: () => any; | ||
export declare const string: TypeShim; | ||
export declare const number: TypeShim; | ||
export declare const array: TypeShim; | ||
export declare const object: TypeShim; | ||
export declare const symbol: () => any; | ||
export declare const integer: TypeShim; | ||
export declare const oneOf: TypeShim; | ||
export declare const custom: TypeShim; | ||
export declare const instanceOf: TypeShim; | ||
export declare const oneOfType: TypeShim; | ||
export declare const arrayOf: TypeShim; | ||
export declare const objectOf: TypeShim; | ||
export declare const shape: TypeShim; | ||
export declare const nullable: TypeShim; | ||
export declare function fromType(name: string, source: any, props?: any): any; | ||
export declare const toValidableType: <T>(name: string, props: any) => any; | ||
export declare const toType: <T>(name: string, props: any) => any; | ||
export declare function createTypes(defs?: Partial<VueTypesDefaults>): { | ||
declare const any: TypeShim; | ||
declare const func: TypeShim; | ||
declare const bool: () => any; | ||
declare const string: TypeShim; | ||
declare const number: TypeShim; | ||
declare const array: TypeShim; | ||
declare const object: TypeShim; | ||
declare const symbol: () => any; | ||
declare const integer: TypeShim; | ||
declare const oneOf: TypeShim; | ||
declare const custom: TypeShim; | ||
declare const instanceOf: TypeShim; | ||
declare const oneOfType: TypeShim; | ||
declare const arrayOf: TypeShim; | ||
declare const objectOf: TypeShim; | ||
declare const shape: TypeShim; | ||
declare const nullable: TypeShim; | ||
declare function fromType(name: string, source: any, props?: any): any; | ||
declare const toValidableType: <T>(name: string, props: any) => any; | ||
declare const toType: <T>(name: string, props: any) => any; | ||
declare function createTypes(defs?: Partial<VueTypesDefaults>): { | ||
new (): {}; | ||
defaults: Partial<VueTypesDefaults>; | ||
sensibleDefaults: boolean | Partial<VueTypesDefaults>; | ||
config: import("./types").VueTypesConfig; | ||
config: VueTypesConfig; | ||
readonly any: any; | ||
@@ -54,3 +54,3 @@ readonly func: any; | ||
}; | ||
export declare function validateType<T, U>(_type: T, _value: U, _silent?: boolean): string | boolean; | ||
declare function validateType<T, U>(_type: T, _value: U, _silent?: boolean): string | boolean; | ||
declare const VueTypes_base: { | ||
@@ -60,3 +60,3 @@ new (): {}; | ||
sensibleDefaults: boolean | Partial<VueTypesDefaults>; | ||
config: import("./types").VueTypesConfig; | ||
config: VueTypesConfig; | ||
readonly any: any; | ||
@@ -85,3 +85,5 @@ readonly func: any; | ||
}; | ||
export default class VueTypes/*#__PURE__*/ extends VueTypes_base { | ||
declare class VueTypes/*#__PURE__*/ extends VueTypes_base { | ||
} | ||
export { any, array, arrayOf, bool, createTypes, custom, VueTypes as default, fromType, func, instanceOf, integer, nullable, number, object, objectOf, oneOf, oneOfType, shape, string, symbol, toType, toValidableType, validateType }; |
@@ -1,2 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("is-plain-object")):"function"==typeof define&&define.amd?define(["exports","is-plain-object"],e):e((t||self).VueTypes={},t.isPlainObject)}(this,function(t,e){function n(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}function r(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function u(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}var f={silent:!1,logLevel:"warn"},c=Object.defineProperty,a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function l(t,n,r){void 0===n&&(n={}),void 0===r&&(r=!1);var i={_vueTypes_name:{value:t,writable:!0},def:{value:function(t){return void 0===t?("default"in this&&delete this.default,this):(this.default=a(t)?function(){return[].concat(t)}:e.isPlainObject(t)?function(){return Object.assign({},t)}:t,this)}},isRequired:{get:function(){return this.required=!0,this}}};return r&&(i.validate={value:function(){}}),n.validator||(n.validator=function(){return!0}),Object.defineProperties(n,i)}var s=function(){return l("any",{},!0)},y=function(){return l("func",{type:Function},!0)},d=function(){return l("bool",{type:Boolean},!0)},p=function(){return l("string",{type:String},!0)},b=function(){return l("number",{type:Number},!0)},v=function(){return l("array",{type:Array},!0)},g=function(){return l("object",{type:Object},!0)},O=function(){return l("symbol")},j=function(){return l("integer",{type:Number})},h=function(t){return l("oneOf")},m=function(t){return l("custom")},T=function(t){return l("instanceOf",{type:t})},k=function(t){return l("oneOfType")},P=function(t){return l("arrayOf",{type:Array})},w=function(t){return l("objectOf",{type:Object})},_=function(t){return c(l("shape",{type:Object}),"loose",{get:function(){return this}})};function x(t,e,n,r,i){var u;void 0===r&&(r=!1),void 0===i&&(i=!1);var o=((u={})[r?"get":"value"]=function(){return l(e,Object.assign({},n),i).def(r?t.defaults[e]:void 0)},u);return c(t,e,o)}var A=/*#__PURE__*/function(t){return t=/*#__PURE__*/function(){function t(){}return t.extend=function(t){var n=this;if(a(t))return t.forEach(function(t){return n.extend(t)}),this;var r=t.validate,i=t.getter,u=void 0!==i&&i,o=t.type,f=void 0===o?null:o;return x(this,t.name,{type:e.isPlainObject(f)&&f.type?null:f},u,!!r)},i(t,null,[{key:"any",get:function(){return s()}},{key:"func",get:function(){return y().def(this.defaults.func)}},{key:"bool",get:function(){return d().def(this.defaults.bool)}},{key:"string",get:function(){return p().def(this.defaults.string)}},{key:"number",get:function(){return b().def(this.defaults.number)}},{key:"array",get:function(){return v().def(this.defaults.array)}},{key:"object",get:function(){return g().def(this.defaults.object)}},{key:"symbol",get:function(){return O()}},{key:"integer",get:function(){return j().def(this.defaults.integer)}},{key:"nullable",get:function(){return{type:null}}}])}(),t.defaults={},t.sensibleDefaults=void 0,t.config=f,t.oneOf=h,t.custom=m,t.instanceOf=T,t.oneOfType=k,t.arrayOf=P,t.objectOf=w,t.shape=_,t.utils={toType:l,validate:function(){return!![].slice.call(arguments)}},t}();function S(t){var e;return void 0===t&&(t={func:function(){},bool:!0,string:"",number:0,array:function(){return[]},object:function(){return{}},integer:0}),e=/*#__PURE__*/function(e){function n(){return e.apply(this,arguments)||this}return u(n,e),i(n,null,[{key:"sensibleDefaults",get:function(){return Object.assign({},this.defaults)},set:function(e){this.defaults=!1!==e?Object.assign({},!0!==e?e:t):{}}}])}(A),e.defaults=Object.assign({},t),e}var q=/*#__PURE__*/function(t){function e(){return t.apply(this,arguments)||this}return u(e,t),e}(S());t.any=s,t.array=v,t.arrayOf=P,t.bool=d,t.config=f,t.createTypes=S,t.custom=m,t.default=q,t.fromType=function(t,e,n){void 0===n&&(n={});var r=l(t,Object.assign({},e,n),!!e.validable);return r.validator&&delete r.validator,r},t.func=y,t.instanceOf=T,t.integer=j,t.nullable=function(){return{type:null}},t.number=b,t.object=g,t.objectOf=w,t.oneOf=h,t.oneOfType=k,t.shape=_,t.string=p,t.symbol=O,t.toType=function(t,e){return l(t,e)},t.toValidableType=function(t,e){return l(t,e,!0)},t.validateType=function(t,e,n){return!0}}); | ||
//# sourceMappingURL=shim.umd.js.map | ||
(function(n,l){typeof exports=="object"&&typeof module!="undefined"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(n=typeof globalThis!="undefined"?globalThis:n||self,l(n.VueTypes={}))})(void 0,function(n){"use strict";function l(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}const q=()=>({func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}),c={silent:!1,logLevel:"warn"};var C=Object.defineProperty,R=(e,t,r)=>t in e?C(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,i=(e,t,r)=>(R(e,typeof t!="symbol"?t+"":t,r),r);const f=Object.defineProperty,d=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function y(e){return"structuredClone"in globalThis?structuredClone(e):Array.isArray(e)?[...e]:l(e)?Object.assign({},e):e}function a(e,t={},r=!1){const u={_vueTypes_name:{value:e,writable:!0},def:{value(s){const o=this;return s===void 0?("default"in this&&delete this.default,this):(d(s)?o.default=()=>y(s):l(s)?o.default=()=>y(s):o.default=s,o)}},isRequired:{get(){return this.required=!0,this}}};return r&&(u.validate={value(){}}),t.validator||(t.validator=()=>!0),Object.defineProperties(t,u)}const b=()=>a("any",{},!0),g=()=>a("func",{type:Function},!0),p=()=>a("bool",{type:Boolean},!0),O=()=>a("string",{type:String},!0),h=()=>a("number",{type:Number},!0),j=()=>a("array",{type:Array},!0),m=()=>a("object",{type:Object},!0),v=()=>a("symbol"),T=()=>a("integer",{type:Number}),A=e=>a("oneOf"),P=e=>a("custom"),w=e=>a("instanceOf",{type:e}),V=e=>a("oneOfType"),D=e=>a("arrayOf",{type:Array}),S=e=>a("objectOf",{type:Object}),_=e=>f(a("shape",{type:Object}),"loose",{get(){return this}}),N=()=>({type:null});function k(e,t,r,u=!1,s=!1){const o={[u?"get":"value"]:()=>a(t,Object.assign({},r),s).def(u?e.defaults[t]:void 0)};return f(e,t,o)}function B(e,t,r={}){const u=a(e,Object.assign({},t,r),!!t.validable);return u.validator&&delete u.validator,u}const F=(e,t)=>a(e,t,!0),L=(e,t)=>a(e,t),M=(()=>{var e;return e=class{static get any(){return b()}static get func(){return g().def(this.defaults.func)}static get bool(){return p().def(this.defaults.bool)}static get string(){return O().def(this.defaults.string)}static get number(){return h().def(this.defaults.number)}static get array(){return j().def(this.defaults.array)}static get object(){return m().def(this.defaults.object)}static get symbol(){return v()}static get integer(){return T().def(this.defaults.integer)}static get nullable(){return N()}static extend(t){if(d(t))return t.forEach(H=>this.extend(H)),this;const{name:r,validate:u,getter:s=!1,type:o=null}=t,G=l(o)&&o.type?null:o;return k(this,r,{type:G},s,!!u)}},i(e,"defaults",{}),i(e,"sensibleDefaults"),i(e,"config",c),i(e,"oneOf",A),i(e,"custom",P),i(e,"instanceOf",w),i(e,"oneOfType",V),i(e,"arrayOf",D),i(e,"objectOf",S),i(e,"shape",_),i(e,"utils",{toType:a,validate:(...t)=>!!t}),e})();function E(e=q()){var t;return t=class extends M{static get sensibleDefaults(){return Object.assign({},this.defaults)}static set sensibleDefaults(r){if(r===!1){this.defaults={};return}if(r===!0){this.defaults=Object.assign({},e);return}this.defaults=Object.assign({},r)}},i(t,"defaults",Object.assign({},e)),t}function Y(e,t,r=!1){return!0}process.env.NODE_ENV!=="production"&&c.silent===!1&&console.warn("You are using the production shimmed version of VueTypes in a development build. Refer to https://dwightjack.github.io/vue-types/guide/installation.html#production-build to learn how to configure VueTypes for usage in multiple environments.");class z extends E(){}n.any=b,n.array=j,n.arrayOf=D,n.bool=p,n.config=c,n.createTypes=E,n.custom=P,n.default=z,n.fromType=B,n.func=g,n.instanceOf=w,n.integer=T,n.nullable=N,n.number=h,n.object=m,n.objectOf=S,n.oneOf=A,n.oneOfType=V,n.shape=_,n.string=O,n.symbol=v,n.toType=L,n.toValidableType=F,n.validateType=Y,Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"name": "vue-types", | ||
"version": "0.0.0-20240701051251", | ||
"version": "0.0.0-20241212014929", | ||
"description": "Prop types utility for Vue", | ||
@@ -8,26 +8,29 @@ "author": "Marco Solazzi", | ||
"homepage": "https://dwightjack.github.io/vue-types/", | ||
"main": "dist/vue-types.cjs", | ||
"main": "dist/index.cjs", | ||
"type": "module", | ||
"source": [ | ||
"src/index.ts", | ||
"src/shim.ts" | ||
], | ||
"amdName": "VueTypes", | ||
"unpkg": "dist/vue-types.umd.js", | ||
"umd:main": "dist/vue-types.umd.js", | ||
"module": "dist/vue-types.m.js", | ||
"esmodule": "dist/vue-types.modern.js", | ||
"sideEffects": false, | ||
"unpkg": "dist/index.umd.js", | ||
"umd:main": "dist/index.umd.js", | ||
"module": "dist/index.mjs", | ||
"esmodule": "dist/index.mjs", | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"require": "./dist/vue-types.cjs", | ||
"import": "./dist/vue-types.modern.js" | ||
"require": { | ||
"types": "./dist/index.d.cts", | ||
"default": "./dist/index.cjs" | ||
}, | ||
"import": { | ||
"types": "./dist/index.d.mts", | ||
"default": "./dist/index.mjs" | ||
} | ||
}, | ||
"./dist/types": { | ||
"types": "./dist/types.d.ts" | ||
}, | ||
"./shim": { | ||
"types": "./dist/shim.d.ts", | ||
"require": "./shim/index.cjs.js", | ||
"import": "./shim/index.modern.js" | ||
"require": { | ||
"types": "./dist/shim.d.cts", | ||
"default": "./dist/shim.cjs" | ||
}, | ||
"import": { | ||
"types": "./dist/shim.d.mts", | ||
"default": "./dist/shim.mjs" | ||
} | ||
} | ||
@@ -54,19 +57,9 @@ }, | ||
"peerDependencies": { | ||
"vue": "^2.0.0 || ^3.0.0" | ||
"vue": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6", | ||
"@babel/plugin-proposal-optional-chaining": "7.21.0", | ||
"@types/node": "20.14.2", | ||
"babel-plugin-transform-node-env-inline": "0.4.3", | ||
"cpy-cli": "5.0.0", | ||
"cross-env": "7.0.3", | ||
"del": "7.1.0", | ||
"del-cli": "5.1.0", | ||
"microbundle": "0.15.1", | ||
"typescript": "5.4.5" | ||
"@types/node": "20.17.6", | ||
"typescript": "5.6.3", | ||
"unbuild": "2.0.0" | ||
}, | ||
"dependencies": { | ||
"is-plain-object": "5.0.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
@@ -78,16 +71,9 @@ "vue": { | ||
"scripts": { | ||
"build": "pnpm run \"/^clean:.*/\" && pnpm run copy && pnpm run \"/^build:.*/\"", | ||
"clean:dist": "del dist", | ||
"clean:shim": "del \"shim/*.*\" \"!shim/package.json\"", | ||
"copy": "cpy --flat src/*.d.ts dist", | ||
"build:ts": "microbundle --tsconfig=./tsconfig.build.json --format=modern,es", | ||
"build:cjs": "microbundle --tsconfig=./tsconfig.build.json -i src/index.cjs.ts -o dist/vue-types.cjs --no-pkg-main --format=cjs", | ||
"build:umd": "cross-env NODE_ENV=production microbundle --tsconfig=./tsconfig.build.json --format=umd", | ||
"build:shim:ts": "microbundle --tsconfig=./tsconfig.build.json -i src/shim.ts -o shim/index.js --format=modern,es --no-sourcemap", | ||
"build:shim:cjs": "microbundle --tsconfig=./tsconfig.build.json -i src/shim.cjs.ts -o shim/index.cjs.js --no-pkg-main --format=cjs --no-sourcemap", | ||
"build:shim:umd": "cross-env NODE_ENV=production microbundle --tsconfig=./tsconfig.build.json -i src/shim.cjs.ts -o shim/index.js --format=umd --no-sourcemap", | ||
"build": "unbuild", | ||
"test": "vitest run --coverage", | ||
"test:watch": "vitest watch", | ||
"lint": "eslint '{src,__tests__,.}/**/*.{ts,js,cjs}'" | ||
"lint": "pnpm run \"/^lint:.*/\"", | ||
"lint:type": "tsc --noEmit --skipLibCheck", | ||
"lint:js": "eslint '{src,__tests__,.}/**/*.{ts,js,cjs}'" | ||
} | ||
} |
{ | ||
"name": "vue-types-shim", | ||
"main": "index.cjs.js", | ||
"unpkg": "index.umd.js", | ||
"umd:main": "index.umd.js", | ||
"module": "index.m.js", | ||
"esmodule": "index.modern.js", | ||
"types": "../dist/shim.d.ts", | ||
"peerDependencies": { | ||
"vue": "^2.0.0 || ^3.0.0" | ||
}, | ||
"dependencies": { | ||
"is-plain-object": "5.0.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
"vue": { | ||
"optional": true | ||
} | ||
} | ||
"main": "../dist/shim.cjs", | ||
"unpkg": "../dist/shim.umd.js", | ||
"umd:main": "../dist/shim.umd.js", | ||
"module": "../dist/shim.mjs", | ||
"esmodule": "../dist/shim.mjs", | ||
"types": "../dist/shim.d.ts" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
1
3
1966
1
4
228221
26
1
- Removedis-plain-object@5.0.0
- Removedis-plain-object@5.0.0(transitive)