Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gubu

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gubu - npm Package Compare versions

Comparing version 7.0.0 to 7.1.0

104

gubu.d.ts

@@ -145,3 +145,3 @@ declare const GUBU: {

declare function make<S>(intop?: S | Node<S>, inopts?: GubuOptions): {
<V>(root?: V | undefined, ctx?: Context): V & S;
<V>(root?: V, ctx?: Context): V & S;
valid: <V_1>(root?: V_1 | undefined, ctx?: Context) => root is V_1 & S;

@@ -166,13 +166,13 @@ match(root?: any, ctx?: Context): boolean;

declare function truncate(str?: string, len?: number): string;
declare const Required: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Open: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Optional: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Any: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Fault: <V>(this: any, msg: string, shape?: V | Node<V> | undefined) => Node<V>;
declare const Skip: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Ignore: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Func: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Default: <V>(this: any, dval?: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Empty: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Never: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Required: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const Open: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const Optional: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const Any: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const Fault: <V>(this: any, msg: string, shape?: Node<V> | V) => Node<V>;
declare const Skip: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const Ignore: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const Func: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const Default: <V>(this: any, dval?: any, shape?: Node<V> | V) => Node<V>;
declare const Empty: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const Never: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const Key: (this: any, depth?: number | Function, join?: string) => Node<unknown>;

@@ -183,16 +183,16 @@ declare const All: (this: any, ...inshapes: any[]) => Node<unknown>;

declare const Exact: (this: any, ...vals: any[]) => Node<unknown>;
declare const Before: <V>(this: any, validate: Validate, shape?: V | Node<V> | undefined) => Node<V>;
declare const After: <V>(this: any, validate: Validate, shape?: V | Node<V> | undefined) => Node<V>;
declare const Check: <V>(this: any, check: Validate | RegExp | string, shape?: V | Node<V> | undefined) => Node<V>;
declare const Closed: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Define: <V>(this: any, inopts: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Refer: <V>(this: any, inopts: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Rename: <V>(this: any, inopts: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Min: <V>(this: any, min: number | string, shape?: V | Node<V> | undefined) => Node<V>;
declare const Max: <V>(this: any, max: number | string, shape?: V | Node<V> | undefined) => Node<V>;
declare const Above: <V>(this: any, above: number | string, shape?: V | Node<V> | undefined) => Node<V>;
declare const Below: <V>(this: any, below: number | string, shape?: V | Node<V> | undefined) => Node<V>;
declare const Len: <V>(this: any, len: number, shape?: V | Node<V> | undefined) => Node<V>;
declare const Child: <V>(this: any, child?: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Rest: <V>(this: any, child?: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const Before: <V>(this: any, validate: Validate, shape?: Node<V> | V) => Node<V>;
declare const After: <V>(this: any, validate: Validate, shape?: Node<V> | V) => Node<V>;
declare const Check: <V>(this: any, check: Validate | RegExp | string, shape?: Node<V> | V) => Node<V>;
declare const Closed: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const Define: <V>(this: any, inopts: any, shape?: Node<V> | V) => Node<V>;
declare const Refer: <V>(this: any, inopts: any, shape?: Node<V> | V) => Node<V>;
declare const Rename: <V>(this: any, inopts: any, shape?: Node<V> | V) => Node<V>;
declare const Min: <V>(this: any, min: number | string, shape?: Node<V> | V) => Node<V>;
declare const Max: <V>(this: any, max: number | string, shape?: Node<V> | V) => Node<V>;
declare const Above: <V>(this: any, above: number | string, shape?: Node<V> | V) => Node<V>;
declare const Below: <V>(this: any, below: number | string, shape?: Node<V> | V) => Node<V>;
declare const Len: <V>(this: any, len: number, shape?: Node<V> | V) => Node<V>;
declare const Child: <V>(this: any, child?: any, shape?: Node<V> | V) => Node<V>;
declare const Rest: <V>(this: any, child?: any, shape?: Node<V> | V) => Node<V>;
declare function buildize<V>(node0?: any, node1?: any): Node<V>;

@@ -203,3 +203,3 @@ declare function makeErr(state: State, text?: string, why?: string, user?: any): ErrDesc;

declare const BuilderMap: {
Above: <V>(this: any, above: number | string, shape?: V | Node<V> | undefined) => Node<V>;
Above: <V>(this: any, above: number | string, shape?: Node<V> | V) => Node<V>;
After: <V_1>(this: any, validate: Validate, shape?: V_1 | Node<V_1> | undefined) => Node<V_1>;

@@ -255,31 +255,31 @@ All: (this: any, ...inshapes: any[]) => Node<unknown>;

declare const Gubu: Gubu;
declare const GAbove: <V>(this: any, above: number | string, shape?: V | Node<V> | undefined) => Node<V>;
declare const GAfter: <V>(this: any, validate: Validate, shape?: V | Node<V> | undefined) => Node<V>;
declare const GAbove: <V>(this: any, above: number | string, shape?: Node<V> | V) => Node<V>;
declare const GAfter: <V>(this: any, validate: Validate, shape?: Node<V> | V) => Node<V>;
declare const GAll: (this: any, ...inshapes: any[]) => Node<unknown>;
declare const GAny: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GBefore: <V>(this: any, validate: Validate, shape?: V | Node<V> | undefined) => Node<V>;
declare const GBelow: <V>(this: any, below: number | string, shape?: V | Node<V> | undefined) => Node<V>;
declare const GCheck: <V>(this: any, check: Validate | RegExp | string, shape?: V | Node<V> | undefined) => Node<V>;
declare const GChild: <V>(this: any, child?: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GRest: <V>(this: any, child?: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GClosed: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GDefault: <V>(this: any, dval?: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GDefine: <V>(this: any, inopts: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GEmpty: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GAny: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const GBefore: <V>(this: any, validate: Validate, shape?: Node<V> | V) => Node<V>;
declare const GBelow: <V>(this: any, below: number | string, shape?: Node<V> | V) => Node<V>;
declare const GCheck: <V>(this: any, check: Validate | RegExp | string, shape?: Node<V> | V) => Node<V>;
declare const GChild: <V>(this: any, child?: any, shape?: Node<V> | V) => Node<V>;
declare const GRest: <V>(this: any, child?: any, shape?: Node<V> | V) => Node<V>;
declare const GClosed: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const GDefault: <V>(this: any, dval?: any, shape?: Node<V> | V) => Node<V>;
declare const GDefine: <V>(this: any, inopts: any, shape?: Node<V> | V) => Node<V>;
declare const GEmpty: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const GExact: (this: any, ...vals: any[]) => Node<unknown>;
declare const GFault: <V>(this: any, msg: string, shape?: V | Node<V> | undefined) => Node<V>;
declare const GFunc: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GIgnore: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GFault: <V>(this: any, msg: string, shape?: Node<V> | V) => Node<V>;
declare const GFunc: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const GIgnore: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const GKey: (this: any, depth?: number | Function, join?: string) => Node<unknown>;
declare const GLen: <V>(this: any, len: number, shape?: V | Node<V> | undefined) => Node<V>;
declare const GMax: <V>(this: any, max: number | string, shape?: V | Node<V> | undefined) => Node<V>;
declare const GMin: <V>(this: any, min: number | string, shape?: V | Node<V> | undefined) => Node<V>;
declare const GNever: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GLen: <V>(this: any, len: number, shape?: Node<V> | V) => Node<V>;
declare const GMax: <V>(this: any, max: number | string, shape?: Node<V> | V) => Node<V>;
declare const GMin: <V>(this: any, min: number | string, shape?: Node<V> | V) => Node<V>;
declare const GNever: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const GOne: (this: any, ...inshapes: any[]) => Node<unknown>;
declare const GOpen: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GOptional: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GRefer: <V>(this: any, inopts: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GRename: <V>(this: any, inopts: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GRequired: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GSkip: <V>(this: any, shape?: V | Node<V> | undefined) => Node<V>;
declare const GOpen: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const GOptional: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const GRefer: <V>(this: any, inopts: any, shape?: Node<V> | V) => Node<V>;
declare const GRename: <V>(this: any, inopts: any, shape?: Node<V> | V) => Node<V>;
declare const GRequired: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const GSkip: <V>(this: any, shape?: Node<V> | V) => Node<V>;
declare const GSome: (this: any, ...inshapes: any[]) => Node<unknown>;

@@ -286,0 +286,0 @@ type args = any[] | IArguments;

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

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Gubu=e()}}((function(){var e={},t={};Object.defineProperty(t,"__esModule",{value:!0}),t.Gubu=void 0;const n=Symbol.for("gubu$"),r={gubu$:n,v$:"7.0.0"},l=Symbol.for("gubu$nil"),i=/^[A-Z]/,{toString:o}=Object.prototype,s="gubu",u="name",a="nan",c="never",f="number",p="required",h="array",v="function",d="object",g="string",y="boolean",m="undefined",b="any",$="list",x="instance",I="null",k="type",j="closed",w="shape",O="check",N="regexp",S="Object",V="Array",R="Function",A="Value",D="Above",E="All",C="Below",G="Max",T="Min",B="Len",M="One",L="Some",P=" for property ",F='"$PATH"',z='"$VALUE"',q=e=>Object.keys(e),W=(e,t,n)=>Object.defineProperty(e,t,n),_=e=>Array.isArray(e),J=e=>JSON.parse(e),H=(e,t)=>JSON.stringify(e,t);class U{constructor(e,t,n,r){this.match=!1,this.dI=0,this.nI=2,this.cI=-1,this.pI=0,this.sI=-1,this.valType=c,this.isRoot=!1,this.key="",this.type=c,this.stop=!0,this.nextSibling=!0,this.fromDflt=!1,this.ignoreVal=void 0,this.curerr=[],this.err=[],this.parents=[],this.keys=[],this.path=[],this.root=e,this.vals=[e,-1],this.node=t,this.nodes=[t,-1],this.ctx=n||{},this.match=!!r}next(){this.stop=!1,this.fromDflt=!1,this.ignoreVal=void 0,this.isRoot=0===this.pI,this.check=void 0;let e=this.nodes[this.pI];for(;+e;)this.dI--,this.ctx.log&&-1<this.dI&&this.ctx.log("e"+(_(this.parents[this.pI])?"a":"o"),this),this.pI=+e,e=this.nodes[this.pI];e?(this.node=e,this.updateVal(this.vals[this.pI]),this.key=this.keys[this.pI],this.cI=this.pI,this.sI=this.pI+1,this.parent=this.parents[this.pI],this.nextSibling=!0,this.type=this.node.t,this.path[this.dI]=this.key,this.oval=this.val,this.curerr.length=0):this.stop=!0}updateVal(e){this.val=e,this.valType=typeof this.val,f===this.valType&&isNaN(this.val)&&(this.valType=a),this.isRoot&&!this.match&&(this.root=this.val)}}class K extends TypeError{constructor(e,t,n,r){var l;super((t=null==t?"":t+": ")+n.map(e=>e.t).join("\n")),this.gubu=!0,this.name="GubuError",this.code=e,this.prefix=t,this.desc=()=>({name:"GubuError",code:e,err:n,ctx:r}),this.stack=null===(l=this.stack)||void 0===l?void 0:l.replace(/.*\/gubu\/gubu\.[tj]s.*\n/g,""),this.props=n.map(e=>{var t;return{path:e.p,what:e.w,type:null===(t=e.n)||void 0===t?void 0:t.t,value:e.v}})}toJSON(){return Object.assign(Object.assign({},this),{err:this.desc().err,name:this.name,message:this.message})}}const Z={String:!0,Number:!0,Boolean:!0,Object:!0,Array:!0,Function:!0,Symbol:!0,BigInt:!0},Q={string:"",number:0,boolean:!1,object:{},array:[],symbol:Symbol(""),bigint:BigInt(0),null:null,regexp:/.*/};function X(e,t,s){var u,c,p,y;if(Y===e)e=void 0;else if(null!=e&&(null===(u=e.$)||void 0===u?void 0:u.gubu$)){if(n===e.$.gubu$)return e.d=null==t?e.d:t,e;if(!0===e.$.gubu$){let r=Object.assign({},e);return r.$=Object.assign(Object.assign({v$:"7.0.0"},r.$),{gubu$:n}),r.v=null!=r.v&&d===typeof r.v?Object.assign({},r.v):r.v,r.t=r.t||typeof r.v,v===r.t&&Z[r.v.name]&&(r.t=r.v.name.toLowerCase(),r.v=Pe(Q[r.t]),r.f=r.v),r.r=!!r.r,r.p=!!r.p,r.d=null==t?null==r.d?-1:r.d:t,r.b=r.b||[],r.a=r.a||[],r.u=r.u||{},r.m=r.m||s||{},r}}let $=null===e?I:typeof e;$=m===$?b:$;let k=e,j=k,w=l,O=!1,V={},A=[],D=[];if(d===$)j=void 0,_(k)?($=h,1===k.length&&(w=k[0],k=[])):null!=k&&Function!==k.constructor&&Object!==k.constructor&&null!=k.constructor?("[object RegExp]"===o.call(k)?($=N,O=!0):($=x,V.n=k.constructor.name,V.i=k.constructor),j=k):0===q(k).length&&(w=ue());else if(v===$)if(Z[e.name])$=e.name.toLowerCase(),O=!0,k=Pe(Q[$]),j=k,S===e.name&&(w=ue());else if(k.gubu===r||!0===(null===(c=k.$)||void 0===c?void 0:c.gubu)){let e=k.node?k.node():k;$=e.t,k=e.v,j=k,O=e.r,V=Object.assign({},e.u),A=[...e.a],D=[...e.b]}else R===k.constructor.name&&i.test(k.name)&&($=x,O=!0,V.n=null===(y=null===(p=k.prototype)||void 0===p?void 0:p.constructor)||void 0===y?void 0:y.name,V.i=k);else f===$&&isNaN(k)?$=a:g===$&&""===k&&(V.empty=!0);let E=null==k||d!==$&&h!==$?k:Object.assign({},k);return{$:r,t:$,v:E,f:j,n:null!=E&&d===typeof E?q(E).length:0,c:w,r:O,p:!1,d:null==t?-1:t,k:[],e:!0,u:V,a:A,b:D,m:s||{}}}function Y(t,i){const o=null==i?{}:i;o.name=null==o.name?"G"+(""+Math.random()).substring(2,8):""+o.name,o.prefix=null==o.prefix?void 0:o.prefix;let s=o.meta=o.meta||{};s.active=!0===s.active||!1,s.suffix=g==typeof s.suffix?s.suffix:"$$";let u=o.keyexpr=o.keyexpr||{};u.active=!1!==u.active;let a=X(t,0);function f(e,t,n){let r=new U(e,a,t,n);for(;r.next(),!r.stop;){let t=r.node,n=!1,i=!1;if(0<t.b.length)for(let e=0;e<t.b.length;e++){let l=te(t.b[e],r);t=r.node,void 0!==l.done&&(n=l.done),i=i||!!l.fatal}if(!n){let n=!0,i=void 0===r.val;if(c===r.type)r.curerr.push(Be(c,r,1070));else if(d===r.type){let e;if(t.r&&i?(r.ignoreVal=!0,r.curerr.push(Be(p,r,1010))):i||null!==r.val&&d===r.valType&&!_(r.val)?!t.p&&i&&void 0!==t.f?(r.updateVal(t.f),r.fromDflt=!0,e=r.val,n=!1):t.p&&i||(r.updateVal(r.val||(r.fromDflt=!0,{})),e=r.val):(r.curerr.push(Be(k,r,1020)),e=_(r.val)?r.val:{}),n&&(e=null==e&&!1===r.ctx.err?{}:e,null!=e)){r.ctx.log&&r.ctx.log("so",r);let n=!1,i=q(t.v),o=r.nI;if(0<i.length){n=!0,r.pI=o;for(let n=0;n<i.length;n++){let l,o=i[n];if(s.active&&o.endsWith(s.suffix)){if(l={short:""},g===typeof t.v[o]?l.short=t.v[o]:l=Object.assign(Object.assign({},l),t.v[o]),delete t.v[o],n++,i.length<=n)break;if(i[n]!==o.substring(0,o.length-s.suffix.length))throw new Error("Invalid meta key: "+o);o=i[n]}let a=o,c=t.v[o];if(u.active){let e=/^\s*("(\\.|[^"\\])*"|[^\s]+):\s*(.*?)\s*$/.exec(o);e&&(a=e[1],c=ee({src:e[3],val:c}),delete t.v[o])}let f=X(c,1+r.dI,l);t.v[a]=f,t.k.includes(a)||t.k.push(a),r.nodes[r.nI]=f,r.vals[r.nI]=e[a],r.parents[r.nI]=e,r.keys[r.nI]=a,r.nI++}}let a=q(e).filter(e=>void 0===t.v[e]);if(0<a.length)if(l===t.c)r.ignoreVal=!0,r.curerr.push(Be(j,r,1100,void 0,{k:a}));else{n=!0,r.pI=o;for(let n of a){let l=t.c=X(t.c,1+r.dI);r.nodes[r.nI]=l,r.vals[r.nI]=e[n],r.parents[r.nI]=e,r.keys[r.nI]=n,r.nI++}}n?(r.dI++,r.nodes[r.nI]=r.sI,r.parents[r.nI]=e,r.nextSibling=!1,r.nI++):r.ctx.log&&r.ctx.log("eo",r)}}else if(h===r.type)if(t.r&&i)r.ignoreVal=!0,r.curerr.push(Be(p,r,1030));else if(i||_(r.val)){if(!t.p&&i&&void 0!==t.f)r.updateVal(t.f),r.fromDflt=!0;else if(!t.p||null!=r.val){r.updateVal(r.val||(r.fromDflt=!0,[]));let n=l!==t.c,i=0<r.val.length,o=q(t.v).filter(e=>!isNaN(+e)),s=0<o.length;if(r.ctx.log&&r.ctx.log("sa",r),i||s){r.pI=r.nI;let e=0;if(s)if(o.length<r.val.length&&!n)r.ignoreVal=!0,r.curerr.push(Be(j,r,1090,void 0,{k:o.length}));else for(;e<o.length;e++){let n=t.v[e]=X(t.v[e],1+r.dI);r.nodes[r.nI]=n,r.vals[r.nI]=r.val[e],r.parents[r.nI]=r.val,r.keys[r.nI]=""+e,r.nI++}if(n&&i){let n=t.c=X(t.c,1+r.dI);for(;e<r.val.length;e++)r.nodes[r.nI]=n,r.vals[r.nI]=r.val[e],r.parents[r.nI]=r.val,r.keys[r.nI]=""+e,r.nI++}r.ignoreVal||(r.dI++,r.nodes[r.nI]=r.sI,r.parents[r.nI]=r.val,r.nextSibling=!1,r.nI++)}else r.ctx.log&&n&&null==e&&r.ctx.log("kv",Object.assign(Object.assign({},r),{key:0,val:t.c})),r.ctx.log&&r.ctx.log("ea",r)}}else r.curerr.push(Be(k,r,1040));else if(N===r.type)i&&!t.r?r.ignoreVal=!0:g!==r.valType?(r.ignoreVal=!0,r.curerr.push(Be(k,r,1045))):r.val.match(t.v)||(r.ignoreVal=!0,r.curerr.push(Be(N,r,1045)));else if(b===r.type||$===r.type||void 0===r.val||r.type===r.valType||x===r.type&&t.u.i&&r.val instanceof t.u.i||I===r.type&&null===r.val)if(void 0===r.val){let e=r.path[r.dI];!t.r||m===r.type&&r.parent.hasOwnProperty(e)?void 0!==t.f&&!t.p||m===r.type?(r.updateVal(t.f),r.fromDflt=!0):b===r.type&&(r.ignoreVal=void 0===r.ignoreVal||r.ignoreVal):(r.ignoreVal=!0,r.curerr.push(Be(p,r,1060))),r.ctx.log&&r.ctx.log("kv",r)}else g!==r.type||""!==r.val||t.u.empty||r.curerr.push(Be(p,r,1080)),r.ctx.log&&r.ctx.log("kv",r);else r.curerr.push(Be(k,r,1050))}if(0<t.a.length)for(let e=0;e<t.a.length;e++){let l=te(t.a[e],r);t=r.node,void 0!==l.done&&(n=l.done),i=i||!!l.fatal}let o=r.node.p?!1!==r.ignoreVal:!!r.ignoreVal;!r.match&&null!=r.parent&&!n&&!o&&(r.parent[r.key]=r.val),r.nextSibling&&(r.pI=r.sI),(r.node.e||i)&&r.err.push(...r.curerr)}if(0<r.err.length)if(_(r.ctx.err))r.ctx.err.push(...r.err);else if(!r.match&&!1!==r.ctx.err)throw new K(w,o.prefix,r.err,r.ctx);return r.match?0===r.err.length:r.root}function v(e,t){return f(e,t,!1)}v.valid=function(e,t){let n=t||{};return n.err=n.err||[],f(e,n,!1),0===n.err.length},v.match=(e,t)=>f(e,t=t||{},!0),v.error=(e,t)=>{let n=t||{};return n.err=n.err||[],f(e,n,!1),n.err},v.spec=()=>(v(void 0,{err:!1}),J(Le(a,(e,t)=>n===t||t,!1,!0))),v.node=()=>(v.spec(),a),v.stringify=e=>{let t=null==e?a:e.node&&e.node();return t=null==t||!t.$||n!==t.$.gubu$&&!0!==t.$.gubu$?t:t.v,qe.stringify(t)};let y="";return v.toString=()=>(y=le(""===y?Le(null==a||!a.$||n!==a.$.gubu$&&!0!==a.$.gubu$?a:a.v):y),`[Gubu ${o.name} ${y}]`),e.inspect&&e.inspect.custom&&(v[e.inspect.custom]=v.toString),v.gubu=r,v.spec(),v}function ee(e){let t=!1;if(null==e.tokens){t=!0,e.tokens=[];let n=/\s*,?\s*([)(\.]|"(\\.|[^"\\])*"|\/(\\.|[^\/\\])*\/[a-z]?|[^)(,\s]+)\s*/g,r=null;for(;r=n.exec(e.src);)e.tokens.push(r[1])}e.i=e.i||0;let n=e.tokens[e.i],r=ze[n];if(")"===e.tokens[e.i])return e.i++,e.val;e.i++;let l={Number:Number,String:String,Boolean:Boolean};if(null==r)try{return l[n]||(m===n?void 0:"NaN"===n?NaN:n.match(/^\/.+\/$/)?new RegExp(n.substring(1,n.length-1)):J(n))}catch(s){throw new SyntaxError(`Gubu: unexpected token ${n} in builder expression ${e.src}`)}"("===e.tokens[e.i]&&e.i++;let i=[],o=null;for(;null!=(o=e.tokens[e.i])&&")"!==o;){let t=ee(e);i.push(t)}return e.i++,e.val=r.call(e.val,...i),"."===e.tokens[e.i]?(e.i++,ee(e)):t&&e.i<e.tokens.length?ee(e):e.val}function te(e,t){var n;let r,l={},i=!1;try{i=!(void 0!==t.val||!(null===(n=e.gubu$)||void 0===n?void 0:n.Check))||(t.check=e,e(t.val,l,t))}catch(s){r=s}let o=_(l.err)?0<l.err.length:null!=l.err;if(!i||o){if(void 0===t.val&&(t.node.p||!t.node.r)&&!0!==l.done)return delete l.err,l;let n=l.why||O,i=ne(t);if(g===typeof l.err)t.curerr.push(Te(t,l.err));else if(d===typeof l.err)t.curerr.push(...[l.err].flat().filter(e=>null!=e).map(e=>(e.p=null==e.p?i:e.p,e.m=null==e.m?2010:e.m,e)));else{let l=e.name;null!=l&&""!=l||(l=le(e.toString().replace(/[ \t\r\n]+/g," "))),t.curerr.push(Be(n,t,1045,void 0,{thrown:r},l))}l.done=null==l.done||l.done}return l.hasOwnProperty("uval")?(t.updateVal(l.uval),t.ignoreVal=!1):void 0===l.val||Number.isNaN(l.val)||(t.updateVal(l.val),t.ignoreVal=!1),void 0!==l.node&&(t.node=l.node),void 0!==l.type&&(t.type=l.type),l}function ne(e){return e.path.slice(1,e.dI+1).filter(e=>null!=e).join(".")}function re(e){return f===typeof e?e:f===typeof(null==e?void 0:e.length)?e.length:null!=e&&d===typeof e?q(e).length:NaN}function le(e,t){let n=String(e),r=null==t||isNaN(t)?30:t<0?0:~~t,l=null==e?0:n.length,i=null==e?"":n.substring(0,l);return i=r<l?i.substring(0,r-3)+"...":i,i.substring(0,r)}const ie=function(e){let t=Ge(this,e);return t.r=!0,t.p=!1,void 0===e&&1===arguments.length&&(t.t=m,t.v=void 0),t},oe=function(e){let t=Ge(this,e);return t.c=ue(),t},se=function(e){let t=Ge(this,e);return t.r=!1,void 0===e&&1===arguments.length&&(t.t=m,t.v=void 0),t},ue=function(e){let t=Ge(this,e);return t.t=b,void 0!==e&&(t.v=e,t.f=e),t},ae=function(e,t){let n=Ge(this,t);return n.z=e,n},ce=function(e){let t=Ge(this,e);return t.r=!1,t.p=!0,t},fe=function(e){let t=Ge(this,e);return t.r=!1,t.p=!0,t.e=!1,t.a.push((function(e,t,n){return 0<n.curerr.length&&(t.uval=void 0,t.done=!1),!0})),t},pe=function(e){let t=Ge(this);return t.t=v,t.v=e,t.f=e,t},he=function(e,t){let n=Ge(this,void 0===t?e:t);return n.r=!1,n.f=e,v===typeof e&&Z[e.name]&&(n.t=e.name.toLowerCase(),n.f=Pe(Q[n.t])),n.p=!1,n},ve=function(e){let t=Ge(this,e);return t.u.empty=!0,t},de=function(e){let t=Ge(this,e);return t.t=c,t},ge=function(e,t){let n=Ge(this),r=f===typeof e;n.t=g,r&&null==t&&(n=X([]));let l=null;return v===typeof e&&(l=e,n=ue()),n.b.push((function(n,i,o){if(l)i.val=l(o.path,o);else if(r){let n=e;i.val=o.path.slice(o.path.length-1-(0<=n?n:0),o.path.length-1+(0<=n?0:1)),g===typeof t&&(i.val=i.val.join(t))}else null==e&&(i.val=o.path[o.path.length-2]);return!0})),n},ye=function(...e){let t=Ge();t.t=$,t.r=!0;let n=e.map(e=>qe(e));return t.u.list=e,t.b.push((function(t,r,l){let i=!0;for(let e of n){let n=Object.assign(Object.assign({},l.ctx),{err:[]});e(t,n),0<n.err.length&&(i=!1)}return i||(r.why=E,r.err=[Te(l,A+" "+z+P+F+" does not satisfy all of: "+e.map(e=>Le(e,null,!0)).join(", "))]),i})),t},me=function(...e){let t=Ge();t.t=$,t.r=!0;let n=e.map(e=>qe(e));return t.u.list=e,t.b.push((function(t,r,l){let i=!1;for(let e of n){let n=Object.assign(Object.assign({},l.ctx),{err:[]}),o=e.match(t,n);o&&(r.val=e(t,n)),i||(i=o)}return i||(r.why=L,r.err=[Te(l,A+" "+z+P+F+" does not satisfy any of: "+e.map(e=>Le(e,null,!0)).join(", "))]),i})),t},be=function(...e){let t=Ge();t.t=$,t.r=!0;let n=e.map(e=>qe(e));return t.u.list=e,t.b.push((function(t,r,l){let i=0;for(let e of n){let n=Object.assign(Object.assign({},l.ctx),{err:[]});if(e.match(t,n)){i++,r.val=e(t,n);break}}return 1!==i&&(r.why=M,r.err=[Te(l,A+" "+z+P+F+" does not satisfy one of: "+e.map(e=>Le(e,null,!0)).join(", "))]),!0})),t},$e=function(...e){let t=Ge();return t.b.push((function(t,n,r){for(let l=0;l<e.length;l++)if(t===e[l])return!0;if(r.node.hasOwnProperty("f")&&void 0===t){const t=r.node.f;for(let n=0;n<e.length;n++)if(t===e[n])return!0}return n.err=Te(r,A+" "+z+P+F+" must be exactly one of: "+r.node.s+"."),n.done=!0,!1})),t.s=e.map(e=>Le(e,null,!0)).join(", "),t},xe=function(e,t){let n=Ge(this,t);return n.b.push(e),n},Ie=function(e,t){let n=Ge(this,t);return n.a.push(e),n},ke=function(e,t){let n=Ge(this,t);if(v===typeof e){let t=e;t.gubu$=t.gubu$||{},t.gubu$.Check=!0,n.b.push(e),n.s=(null==n.s?"":n.s+";")+Le(e,null,!0),n.r=!0}else if(d===typeof e){if(Object.prototype.toString.call(e).includes("RegExp")){let t=t=>null!=t&&!Number.isNaN(t)&&!!String(t).match(e);W(t,u,{value:String(e)}),W(t,"gubu$",{value:{Check:!0}}),n.b.push(t),n.s=Le(e),n.r=!0}}else g===typeof e&&(n.t=e,n.r=!0);return n},je=function(e){let t=Ge(this,e);return h===t.t&&l!==t.c&&0===t.n?(t.v=[t.c],t.c=l):t.c=l,t},we=function(e,t){let n=Ge(this,t),r=g===typeof e?e:(d===typeof e&&e||{}).name;return null!=r&&""!=r&&n.b.push((function(e,t,n){return(n.ctx.ref=n.ctx.ref||{})[r]=n.node,!0})),n},Oe=function(e,t){let n=Ge(this,t),r=d===typeof e&&e||{},l=g===typeof e?e:r.name,i=!!r.fill;return null!=l&&""!=l&&n.b.push((function(e,t,n){if(void 0!==e||i){let e=n.ctx.ref=n.ctx.ref||{};if(void 0!==e[l]){let n=Object.assign({},e[l]);n.t=n.t||c,t.node=n,t.type=n.t}}return!0})),n},Ne=function(e,t){let n=Ge(this,t),r=d===typeof e&&e||{},l=g===typeof e?e:r.name,i=y===typeof r.keep?r.keep:void 0,o=_(r.claim)?r.claim:[];if(null!=l&&""!=l){let e=(e,t,n)=>{if(void 0===e&&0<o.length){n.ctx.Rename=n.ctx.Rename||{},n.ctx.Rename.fromDflt=n.ctx.Rename.fromDflt||{};for(let e of o){let r=n.ctx.Rename.fromDflt[e]||{};if(void 0!==n.parent[e]&&!r.yes){t.val=n.parent[e],n.match||(n.parent[l]=t.val),t.node=r.node;for(let e=0;e<n.err.length;e++)n.err[e].k===r.key&&(n.err.splice(e,1),e--);if(i){let t=n.cI+1;n.nodes.splice(t,0,X(r.dval)),n.vals.splice(t,0,void 0),n.parents.splice(t,0,n.parent),n.keys.splice(t,0,e),n.nI++,n.pI++}else delete n.parent[e];break}}void 0===t.val&&(t.val=n.node.v)}return!0};W(e,u,{value:"Rename:"+l}),n.b.push(e);let t=(e,t,n)=>(n.parent[l]=e,n.match||i||n.key===l||_(n.parent)&&!1!==i||(delete n.parent[n.key],t.done=!0),n.ctx.Rename=n.ctx.Rename||{},n.ctx.Rename.fromDflt=n.ctx.Rename.fromDflt||{},n.ctx.Rename.fromDflt[l]={yes:n.fromDflt,key:n.key,dval:n.node.v,node:n.node},!0);W(t,u,{value:"Rename:"+l}),n.a.push(t)}return n},Se=function(e,t){let n=Ge(this,t);return n.b.push((function(t,n,r){let l=re(t);if(e<=l)return!0;r.checkargs={min:1};let i=f===typeof t?"":"length ";return n.err=Te(r,A+" "+z+P+F+` must be a minimum ${i}of ${e} (was ${l}).`),!1})),n.s=T+"("+e+(null==t?"":","+Le(t))+")",n},Ve=function(e,t){let n=Ge(this,t);return n.b.push((function(t,n,r){let l=re(t);if(l<=e)return!0;let i=f===typeof t?"":"length ";return n.err=Te(r,A+" "+z+P+F+` must be a maximum ${i}of ${e} (was ${l}).`),!1})),n.s=G+"("+e+(null==t?"":","+Le(t))+")",n},Re=function(e,t){let n=Ge(this,t);return n.b.push((function(t,n,r){let l=re(t);if(e<l)return!0;let i=f===typeof t?"be":"have length";return n.err=Te(r,A+" "+z+P+F+` must ${i} above ${e} (was ${l}).`),!1})),n.s=D+"("+e+(null==t?"":","+Le(t))+")",n},Ae=function(e,t){let n=Ge(this,t);return n.b.push((function(t,n,r){let l=re(t);if(l<e)return!0;let i=f===typeof t?"be":"have length";return n.err=Te(r,A+" "+z+P+F+` must ${i} below ${e} (was ${l}).`),!1})),n.s=C+"("+e+(null==t?"":","+Le(t))+")",n},De=function(e,t){let n=Ge(this,t||ue());return n.b.push((function(t,n,r){let l=re(t);if(e===l)return!0;let i=f===typeof t?"":" in length";return n.err=Te(r,A+" "+z+P+F+` must be exactly ${e}${i} (was ${l}).`),!1})),n.s=B+"("+e+(null==t?"":","+Le(t))+")",n},Ee=function(e,t){let n=Ge(this,t||{});return n.c=X(e),n},Ce=function(e,t){let n=Ge(this,t||[]);return n.t="array",n.c=X(e),n.m=n.m||{},n.m.rest=!0,n};function Ge(e,t){let n=X(null==e||e.window===e||e.global===e?t:e);return Object.assign(n,{Above:Re,After:Ie,Any:ue,Before:xe,Below:Ae,Check:ke,Child:Ee,Closed:je,Default:he,Define:we,Empty:ve,Exact:$e,Fault:ae,Ignore:fe,Len:De,Max:Ve,Min:Se,Never:de,Open:oe,Refer:Oe,Rename:Ne,Required:ie,Rest:Ce,Skip:ce})}function Te(e,t,n,r){return Be(n||O,e,4e3,t,r)}function Be(e,t,n,r,l,i){var o;let s={k:t.key,n:t.node,v:t.val,p:ne(t),w:e,c:(null===(o=t.check)||void 0===o?void 0:o.name)||"none",a:t.checkargs||{},m:n,t:"",u:l||{}},u=le((void 0===t.val?m:Le(t.val)).replace(/"/g,""));if(null==(r=r||t.node.z)||""===r){let n=u.startsWith("[")?h:u.startsWith("{")?d:null==t.val||f===typeof t.val&&isNaN(t.val)?"value":typeof t.val,r=u.startsWith("[")||_(t.parents[t.pI])?"index":"property",o="is",a=null==l?void 0:l.k;a=_(a)?(r=1<a.length?(o="are","properties"):r,a.join(", ")):a,s.t="Validation failed for "+(0<s.p.length?`${r} "${s.p}" with `:"")+`${n} "${u}" because `+(k===e?x===t.node.t?`the ${n} is not an instance of ${t.node.u.n}`:`the ${n} is not of type ${N===t.node.t?g:t.node.t}`:p===e?""===t.val?"an empty string is not allowed":`the ${n} is required`:"closed"===e?`the ${r} "${a}" ${o} not allowed`:N===e?"the string did not match "+t.node.v:c===e?"no value is allowed":`check "${null==i?e:i}" failed`)+(s.u.thrown?" (threw: "+s.u.thrown.message+")":".")}else s.t=r.replace(/\$VALUE/g,u).replace(/\$PATH/g,s.p);return s}function Me(e){return null!=e.s&&""!==e.s?e.s:e.r||void 0===e.v?e.t:"function"==typeof e.v.constructor?e.v:e.v.toString()}function Le(e,t,r,l){let i;l||!e||!e.$||n!==e.$.gubu$&&!0!==e.$.gubu$||(e=Me(e));try{i=H(e,(e,r)=>{var i,s;if(t&&(r=t(e,r)),null!=r&&d===typeof r&&r.constructor&&S!==r.constructor.name&&V!==r.constructor.name)r="[object RegExp]"===o.call(r)||v===typeof r.toString?r.toString():r.constructor.name;else if(v===typeof r)r=v===typeof Y[r.name]&&isNaN(+e)?void 0:null!=r.name&&""!==r.name?r.name:le(r.toString().replace(/[ \t\r\n]+/g," "));else if("bigint"==typeof r)r=String(r.toString());else{if(Number.isNaN(r))return"NaN";!0===l||!0!==(null===(i=null==r?void 0:r.$)||void 0===i?void 0:i.gubu$)&&n!==(null===(s=null==r?void 0:r.$)||void 0===s?void 0:s.gubu$)||(r=Me(r))}return r}),i=String(i)}catch(s){i=H(String(e))}return!0===r&&(i=i.replace(/^"/,"").replace(/"$/,"")),i}function Pe(e){return null==e||d!==typeof e?e:J(H(e))}const Fe=e=>X(Object.assign(Object.assign({},e),{$:{gubu$:!0}})),ze={Above:Re,After:Ie,All:ye,Any:ue,Before:xe,Below:Ae,Check:ke,Child:Ee,Closed:je,Default:he,Define:we,Empty:ve,Exact:$e,Fault:ae,Func:pe,Ignore:fe,Key:ge,Len:De,Max:Ve,Min:Se,Never:de,One:be,Open:oe,Optional:se,Refer:Oe,Rename:Ne,Required:ie,Skip:ce,Some:me,Rest:Ce};if(m!==typeof window)for(let Je in ze)W(ze[Je],u,{value:Je});Object.assign(Y,Object.assign(Object.assign(Object.assign({Gubu:Y},ze),Object.entries(ze).reduce((e,t)=>(e["G"+t[0]]=t[1],e),{})),{isShape:e=>e&&r===e.gubu,G$:Fe,buildize:Ge,makeErr:Te,stringify:Le,truncate:le,nodize:X,expr:ee,MakeArgu:We})),W(Y,u,{value:s});const qe=Y;t.Gubu=qe;function We(e){return function(t,n,r){let l=!1;g===typeof t&&(l=!0,r=n,n=t);const i=qe(r=r||n,{prefix:e+(n=g===typeof n?" ("+n+")":"")}),o=i.node(),s=o.k;let u=t,a={},c=0,f=0;for(;c<s.length;c++){let e=o.v[s[c]];e.p&&(e=o.v[s[c]]=(t=>Ie((function(e,n,r){if(0<r.curerr.length){f++;for(let e=s.length-1;e>t;e--)o.v[s[e]].m.rest?a[s[e]].splice(o.v[s[e]].m.rest_pos+t-e,0,a[s[e-1]]):(r.vals[r.pI+e-t]=r.vals[r.pI+e-t-1],a[s[e]]=a[s[e-1]]);n.uval=void 0,n.done=!1}return!0}),e))(c),e.e=!1),c!==s.length-1||o.v[s[c]].m.rest||(o.v[s[c]]=Ie((function(e,t,n){return!(s.length-f<u.length&&(0===n.curerr.length&&(t.err=`Too many arguments for type signature (was ${u.length}, expected ${s.length-f})`),t.fatal=!0,1))}),o.v[s[c]]))}function p(e){for(let t=0;t<s.length;t++){let n=o.v[s[t]];n.m.rest?(a[s[t]]=[...e].slice(t),n.m.rest_pos=a[s[t]].length):a[s[t]]=e[t]}return a}return l?function(e){return u=e,a={},c=0,f=0,i(p(e))}:i(p(t))}}const{Gubu:_e}=t;return _e}));
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Gubu=e()}}((function(){var e={},t={};Object.defineProperty(t,"__esModule",{value:!0}),t.Gubu=void 0;const n=Symbol.for("gubu$"),r={gubu$:n,v$:"7.1.0"},l=Symbol.for("gubu$nil"),i=/^[A-Z]/,{toString:o}=Object.prototype,s="gubu",u="name",a="nan",c="never",f="number",p="required",h="array",v="function",d="object",g="string",y="boolean",b="undefined",m="any",$="list",x="instance",I="null",k="type",j="closed",O="shape",w="check",N="regexp",S="Object",V="Array",R="Function",A="Value",D="Above",E="All",C="Below",G="Max",T="Min",B="Len",M="One",L="Some",F=" for property ",P='"$PATH"',z='"$VALUE"',q=e=>Object.keys(e),W=(e,t,n)=>Object.defineProperty(e,t,n),_=e=>Array.isArray(e),J=e=>JSON.parse(e),H=(e,t)=>JSON.stringify(e,t);class U{constructor(e,t,n,r){this.match=!1,this.dI=0,this.nI=2,this.cI=-1,this.pI=0,this.sI=-1,this.valType=c,this.isRoot=!1,this.key="",this.type=c,this.stop=!0,this.nextSibling=!0,this.fromDflt=!1,this.ignoreVal=void 0,this.curerr=[],this.err=[],this.parents=[],this.keys=[],this.path=[],this.root=e,this.vals=[e,-1],this.node=t,this.nodes=[t,-1],this.ctx=n||{},this.match=!!r}next(){this.stop=!1,this.fromDflt=!1,this.ignoreVal=void 0,this.isRoot=0===this.pI,this.check=void 0;let e=this.nodes[this.pI];for(;+e;)this.dI--,this.ctx.log&&-1<this.dI&&this.ctx.log("e"+(_(this.parents[this.pI])?"a":"o"),this),this.pI=+e,e=this.nodes[this.pI];e?(this.node=e,this.updateVal(this.vals[this.pI]),this.key=this.keys[this.pI],this.cI=this.pI,this.sI=this.pI+1,Object.isFrozen(this.parents[this.pI])&&(this.parents[this.pI]=Object.assign({},this.parents[this.pI])),this.parent=this.parents[this.pI],this.nextSibling=!0,this.type=this.node.t,this.path[this.dI]=this.key,this.oval=this.val,this.curerr.length=0):this.stop=!0}updateVal(e){this.val=e,this.valType=typeof this.val,f===this.valType&&isNaN(this.val)&&(this.valType=a),this.isRoot&&!this.match&&(this.root=this.val)}}class K extends TypeError{constructor(e,t,n,r){var l;super((t=null==t?"":t+": ")+n.map(e=>e.t).join("\n")),this.gubu=!0,this.name="GubuError",this.code=e,this.prefix=t,this.desc=()=>({name:"GubuError",code:e,err:n,ctx:r}),this.stack=null===(l=this.stack)||void 0===l?void 0:l.replace(/.*\/gubu\/gubu\.[tj]s.*\n/g,""),this.props=n.map(e=>{var t;return{path:e.p,what:e.w,type:null===(t=e.n)||void 0===t?void 0:t.t,value:e.v}})}toJSON(){return Object.assign(Object.assign({},this),{err:this.desc().err,name:this.name,message:this.message})}}const Z={String:!0,Number:!0,Boolean:!0,Object:!0,Array:!0,Function:!0,Symbol:!0,BigInt:!0},Q={string:"",number:0,boolean:!1,object:{},array:[],symbol:Symbol(""),bigint:BigInt(0),null:null,regexp:/.*/};function X(e,t,s){var u,c,p,y;if(Y===e)e=void 0;else if(null!=e&&(null===(u=e.$)||void 0===u?void 0:u.gubu$)){if(n===e.$.gubu$)return e.d=null==t?e.d:t,e;if(!0===e.$.gubu$){let r=Object.assign({},e);return r.$=Object.assign(Object.assign({v$:"7.1.0"},r.$),{gubu$:n}),r.v=null!=r.v&&d===typeof r.v?Object.assign({},r.v):r.v,r.t=r.t||typeof r.v,v===r.t&&Z[r.v.name]&&(r.t=r.v.name.toLowerCase(),r.v=Fe(Q[r.t]),r.f=r.v),r.r=!!r.r,r.p=!!r.p,r.d=null==t?null==r.d?-1:r.d:t,r.b=r.b||[],r.a=r.a||[],r.u=r.u||{},r.m=r.m||s||{},r}}let $=null===e?I:typeof e;$=b===$?m:$;let k=e,j=k,O=l,w=!1,V={},A=[],D=[];if(d===$)j=void 0,_(k)?($=h,1===k.length&&(O=k[0],k=[])):null!=k&&Function!==k.constructor&&Object!==k.constructor&&null!=k.constructor?("[object RegExp]"===o.call(k)?($=N,w=!0):($=x,V.n=k.constructor.name,V.i=k.constructor),j=k):0===q(k).length&&(O=ue());else if(v===$)if(Z[e.name])$=e.name.toLowerCase(),w=!0,k=Fe(Q[$]),j=k,S===e.name&&(O=ue());else if(k.gubu===r||!0===(null===(c=k.$)||void 0===c?void 0:c.gubu)){let e=k.node?k.node():k;$=e.t,k=e.v,j=k,w=e.r,V=Object.assign({},e.u),A=[...e.a],D=[...e.b]}else R===k.constructor.name&&i.test(k.name)&&($=x,w=!0,V.n=null===(y=null===(p=k.prototype)||void 0===p?void 0:p.constructor)||void 0===y?void 0:y.name,V.i=k);else f===$&&isNaN(k)?$=a:g===$&&""===k&&(V.empty=!0);let E=null==k||d!==$&&h!==$?k:Object.assign({},k);return{$:r,t:$,v:E,f:j,n:null!=E&&d===typeof E?q(E).length:0,c:O,r:w,p:!1,d:null==t?-1:t,k:[],e:!0,u:V,a:A,b:D,m:s||{}}}function Y(t,i){const o=null==i?{}:i;o.name=null==o.name?"G"+(""+Math.random()).substring(2,8):""+o.name,o.prefix=null==o.prefix?void 0:o.prefix;let s=o.meta=o.meta||{};s.active=!0===s.active||!1,s.suffix=g==typeof s.suffix?s.suffix:"$$";let u=o.keyexpr=o.keyexpr||{};u.active=!1!==u.active;let a=X(t,0);function f(e,t,n){let r=new U(e,a,t,n);for(;r.next(),!r.stop;){let t=r.node,n=!1,i=!1;if(0<t.b.length)for(let e=0;e<t.b.length;e++){let l=te(t.b[e],r);t=r.node,void 0!==l.done&&(n=l.done),i=i||!!l.fatal}if(!n){let n=!0,i=void 0===r.val;if(c===r.type)r.curerr.push(Be(c,r,1070));else if(d===r.type){let e;if(t.r&&i?(r.ignoreVal=!0,r.curerr.push(Be(p,r,1010))):i||null!==r.val&&d===r.valType&&!_(r.val)?!t.p&&i&&void 0!==t.f?(r.updateVal(t.f),r.fromDflt=!0,e=r.val,n=!1):t.p&&i||(r.updateVal(r.val||(r.fromDflt=!0,{})),e=r.val):(r.curerr.push(Be(k,r,1020)),e=_(r.val)?r.val:{}),n&&(e=null==e&&!1===r.ctx.err?{}:e,null!=e)){r.ctx.log&&r.ctx.log("so",r);let n=!1,i=q(t.v),o=r.nI;if(0<i.length){n=!0,r.pI=o;for(let n=0;n<i.length;n++){let l,o=i[n];if(s.active&&o.endsWith(s.suffix)){if(l={short:""},g===typeof t.v[o]?l.short=t.v[o]:l=Object.assign(Object.assign({},l),t.v[o]),delete t.v[o],n++,i.length<=n)break;if(i[n]!==o.substring(0,o.length-s.suffix.length))throw new Error("Invalid meta key: "+o);o=i[n]}let a=o,c=t.v[o];if(u.active){let e=/^\s*("(\\.|[^"\\])*"|[^\s]+):\s*(.*?)\s*$/.exec(o);e&&(a=e[1],c=ee({src:e[3],val:c}),delete t.v[o])}let f=X(c,1+r.dI,l);t.v[a]=f,t.k.includes(a)||t.k.push(a),r.nodes[r.nI]=f,r.vals[r.nI]=e[a],r.parents[r.nI]=e,r.keys[r.nI]=a,r.nI++}}let a=q(e).filter(e=>void 0===t.v[e]);if(0<a.length)if(l===t.c)r.ignoreVal=!0,r.curerr.push(Be(j,r,1100,void 0,{k:a}));else{n=!0,r.pI=o;for(let n of a){let l=t.c=X(t.c,1+r.dI);r.nodes[r.nI]=l,r.vals[r.nI]=e[n],r.parents[r.nI]=e,r.keys[r.nI]=n,r.nI++}}n?(r.dI++,r.nodes[r.nI]=r.sI,r.parents[r.nI]=e,r.nextSibling=!1,r.nI++):r.ctx.log&&r.ctx.log("eo",r)}}else if(h===r.type)if(t.r&&i)r.ignoreVal=!0,r.curerr.push(Be(p,r,1030));else if(i||_(r.val)){if(!t.p&&i&&void 0!==t.f)r.updateVal(t.f),r.fromDflt=!0;else if(!t.p||null!=r.val){r.updateVal(r.val||(r.fromDflt=!0,[]));let n=l!==t.c,i=0<r.val.length,o=q(t.v).filter(e=>!isNaN(+e)),s=0<o.length;if(r.ctx.log&&r.ctx.log("sa",r),i||s){r.pI=r.nI;let e=0;if(s)if(o.length<r.val.length&&!n)r.ignoreVal=!0,r.curerr.push(Be(j,r,1090,void 0,{k:o.length}));else for(;e<o.length;e++){let n=t.v[e]=X(t.v[e],1+r.dI);r.nodes[r.nI]=n,r.vals[r.nI]=r.val[e],r.parents[r.nI]=r.val,r.keys[r.nI]=""+e,r.nI++}if(n&&i){let n=t.c=X(t.c,1+r.dI);for(;e<r.val.length;e++)r.nodes[r.nI]=n,r.vals[r.nI]=r.val[e],r.parents[r.nI]=r.val,r.keys[r.nI]=""+e,r.nI++}r.ignoreVal||(r.dI++,r.nodes[r.nI]=r.sI,r.parents[r.nI]=r.val,r.nextSibling=!1,r.nI++)}else r.ctx.log&&n&&null==e&&r.ctx.log("kv",Object.assign(Object.assign({},r),{key:0,val:t.c})),r.ctx.log&&r.ctx.log("ea",r)}}else r.curerr.push(Be(k,r,1040));else if(N===r.type)i&&!t.r?r.ignoreVal=!0:g!==r.valType?(r.ignoreVal=!0,r.curerr.push(Be(k,r,1045))):r.val.match(t.v)||(r.ignoreVal=!0,r.curerr.push(Be(N,r,1045)));else if(m===r.type||$===r.type||void 0===r.val||r.type===r.valType||x===r.type&&t.u.i&&r.val instanceof t.u.i||I===r.type&&null===r.val)if(void 0===r.val){let e=r.path[r.dI];!t.r||b===r.type&&r.parent.hasOwnProperty(e)?void 0!==t.f&&!t.p||b===r.type?(r.updateVal(t.f),r.fromDflt=!0):m===r.type&&(r.ignoreVal=void 0===r.ignoreVal||r.ignoreVal):(r.ignoreVal=!0,r.curerr.push(Be(p,r,1060))),r.ctx.log&&r.ctx.log("kv",r)}else g!==r.type||""!==r.val||t.u.empty||r.curerr.push(Be(p,r,1080)),r.ctx.log&&r.ctx.log("kv",r);else r.curerr.push(Be(k,r,1050))}if(0<t.a.length)for(let e=0;e<t.a.length;e++){let l=te(t.a[e],r);t=r.node,void 0!==l.done&&(n=l.done),i=i||!!l.fatal}let o=r.node.p?!1!==r.ignoreVal:!!r.ignoreVal;!r.match&&null!=r.parent&&!n&&!o&&(r.parent[r.key]=r.val),r.nextSibling&&(r.pI=r.sI),(r.node.e||i)&&r.err.push(...r.curerr)}if(0<r.err.length)if(_(r.ctx.err))r.ctx.err.push(...r.err);else if(!r.match&&!1!==r.ctx.err)throw new K(O,o.prefix,r.err,r.ctx);return r.match?0===r.err.length:r.root}function v(e,t){return f(e,t,!1)}v.valid=function(e,t){let n=t||{};return n.err=n.err||[],f(e,n,!1),0===n.err.length},v.match=(e,t)=>f(e,t=t||{},!0),v.error=(e,t)=>{let n=t||{};return n.err=n.err||[],f(e,n,!1),n.err},v.spec=()=>(v(void 0,{err:!1}),J(Le(a,(e,t)=>n===t||t,!1,!0))),v.node=()=>(v.spec(),a),v.stringify=e=>{let t=null==e?a:e.node&&e.node();return t=null==t||!t.$||n!==t.$.gubu$&&!0!==t.$.gubu$?t:t.v,qe.stringify(t)};let y="";return v.toString=()=>(y=le(""===y?Le(null==a||!a.$||n!==a.$.gubu$&&!0!==a.$.gubu$?a:a.v):y),`[Gubu ${o.name} ${y}]`),e.inspect&&e.inspect.custom&&(v[e.inspect.custom]=v.toString),v.gubu=r,v.spec(),v}function ee(e){let t=!1;if(null==e.tokens){t=!0,e.tokens=[];let n=/\s*,?\s*([)(\.]|"(\\.|[^"\\])*"|\/(\\.|[^\/\\])*\/[a-z]?|[^)(,\s]+)\s*/g,r=null;for(;r=n.exec(e.src);)e.tokens.push(r[1])}e.i=e.i||0;let n=e.tokens[e.i],r=ze[n];if(")"===e.tokens[e.i])return e.i++,e.val;e.i++;let l={Number:Number,String:String,Boolean:Boolean};if(null==r)try{return l[n]||(b===n?void 0:"NaN"===n?NaN:n.match(/^\/.+\/$/)?new RegExp(n.substring(1,n.length-1)):J(n))}catch(s){throw new SyntaxError(`Gubu: unexpected token ${n} in builder expression ${e.src}`)}"("===e.tokens[e.i]&&e.i++;let i=[],o=null;for(;null!=(o=e.tokens[e.i])&&")"!==o;){let t=ee(e);i.push(t)}return e.i++,e.val=r.call(e.val,...i),"."===e.tokens[e.i]?(e.i++,ee(e)):t&&e.i<e.tokens.length?ee(e):e.val}function te(e,t){var n;let r,l={},i=!1;try{i=!(void 0!==t.val||!(null===(n=e.gubu$)||void 0===n?void 0:n.Check))||(t.check=e,e(t.val,l,t))}catch(s){r=s}let o=_(l.err)?0<l.err.length:null!=l.err;if(!i||o){if(void 0===t.val&&(t.node.p||!t.node.r)&&!0!==l.done)return delete l.err,l;let n=l.why||w,i=ne(t);if(g===typeof l.err)t.curerr.push(Te(t,l.err));else if(d===typeof l.err)t.curerr.push(...[l.err].flat().filter(e=>null!=e).map(e=>(e.p=null==e.p?i:e.p,e.m=null==e.m?2010:e.m,e)));else{let l=e.name;null!=l&&""!=l||(l=le(e.toString().replace(/[ \t\r\n]+/g," "))),t.curerr.push(Be(n,t,1045,void 0,{thrown:r},l))}l.done=null==l.done||l.done}return l.hasOwnProperty("uval")?(t.updateVal(l.uval),t.ignoreVal=!1):void 0===l.val||Number.isNaN(l.val)||(t.updateVal(l.val),t.ignoreVal=!1),void 0!==l.node&&(t.node=l.node),void 0!==l.type&&(t.type=l.type),l}function ne(e){return e.path.slice(1,e.dI+1).filter(e=>null!=e).join(".")}function re(e){return f===typeof e?e:f===typeof(null==e?void 0:e.length)?e.length:null!=e&&d===typeof e?q(e).length:NaN}function le(e,t){let n=String(e),r=null==t||isNaN(t)?30:t<0?0:~~t,l=null==e?0:n.length,i=null==e?"":n.substring(0,l);return i=r<l?i.substring(0,r-3)+"...":i,i.substring(0,r)}const ie=function(e){let t=Ge(this,e);return t.r=!0,t.p=!1,void 0===e&&1===arguments.length&&(t.t=b,t.v=void 0),t},oe=function(e){let t=Ge(this,e);return t.c=ue(),t},se=function(e){let t=Ge(this,e);return t.r=!1,void 0===e&&1===arguments.length&&(t.t=b,t.v=void 0),t},ue=function(e){let t=Ge(this,e);return t.t=m,void 0!==e&&(t.v=e,t.f=e),t},ae=function(e,t){let n=Ge(this,t);return n.z=e,n},ce=function(e){let t=Ge(this,e);return t.r=!1,t.p=!0,t},fe=function(e){let t=Ge(this,e);return t.r=!1,t.p=!0,t.e=!1,t.a.push((function(e,t,n){return 0<n.curerr.length&&(t.uval=void 0,t.done=!1),!0})),t},pe=function(e){let t=Ge(this);return t.t=v,t.v=e,t.f=e,t},he=function(e,t){let n=Ge(this,void 0===t?e:t);return n.r=!1,n.f=e,v===typeof e&&Z[e.name]&&(n.t=e.name.toLowerCase(),n.f=Fe(Q[n.t])),n.p=!1,n},ve=function(e){let t=Ge(this,e);return t.u.empty=!0,t},de=function(e){let t=Ge(this,e);return t.t=c,t},ge=function(e,t){let n=Ge(this),r=f===typeof e;n.t=g,r&&null==t&&(n=X([]));let l=null;return v===typeof e&&(l=e,n=ue()),n.b.push((function(n,i,o){if(l)i.val=l(o.path,o);else if(r){let n=e;i.val=o.path.slice(o.path.length-1-(0<=n?n:0),o.path.length-1+(0<=n?0:1)),g===typeof t&&(i.val=i.val.join(t))}else null==e&&(i.val=o.path[o.path.length-2]);return!0})),n},ye=function(...e){let t=Ge();t.t=$,t.r=!0;let n=e.map(e=>qe(e));return t.u.list=e,t.b.push((function(t,r,l){let i=!0;for(let e of n){let n=Object.assign(Object.assign({},l.ctx),{err:[]});e(t,n),0<n.err.length&&(i=!1)}return i||(r.why=E,r.err=[Te(l,A+" "+z+F+P+" does not satisfy all of: "+e.map(e=>Le(e,null,!0)).join(", "))]),i})),t},be=function(...e){let t=Ge();t.t=$,t.r=!0;let n=e.map(e=>qe(e));return t.u.list=e,t.b.push((function(t,r,l){let i=!1;for(let e of n){let n=Object.assign(Object.assign({},l.ctx),{err:[]}),o=e.match(t,n);o&&(r.val=e(t,n)),i||(i=o)}return i||(r.why=L,r.err=[Te(l,A+" "+z+F+P+" does not satisfy any of: "+e.map(e=>Le(e,null,!0)).join(", "))]),i})),t},me=function(...e){let t=Ge();t.t=$,t.r=!0;let n=e.map(e=>qe(e));return t.u.list=e,t.b.push((function(t,r,l){let i=0;for(let e of n){let n=Object.assign(Object.assign({},l.ctx),{err:[]});if(e.match(t,n)){i++,r.val=e(t,n);break}}return 1!==i&&(r.why=M,r.err=[Te(l,A+" "+z+F+P+" does not satisfy one of: "+e.map(e=>Le(e,null,!0)).join(", "))]),!0})),t},$e=function(...e){let t=Ge();return t.b.push((function(t,n,r){for(let l=0;l<e.length;l++)if(t===e[l])return!0;if(r.node.hasOwnProperty("f")&&void 0===t){const t=r.node.f;for(let n=0;n<e.length;n++)if(t===e[n])return!0}return n.err=Te(r,A+" "+z+F+P+" must be exactly one of: "+r.node.s+"."),n.done=!0,!1})),t.s=e.map(e=>Le(e,null,!0)).join(", "),t},xe=function(e,t){let n=Ge(this,t);return n.b.push(e),n},Ie=function(e,t){let n=Ge(this,t);return n.a.push(e),n},ke=function(e,t){let n=Ge(this,t);if(v===typeof e){let t=e;t.gubu$=t.gubu$||{},t.gubu$.Check=!0,n.b.push(e),n.s=(null==n.s?"":n.s+";")+Le(e,null,!0),n.r=!0}else if(d===typeof e){if(Object.prototype.toString.call(e).includes("RegExp")){let t=t=>null!=t&&!Number.isNaN(t)&&!!String(t).match(e);W(t,u,{value:String(e)}),W(t,"gubu$",{value:{Check:!0}}),n.b.push(t),n.s=Le(e),n.r=!0}}else g===typeof e&&(n.t=e,n.r=!0);return n},je=function(e){let t=Ge(this,e);return h===t.t&&l!==t.c&&0===t.n?(t.v=[t.c],t.c=l):t.c=l,t},Oe=function(e,t){let n=Ge(this,t),r=g===typeof e?e:(d===typeof e&&e||{}).name;return null!=r&&""!=r&&n.b.push((function(e,t,n){return(n.ctx.ref=n.ctx.ref||{})[r]=n.node,!0})),n},we=function(e,t){let n=Ge(this,t),r=d===typeof e&&e||{},l=g===typeof e?e:r.name,i=!!r.fill;return null!=l&&""!=l&&n.b.push((function(e,t,n){if(void 0!==e||i){let e=n.ctx.ref=n.ctx.ref||{};if(void 0!==e[l]){let n=Object.assign({},e[l]);n.t=n.t||c,t.node=n,t.type=n.t}}return!0})),n},Ne=function(e,t){let n=Ge(this,t),r=d===typeof e&&e||{},l=g===typeof e?e:r.name,i=y===typeof r.keep?r.keep:void 0,o=_(r.claim)?r.claim:[];if(null!=l&&""!=l){let e=(e,t,n)=>{if(void 0===e&&0<o.length){n.ctx.Rename=n.ctx.Rename||{},n.ctx.Rename.fromDflt=n.ctx.Rename.fromDflt||{};for(let e of o){let r=n.ctx.Rename.fromDflt[e]||{};if(void 0!==n.parent[e]&&!r.yes){t.val=n.parent[e],n.match||(n.parent[l]=t.val),t.node=r.node;for(let e=0;e<n.err.length;e++)n.err[e].k===r.key&&(n.err.splice(e,1),e--);if(i){let t=n.cI+1;n.nodes.splice(t,0,X(r.dval)),n.vals.splice(t,0,void 0),n.parents.splice(t,0,n.parent),n.keys.splice(t,0,e),n.nI++,n.pI++}else delete n.parent[e];break}}void 0===t.val&&(t.val=n.node.v)}return!0};W(e,u,{value:"Rename:"+l}),n.b.push(e);let t=(e,t,n)=>(n.parent[l]=e,n.match||i||n.key===l||_(n.parent)&&!1!==i||(delete n.parent[n.key],t.done=!0),n.ctx.Rename=n.ctx.Rename||{},n.ctx.Rename.fromDflt=n.ctx.Rename.fromDflt||{},n.ctx.Rename.fromDflt[l]={yes:n.fromDflt,key:n.key,dval:n.node.v,node:n.node},!0);W(t,u,{value:"Rename:"+l}),n.a.push(t)}return n},Se=function(e,t){let n=Ge(this,t);return n.b.push((function(t,n,r){let l=re(t);if(e<=l)return!0;r.checkargs={min:1};let i=f===typeof t?"":"length ";return n.err=Te(r,A+" "+z+F+P+` must be a minimum ${i}of ${e} (was ${l}).`),!1})),n.s=T+"("+e+(null==t?"":","+Le(t))+")",n},Ve=function(e,t){let n=Ge(this,t);return n.b.push((function(t,n,r){let l=re(t);if(l<=e)return!0;let i=f===typeof t?"":"length ";return n.err=Te(r,A+" "+z+F+P+` must be a maximum ${i}of ${e} (was ${l}).`),!1})),n.s=G+"("+e+(null==t?"":","+Le(t))+")",n},Re=function(e,t){let n=Ge(this,t);return n.b.push((function(t,n,r){let l=re(t);if(e<l)return!0;let i=f===typeof t?"be":"have length";return n.err=Te(r,A+" "+z+F+P+` must ${i} above ${e} (was ${l}).`),!1})),n.s=D+"("+e+(null==t?"":","+Le(t))+")",n},Ae=function(e,t){let n=Ge(this,t);return n.b.push((function(t,n,r){let l=re(t);if(l<e)return!0;let i=f===typeof t?"be":"have length";return n.err=Te(r,A+" "+z+F+P+` must ${i} below ${e} (was ${l}).`),!1})),n.s=C+"("+e+(null==t?"":","+Le(t))+")",n},De=function(e,t){let n=Ge(this,t||ue());return n.b.push((function(t,n,r){let l=re(t);if(e===l)return!0;let i=f===typeof t?"":" in length";return n.err=Te(r,A+" "+z+F+P+` must be exactly ${e}${i} (was ${l}).`),!1})),n.s=B+"("+e+(null==t?"":","+Le(t))+")",n},Ee=function(e,t){let n=Ge(this,t||{});return n.c=X(e),n},Ce=function(e,t){let n=Ge(this,t||[]);return n.t="array",n.c=X(e),n.m=n.m||{},n.m.rest=!0,n};function Ge(e,t){let n=X(null==e||e.window===e||e.global===e?t:e);return Object.assign(n,{Above:Re,After:Ie,Any:ue,Before:xe,Below:Ae,Check:ke,Child:Ee,Closed:je,Default:he,Define:Oe,Empty:ve,Exact:$e,Fault:ae,Ignore:fe,Len:De,Max:Ve,Min:Se,Never:de,Open:oe,Refer:we,Rename:Ne,Required:ie,Rest:Ce,Skip:ce})}function Te(e,t,n,r){return Be(n||w,e,4e3,t,r)}function Be(e,t,n,r,l,i){var o;let s={k:t.key,n:t.node,v:t.val,p:ne(t),w:e,c:(null===(o=t.check)||void 0===o?void 0:o.name)||"none",a:t.checkargs||{},m:n,t:"",u:l||{}},u=le((void 0===t.val?b:Le(t.val)).replace(/"/g,""));if(null==(r=r||t.node.z)||""===r){let n=u.startsWith("[")?h:u.startsWith("{")?d:null==t.val||f===typeof t.val&&isNaN(t.val)?"value":typeof t.val,r=u.startsWith("[")||_(t.parents[t.pI])?"index":"property",o="is",a=null==l?void 0:l.k;a=_(a)?(r=1<a.length?(o="are","properties"):r,a.join(", ")):a,s.t="Validation failed for "+(0<s.p.length?`${r} "${s.p}" with `:"")+`${n} "${u}" because `+(k===e?x===t.node.t?`the ${n} is not an instance of ${t.node.u.n}`:`the ${n} is not of type ${N===t.node.t?g:t.node.t}`:p===e?""===t.val?"an empty string is not allowed":`the ${n} is required`:"closed"===e?`the ${r} "${a}" ${o} not allowed`:N===e?"the string did not match "+t.node.v:c===e?"no value is allowed":`check "${null==i?e:i}" failed`)+(s.u.thrown?" (threw: "+s.u.thrown.message+")":".")}else s.t=r.replace(/\$VALUE/g,u).replace(/\$PATH/g,s.p);return s}function Me(e){return null!=e.s&&""!==e.s?e.s:e.r||void 0===e.v?e.t:"function"==typeof e.v.constructor?e.v:e.v.toString()}function Le(e,t,r,l){let i;l||!e||!e.$||n!==e.$.gubu$&&!0!==e.$.gubu$||(e=Me(e));try{i=H(e,(e,r)=>{var i,s;if(t&&(r=t(e,r)),null!=r&&d===typeof r&&r.constructor&&S!==r.constructor.name&&V!==r.constructor.name)r="[object RegExp]"===o.call(r)||v===typeof r.toString?r.toString():r.constructor.name;else if(v===typeof r)r=v===typeof Y[r.name]&&isNaN(+e)?void 0:null!=r.name&&""!==r.name?r.name:le(r.toString().replace(/[ \t\r\n]+/g," "));else if("bigint"==typeof r)r=String(r.toString());else{if(Number.isNaN(r))return"NaN";!0===l||!0!==(null===(i=null==r?void 0:r.$)||void 0===i?void 0:i.gubu$)&&n!==(null===(s=null==r?void 0:r.$)||void 0===s?void 0:s.gubu$)||(r=Me(r))}return r}),i=String(i)}catch(s){i=H(String(e))}return!0===r&&(i=i.replace(/^"/,"").replace(/"$/,"")),i}function Fe(e){return null==e||d!==typeof e?e:J(H(e))}const Pe=e=>X(Object.assign(Object.assign({},e),{$:{gubu$:!0}})),ze={Above:Re,After:Ie,All:ye,Any:ue,Before:xe,Below:Ae,Check:ke,Child:Ee,Closed:je,Default:he,Define:Oe,Empty:ve,Exact:$e,Fault:ae,Func:pe,Ignore:fe,Key:ge,Len:De,Max:Ve,Min:Se,Never:de,One:me,Open:oe,Optional:se,Refer:we,Rename:Ne,Required:ie,Skip:ce,Some:be,Rest:Ce};if(b!==typeof window)for(let Je in ze)W(ze[Je],u,{value:Je});Object.assign(Y,Object.assign(Object.assign(Object.assign({Gubu:Y},ze),Object.entries(ze).reduce((e,t)=>(e["G"+t[0]]=t[1],e),{})),{isShape:e=>e&&r===e.gubu,G$:Pe,buildize:Ge,makeErr:Te,stringify:Le,truncate:le,nodize:X,expr:ee,MakeArgu:We})),W(Y,u,{value:s});const qe=Y;t.Gubu=qe;function We(e){return function(t,n,r){let l=!1;g===typeof t&&(l=!0,r=n,n=t);const i=qe(r=r||n,{prefix:e+(n=g===typeof n?" ("+n+")":"")}),o=i.node(),s=o.k;let u=t,a={},c=0,f=0;for(;c<s.length;c++){let e=o.v[s[c]];e.p&&(e=o.v[s[c]]=(t=>Ie((function(e,n,r){if(0<r.curerr.length){f++;for(let e=s.length-1;e>t;e--)o.v[s[e]].m.rest?a[s[e]].splice(o.v[s[e]].m.rest_pos+t-e,0,a[s[e-1]]):(r.vals[r.pI+e-t]=r.vals[r.pI+e-t-1],a[s[e]]=a[s[e-1]]);n.uval=void 0,n.done=!1}return!0}),e))(c),e.e=!1),c!==s.length-1||o.v[s[c]].m.rest||(o.v[s[c]]=Ie((function(e,t,n){return!(s.length-f<u.length&&(0===n.curerr.length&&(t.err=`Too many arguments for type signature (was ${u.length}, expected ${s.length-f})`),t.fatal=!0,1))}),o.v[s[c]]))}function p(e){for(let t=0;t<s.length;t++){let n=o.v[s[t]];n.m.rest?(a[s[t]]=[...e].slice(t),n.m.rest_pos=a[s[t]].length):a[s[t]]=e[t]}return a}return l?function(e){return u=e,a={},c=0,f=0,i(p(e))}:i(p(t))}}const{Gubu:_e}=t;return _e}));
{
"name": "gubu",
"version": "7.0.0",
"version": "7.1.0",
"description": "An object shape validation utility.",

@@ -49,12 +49,12 @@ "main": "gubu.js",

"devDependencies": {
"@types/jest": "^29.5.11",
"@types/jest": "^29.5.12",
"browserify": "^17.0.0",
"es-jest": "^2.1.0",
"esbuild": "^0.19.11",
"esbuild": "^0.21.4",
"esbuild-jest": "^0.5.0",
"jest": "^29.7.0",
"tinyify": "^4.0.0",
"ts-jest": "^29.1.1",
"typescript": "^5.3.3"
"ts-jest": "^29.1.4",
"typescript": "^5.4.5"
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc