check-types-mini 8.2.3 → 8.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -3
- package/dist/check-types-mini.esm.js +2 -2
- package/dist/check-types-mini.umd.js +3 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,10 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
15
15
|
|
|
16
16
|
- **check-types-mini:** harden validation contracts ([ee91068](https://github.com/codsen/codsen/commit/ee910686461b2fcc531a37710917ae6cd58118f2))
|
|
17
17
|
|
|
18
|
+
### Performance Improvements
|
|
19
|
+
|
|
20
|
+
- Recorded a 6.2% higher normalized benchmark score than v8.2.1 (306,214 → 325,188).
|
|
21
|
+
|
|
18
22
|
## 8.2.1 (2026-08-22)
|
|
19
23
|
|
|
20
24
|
### Performance Improvements
|
|
@@ -35,10 +39,17 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
35
39
|
- add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
|
|
36
40
|
- refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
## 8.1.3 (2026-01-15)
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
### Performance Improvements
|
|
45
|
+
|
|
46
|
+
- Recorded a 263.45% higher normalized benchmark score than v8.0.33 (84,263 → 306,252).
|
|
47
|
+
|
|
48
|
+
## 8.0.33 (2025-10-08)
|
|
49
|
+
|
|
50
|
+
### Performance Improvements
|
|
51
|
+
|
|
52
|
+
- Recorded a 75.44% higher normalized benchmark score than v7.1.5 (48,030 → 84,263).
|
|
42
53
|
|
|
43
54
|
## 8.0.0 (2022-12-01)
|
|
44
55
|
|
|
@@ -52,6 +63,12 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
52
63
|
|
|
53
64
|
- export types ([11b5fb9](https://github.com/codsen/codsen/commit/11b5fb936ce20e0a77c3a09806773e1cd7695c50))
|
|
54
65
|
|
|
66
|
+
## 7.1.4 (2022-05-04)
|
|
67
|
+
|
|
68
|
+
### Performance Improvements
|
|
69
|
+
|
|
70
|
+
- Recorded a 22.77% higher normalized benchmark score than v7.1.3 (48,869 → 59,997).
|
|
71
|
+
|
|
55
72
|
## 7.1.3 (2022-04-18)
|
|
56
73
|
|
|
57
74
|
### Fixed
|
|
@@ -59,12 +76,40 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
59
76
|
- correct the Quick Take example ([86566b9](https://github.com/codsen/codsen/commit/86566b9ba8a3ad2371b4de48b3a6a474a5e71cfc))
|
|
60
77
|
- tweak types ([8105826](https://github.com/codsen/codsen/commit/8105826931820464072a9320a8bfbc0e10022955))
|
|
61
78
|
|
|
79
|
+
### Performance Improvements
|
|
80
|
+
|
|
81
|
+
- Recorded a 26.24% higher normalized benchmark score than v7.1.2 (38,712 → 48,869).
|
|
82
|
+
|
|
83
|
+
## 7.1.1 (2022-04-11)
|
|
84
|
+
|
|
85
|
+
### Performance Improvements
|
|
86
|
+
|
|
87
|
+
- Recorded a 30.68% higher normalized benchmark score than v7.1.0 (31,353 → 40,973).
|
|
88
|
+
|
|
62
89
|
## 7.1.0 (2022-04-10)
|
|
63
90
|
|
|
64
91
|
### Features
|
|
65
92
|
|
|
66
93
|
- export defaults and version ([7c27fb3](https://github.com/codsen/codsen/commit/7c27fb383cc57fcf2b88566471b6f2fc405093a1))
|
|
67
94
|
|
|
95
|
+
## 7.0.12 (2022-01-22)
|
|
96
|
+
|
|
97
|
+
### Performance Improvements
|
|
98
|
+
|
|
99
|
+
- Recorded a 46.58% higher normalized benchmark score than v7.0.11 (29,323 → 42,983).
|
|
100
|
+
|
|
101
|
+
## 7.0.9 (2021-12-24)
|
|
102
|
+
|
|
103
|
+
### Performance Improvements
|
|
104
|
+
|
|
105
|
+
- Recorded a 26.63% higher normalized benchmark score than v7.0.8 (43,496 → 55,081).
|
|
106
|
+
|
|
107
|
+
## 7.0.7 (2021-11-30)
|
|
108
|
+
|
|
109
|
+
### Performance Improvements
|
|
110
|
+
|
|
111
|
+
- Recorded a 31.72% higher normalized benchmark score than v7.0.5 (49,375 → 65,038).
|
|
112
|
+
|
|
68
113
|
## 7.0.0 (2021-09-09)
|
|
69
114
|
|
|
70
115
|
### Features
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name check-types-mini
|
|
3
3
|
* @fileoverview Validate options object
|
|
4
|
-
* @version 8.2.
|
|
4
|
+
* @version 8.2.4
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/check-types-mini/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import*as He from"codsen-utils";var Re="8.2.3";var Je=Object.prototype.toString,Ue=typeof self=="object"?self:global,Qe=new Map([[null,"Object"],[Date.prototype,"Date"],[RegExp.prototype,"RegExp"],[Promise.prototype,"Promise"],[Map.prototype,"Map"],[Set.prototype,"Set"],[WeakMap.prototype,"WeakMap"],[WeakSet.prototype,"WeakSet"],[DataView.prototype,"DataView"],[Object.getPrototypeOf(new Map().entries()),"Map Iterator"],[Object.getPrototypeOf(new Set().entries()),"Set Iterator"],[Object.getPrototypeOf([][Symbol.iterator]()),"Array Iterator"],[Object.getPrototypeOf(""[Symbol.iterator]()),"String Iterator"]]);function m(e){let n=typeof e;if(n!=="object")return n;if(e===null)return"null";if(e===Ue)return"global";let t=e;if(Array.isArray(t)&&!(Symbol.toStringTag in t))return"Array";if(typeof window=="object"&&window!==null){if(t===window.location)return"Location";if(t===window.document)return"Document";if(t===window.navigator?.mimeTypes)return"MimeTypeArray";if(t===window.navigator?.plugins)return"PluginArray";if(typeof window.HTMLElement=="function"&&t instanceof window.HTMLElement){if(t.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(t.tagName==="TD")return"HTMLTableDataCellElement";if(t.tagName==="TH")return"HTMLTableHeaderCellElement"}}let r=t[Symbol.toStringTag];return typeof r=="string"?r:Qe.get(Object.getPrototypeOf(t))??Je.call(t).slice(8,-1)}var ft=Re,{formatDiagnosticValue:k,isPlainObject:j,match:Ce}=He,se=Object.getOwnPropertyDescriptor(He,"createMatcher")?.value,R=Object.freeze([]),We=Object.freeze({}),ie={acceptArrays:!1,acceptArraysIgnore:R,enforceStrictKeyset:!0,ignoreKeys:R,ignorePaths:R,msg:"check-types-mini",optsVarName:"opts",reportCompletionFunc:null,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,schema:We},gt=Object.freeze({...ie}),ye=class extends TypeError{actualType;context;expectedTypes;name="CheckTypesMiniError";path;reason;validatorCode;constructor(n,t,r={}){let o=r.context||ie.msg;super(`check-types-mini/checkTypesMini(): [${n}] ${o}: ${t}`),this.actualType=r.actualType??null,this.context=o,this.expectedTypes=r.expectedTypes?Object.freeze(Array.from(r.expectedTypes)):null,this.path=Object.freeze(Array.from(r.path??R)),this.reason=t,this.validatorCode=n}toJSON(){return{actualType:this.actualType,context:this.context,expectedTypes:this.expectedTypes,message:this.message,name:this.name,path:this.path,reason:this.reason,validatorCode:this.validatorCode}}},Te=new Set(["all","any","anything","every","everything","whatever","whatevs"]),V=Object.prototype.hasOwnProperty,ae={caseSensitiveMatch:!0},Ye=new Map,Ze=new Map,Ge=100,Xe=new Set(["acceptArrays","acceptArraysIgnore","enforceStrictKeyset","ignoreKeys","ignorePaths","msg","optsVarName","reportCompletionFunc","reportProgressFunc","reportProgressFuncFrom","reportProgressFuncTo","schema"]);function be(){return{children:new Map,descriptors:null,implicitContainer:!1}}var Fe=be();function et(e){return"keys"in e}function tt(e){return"keys"in e}function C(e){if(!e)return[];let n=new Array(e.depth),t=e;for(;t;)n[t.depth-1]=t.segment,t=t.parent;return n}function T(e,n){let t=e;for(let r of C(n))/^(?:[A-Za-z_$][A-Za-z0-9_$]*|\d+)$/u.test(r)?t+=`.${r}`:t+=`[${JSON.stringify(r)}]`;return t}function Q(e){let n="";for(let t of e)t==="%"?n+="%25":t==="."?n+="%2E":t==="\\"?n+="%5C":n+=t;return n}function nt(e){return e.encoded}function Ne(e){let n="";for(let t=0;t<e.length;t++){let r=e[t];if(r==="\\"&&t+1<e.length){let o=e[t+1];o==="."?n+="%2E":o==="%"?n+="%25":o==="\\"?n+="%5C":n+=`\\${o}`,t++}else r==="%"?n+="%25":n+=r}return n}function me(e,n){if(!e.length)return null;if(e.length===1){let r=e[0],o=n?Ze:Ye,u=o.get(r);if(u)return u;let w=n?Ne(r):r,S=se?se(w,ae):Y=>Ce(Y,w,ae);return o.size<Ge&&o.set(r,S),S}let t=n?e.map(Ne):Array.from(e);return se?se(t,ae):r=>Ce(r,t,ae)}function rt(e){let n=[],t="";for(let r=0;r<e.length;r++){let o=e[r];o==="\\"&&r+1<e.length?(t+=e[r+1],r++):o==="."?(n.push(t),t=""):t+=o}return n.push(t),n}function De(e,n){if(n.some(r=>Te.has(r)))return!0;if(e===!0)return n.includes("true")||n.includes("boolean");if(e===!1)return n.includes("false")||n.includes("boolean");let t=m(e).toLowerCase();return t==="object"&&n.includes("object")?j(e):n.includes(t)}function fe(e){return e.includes("object")&&!e.some(n=>Te.has(n))}function ot(e){let n=Array.isArray(e)?e:[e];if(!n.length)return null;let t=[];for(let r=0;r<n.length;r++){if(!V.call(n,r))return null;let o=n[r];if(o!=null&&typeof o!="string")return null;let u=String(o).toLowerCase().trim();if(!u)return null;t.includes(u)||t.push(u)}return t}function $(e){return Array.isArray(e)?Object.keys(e).filter(n=>{let t=Number(n);return Number.isInteger(t)&&t>=0&&t<e.length&&String(t)===n}):Object.keys(e)}function st(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function $e(e,n){if(e)try{e(n)}catch{}}function h(e,n,t={}){throw new ye(e,n,t)}function b(e,n){return V.call(e,n)&&e[n]!==void 0?e[n]:ie[n]}function U(e,n){return e[n]}function Ae(e,n,t){return!!(n?.(e)||t?.(Q(e)))}function W(e,n,t,r,o){return h(e,n,{actualType:r,context:o,path:C(t)})}function ge(e,n){if(e===void 0)return Array.from(n);let t=typeof e=="string"?[e]:e;if(!Array.isArray(t))return null;let r=[];for(let o=0;o<t.length;o++){if(!V.call(t,o)||typeof t[o]!="string")return null;r.push(t[o])}return r}function yt(...e){let[n,t,r]=e;j(n)||h("THROW_ID_01",`The first argument must be a plain object; received ${k(n,4)}.`,{actualType:m(n).toLowerCase()}),(e.length<2||t!==null&&!j(t))&&h("THROW_ID_02",`The second argument must be a plain object or null; received ${k(t,4)}. Pass null explicitly when validating against only a schema.`,{actualType:m(t).toLowerCase()}),r!=null&&!j(r)&&h("THROW_ID_03",`The third argument must be a plain options object, null, or undefined; received ${k(r,4)}.`,{actualType:m(r).toLowerCase()});let o=r??We,u=Object.keys(o).find(s=>!Xe.has(s));u!==void 0&&h("THROW_ID_04",`Unknown option ${k(u)}.`,{path:[u]});let w=ge(b(o,"ignoreKeys"),R),S=ge(b(o,"ignorePaths"),R),Y=ge(b(o,"acceptArraysIgnore"),R);(!w||!S||!Y)&&h("THROW_ID_05","opts.ignoreKeys, opts.ignorePaths, and opts.acceptArraysIgnore must each be a string or a dense array of strings.");let we=b(o,"acceptArrays"),Oe=b(o,"enforceStrictKeyset");(typeof we!="boolean"||typeof Oe!="boolean")&&h("THROW_ID_06","opts.acceptArrays and opts.enforceStrictKeyset must be Booleans.");let A=b(o,"schema");j(A)||h("THROW_ID_07",`opts.schema was customised to ${k(A)} which is not a plain object but ${m(A).toLowerCase()}.`,{actualType:m(A).toLowerCase(),path:["schema"]});let je=b(o,"msg"),ke=b(o,"optsVarName");(typeof je!="string"||typeof ke!="string")&&h("THROW_ID_08","opts.msg and opts.optsVarName must be strings.");let p=je.trim();p.endsWith(":")&&(p=p.slice(0,-1).trim()),p||(p=ie.msg);let Ve=ke,ce=b(o,"reportCompletionFunc"),le=b(o,"reportProgressFunc");(ce!==null&&typeof ce!="function"||le!==null&&typeof le!="function")&&h("THROW_ID_09","opts.reportCompletionFunc and opts.reportProgressFunc must each be a function, null, or undefined.",{context:p});let Z=b(o,"reportProgressFuncFrom"),G=b(o,"reportProgressFuncTo");(!Number.isFinite(Z)||!Number.isFinite(G))&&h("THROW_ID_10","opts.reportProgressFuncFrom and opts.reportProgressFuncTo must be finite numbers.",{context:p}),Z>G&&h("THROW_ID_11",`opts.reportProgressFuncFrom cannot exceed opts.reportProgressFuncTo; received ${Z} and ${G}.`,{context:p});let i={acceptArrays:we,acceptArraysIgnore:Y,enforceStrictKeyset:Oe,ignoreKeys:w,ignorePaths:S,msg:p,optsVarName:Ve,reportCompletionFunc:ce,reportProgressFunc:le,reportProgressFuncFrom:Z,reportProgressFuncTo:G,schema:A},P=!!(i.reportCompletionFunc||i.reportProgressFunc),Ke=i.reportCompletionFunc?Date.now():0,X=0,v=0,Pe=0,ve=0,pe=0,M=0,ee=0,Se,te=null,_=null;P&&(te=(s=!1)=>{if(!i.reportProgressFunc)return;let c=i.reportProgressFuncTo-i.reportProgressFuncFrom,a=s?i.reportProgressFuncTo:i.reportProgressFuncFrom+c*Math.min(.99,ee/(ee+1e3));a!==Se&&(Se=a,$e(i.reportProgressFunc,a))},_=()=>{ee++,ee%1e3===0&&te?.()},te());let K=n,F=t,ne=A,re=$(ne),E=re.length?be():Fe,L="THROW_ID_12",Ee="THROW_ID_13",ue=re.length?new Set([ne]):null,z=re.length?[{value:ne},{index:0,keys:re,node:E,path:null,value:ne}]:[];for(;z.length;){let s=z.pop();if(!tt(s)){ue?.delete(s.value);continue}if(s.index>=s.keys.length)continue;let c=s.keys[s.index++];z.push(s);let a=U(s.value,c),l=rt(c),f=s.node,d=s.path;for(let D=0;D<l.length;D++){let g=l[D],y=f.children.get(g);y||(y=be(),f.children.set(g,y),ve++,_?.()),d={depth:(d?.depth??0)+1,encoded:d?`${d.encoded}.${Q(g)}`:Q(g),parent:d,segment:g},D<l.length-1&&(y.descriptors&&!fe(y.descriptors)&&W(L,`${T("schema",d)} cannot have both a terminal descriptor and nested schema paths.`,d,null,p),y.implicitContainer=!0),d.depth>v&&(v=d.depth),f=y}if(j(a)){f.descriptors&&!fe(f.descriptors)&&W(L,`${T("schema",d)} cannot have both a terminal descriptor and nested schema paths.`,d,"object",p),f.implicitContainer=!0,ue?.has(a)&&W(Ee,`${T("schema",d)} contains a cycle. Cyclic schemas are not supported.`,d,"object",p),ue?.add(a),z.push({value:a}),z.push({index:0,keys:$(a),node:f,path:d,value:a});continue}let O=ot(a);O||W(L,`${T("schema",d)} must be a non-empty type name, null, undefined, or a dense array of those values; received ${k(a,4)}.`,d,m(a).toLowerCase(),p);let N=O;f.descriptors&&W(L,`${T("schema",d)} is declared more than once.`,d,m(a).toLowerCase(),p),(f.children.size||f.implicitContainer)&&!fe(N)&&W(L,`${T("schema",d)} cannot have both a terminal descriptor and nested schema paths.`,d,m(a).toLowerCase(),p),f.descriptors=N}let de=me(i.ignoreKeys,!1),he=me(i.ignorePaths,!0),_e=me(i.acceptArraysIgnore,!1),Ie=$(K),Le=F?$(F):R;if(i.enforceStrictKeyset&&!F&&E.children.size===0&&h("THROW_ID_14",`Both ${i.optsVarName}.schema and reference objects are missing! We don't have anything to match the keys as requested via ${i.optsVarName}.enforceStrictKeyset.`,{context:p}),i.enforceStrictKeyset){let s=Ie.filter(c=>!Ae(c,de,he)&&!(F&&V.call(F,c))&&!E.children.has(c));if(s.length){let c=s.length>1,a=E.children.size?`The ${i.optsVarName}.enforceStrictKeyset is on and the following key${c?"s are":" is"} not covered by schema and/or reference objects: ${s.join(", ")}`:`The input object has key${c?"s":""} which ${c?"are":"is"} not covered by the reference object: ${s.join(", ")}`;h("THROW_ID_15",a,{context:p})}}if(i.enforceStrictKeyset&&F){let s=Le.filter(c=>!V.call(K,c)&&!Ae(c,de,he));if(s.length){let c=s.length>1;h("THROW_ID_16",`The reference object has key${c?"s":""} which ${c?"are":"is"} not present in the input object: ${s.join(", ")}`,{context:p})}}let H=[K],I=null,q=[{value:K},{index:0,keys:Ie,path:null,refValue:F,schemaNode:E,value:K}];for(;q.length;){let s=q.pop();if(!et(s)){H.pop(),I?.delete(s.value),I&&H.length<=32&&(I=null);continue}if(s.index>=s.keys.length)continue;let c=s.keys[s.index++];q.push(s);let a={depth:(s.path?.depth??0)+1,encoded:s.path?`${s.path.encoded}.${Q(c)}`:Q(c),parent:s.path,segment:c};P&&(Array.isArray(s.value)?X++:Pe++,a.depth>v&&(v=a.depth),_?.());let l=U(s.value,c),f=Array.isArray(s.value);if(!!(!f&&de?.(c)||he?.(nt(a)))){P&&pe++;continue}let O=s.schemaNode.children.get(c),N=!1;if(O?.descriptors){let x=O.descriptors;if(x.some(B=>Te.has(B))){P&&pe++;continue}if(P&&(M++,_?.()),De(l,x))if((O.implicitContainer||O.children.size)&&j(l))N=!0;else continue;if(!N&&i.acceptArrays&&Array.isArray(l)&&!_e?.(c)){let B=$(l);for(let J of B){let oe=U(l,J);P&&(X++,M++,a.depth+1>v&&(v=a.depth+1),_?.()),De(oe,x)||it(oe,x,a,Number(J),i,p)}continue}N||Me(l,x,a,i,p)}let D=!1,g;st(s.refValue)&&V.call(s.refValue,c)&&(D=!0,g=U(s.refValue,c));let y=!1,ze=g,qe=O??Fe;if(O&&(O.implicitContainer||O.children.size))N||(P&&(M++,_?.()),j(l)||Me(l,["object"],a,i,p)),y=!0;else if(D){if(i.acceptArrays&&Array.isArray(l)&&!Array.isArray(g)&&!_e?.(c)){let x=m(g).toLowerCase(),B=$(l);for(let J of B){let oe=U(l,J);P&&(X++,M++,a.depth+1>v&&(v=a.depth+1),_?.());let xe=m(oe).toLowerCase();xe!==x&&ct(xe,x,a,Number(J),i,p)}continue}P&&(M++,_?.()),m(l)!==m(g)&<(l,g,a,i,p),(Array.isArray(l)&&Array.isArray(g)||j(l))&&(y=!0)}else i.enforceStrictKeyset&&(!f||j(l)||Array.isArray(l))&&at(a,i,p);y&&((I?I.has(l):H.includes(l))&&pt(a,i,p),H.push(l),I?I.add(l):H.length>32&&(I=new Set(H)),q.push({value:l}),q.push({index:0,keys:$(l),path:a,refValue:ze,schemaNode:qe,value:l}))}te?.(!0),$e(i.reportCompletionFunc,Object.freeze({arrayElementsVisited:X,maxDepth:v,objectPropertiesVisited:Pe,schemaEntries:ve,timeTakenInMilliseconds:i.reportCompletionFunc?Date.now()-Ke:0,valuesIgnored:pe,valuesValidated:M}))}function at(e,n,t){return h("THROW_ID_17",`${T(n.optsVarName,e)} is neither covered by reference object (second input argument), nor ${n.optsVarName}.schema! To stop this error, turn off ${n.optsVarName}.enforceStrictKeyset or provide a type reference.`,{context:t,path:C(e)})}function Me(e,n,t,r,o){let u=m(e).toLowerCase(),w=u==="string"?"":'"';return h("THROW_ID_18",`${T(r.optsVarName,t)} was customised to ${w}${k(e)}${w} (type: ${u}) which is not among the allowed types in schema (which is equal to ${k(n)})`,{actualType:u,context:o,expectedTypes:n,path:C(t)})}function it(e,n,t,r,o,u){return h("THROW_ID_19",`${T(o.optsVarName,t)}.${r}, the ${r}th element (equal to ${k(e)}) is of a type ${m(e).toLowerCase()}, but only the following are allowed by the ${o.optsVarName}.schema: ${n.join(", ")}`,{actualType:m(e).toLowerCase(),context:u,expectedTypes:n,path:C({depth:t.depth+1,encoded:`${t.encoded}.${r}`,parent:t,segment:String(r)})})}function ct(e,n,t,r,o,u){return h("THROW_ID_20",`${T(o.optsVarName,t)} was customised to be array, but not all of its elements are ${n}-type`,{actualType:e,context:u,expectedTypes:[n],path:C({depth:t.depth+1,encoded:`${t.encoded}.${r}`,parent:t,segment:String(r)})})}function lt(e,n,t,r,o){let u=m(e).toLowerCase(),w=m(n).toLowerCase(),S=u==="string"?"":'"';return h("THROW_ID_21",`${T(r.optsVarName,t)} was customised to ${S}${k(e)}${S} which is not ${w} but ${u}`,{actualType:u,context:o,expectedTypes:[w],path:C(t)})}function pt(e,n,t){return h("THROW_ID_22",`${T(n.optsVarName,e)} contains a cycle. Cyclic input structures are not supported.`,{actualType:"object",context:t,path:C(e)})}export{ye as CheckTypesMiniError,yt as checkTypesMini,gt as defaults,ft as version};
|
|
10
|
+
import*as He from"codsen-utils";var Re="8.2.4";var Je=Object.prototype.toString,Ue=typeof self=="object"?self:global,Qe=new Map([[null,"Object"],[Date.prototype,"Date"],[RegExp.prototype,"RegExp"],[Promise.prototype,"Promise"],[Map.prototype,"Map"],[Set.prototype,"Set"],[WeakMap.prototype,"WeakMap"],[WeakSet.prototype,"WeakSet"],[DataView.prototype,"DataView"],[Object.getPrototypeOf(new Map().entries()),"Map Iterator"],[Object.getPrototypeOf(new Set().entries()),"Set Iterator"],[Object.getPrototypeOf([][Symbol.iterator]()),"Array Iterator"],[Object.getPrototypeOf(""[Symbol.iterator]()),"String Iterator"]]);function m(e){let n=typeof e;if(n!=="object")return n;if(e===null)return"null";if(e===Ue)return"global";let t=e;if(Array.isArray(t)&&!(Symbol.toStringTag in t))return"Array";if(typeof window=="object"&&window!==null){if(t===window.location)return"Location";if(t===window.document)return"Document";if(t===window.navigator?.mimeTypes)return"MimeTypeArray";if(t===window.navigator?.plugins)return"PluginArray";if(typeof window.HTMLElement=="function"&&t instanceof window.HTMLElement){if(t.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(t.tagName==="TD")return"HTMLTableDataCellElement";if(t.tagName==="TH")return"HTMLTableHeaderCellElement"}}let r=t[Symbol.toStringTag];return typeof r=="string"?r:Qe.get(Object.getPrototypeOf(t))??Je.call(t).slice(8,-1)}var ft=Re,{formatDiagnosticValue:k,isPlainObject:j,match:Ce}=He,se=Object.getOwnPropertyDescriptor(He,"createMatcher")?.value,R=Object.freeze([]),We=Object.freeze({}),ie={acceptArrays:!1,acceptArraysIgnore:R,enforceStrictKeyset:!0,ignoreKeys:R,ignorePaths:R,msg:"check-types-mini",optsVarName:"opts",reportCompletionFunc:null,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,schema:We},gt=Object.freeze({...ie}),ye=class extends TypeError{actualType;context;expectedTypes;name="CheckTypesMiniError";path;reason;validatorCode;constructor(n,t,r={}){let o=r.context||ie.msg;super(`check-types-mini/checkTypesMini(): [${n}] ${o}: ${t}`),this.actualType=r.actualType??null,this.context=o,this.expectedTypes=r.expectedTypes?Object.freeze(Array.from(r.expectedTypes)):null,this.path=Object.freeze(Array.from(r.path??R)),this.reason=t,this.validatorCode=n}toJSON(){return{actualType:this.actualType,context:this.context,expectedTypes:this.expectedTypes,message:this.message,name:this.name,path:this.path,reason:this.reason,validatorCode:this.validatorCode}}},Te=new Set(["all","any","anything","every","everything","whatever","whatevs"]),V=Object.prototype.hasOwnProperty,ae={caseSensitiveMatch:!0},Ye=new Map,Ze=new Map,Ge=100,Xe=new Set(["acceptArrays","acceptArraysIgnore","enforceStrictKeyset","ignoreKeys","ignorePaths","msg","optsVarName","reportCompletionFunc","reportProgressFunc","reportProgressFuncFrom","reportProgressFuncTo","schema"]);function be(){return{children:new Map,descriptors:null,implicitContainer:!1}}var Fe=be();function et(e){return"keys"in e}function tt(e){return"keys"in e}function C(e){if(!e)return[];let n=new Array(e.depth),t=e;for(;t;)n[t.depth-1]=t.segment,t=t.parent;return n}function T(e,n){let t=e;for(let r of C(n))/^(?:[A-Za-z_$][A-Za-z0-9_$]*|\d+)$/u.test(r)?t+=`.${r}`:t+=`[${JSON.stringify(r)}]`;return t}function Q(e){let n="";for(let t of e)t==="%"?n+="%25":t==="."?n+="%2E":t==="\\"?n+="%5C":n+=t;return n}function nt(e){return e.encoded}function Ne(e){let n="";for(let t=0;t<e.length;t++){let r=e[t];if(r==="\\"&&t+1<e.length){let o=e[t+1];o==="."?n+="%2E":o==="%"?n+="%25":o==="\\"?n+="%5C":n+=`\\${o}`,t++}else r==="%"?n+="%25":n+=r}return n}function me(e,n){if(!e.length)return null;if(e.length===1){let r=e[0],o=n?Ze:Ye,u=o.get(r);if(u)return u;let w=n?Ne(r):r,S=se?se(w,ae):Y=>Ce(Y,w,ae);return o.size<Ge&&o.set(r,S),S}let t=n?e.map(Ne):Array.from(e);return se?se(t,ae):r=>Ce(r,t,ae)}function rt(e){let n=[],t="";for(let r=0;r<e.length;r++){let o=e[r];o==="\\"&&r+1<e.length?(t+=e[r+1],r++):o==="."?(n.push(t),t=""):t+=o}return n.push(t),n}function De(e,n){if(n.some(r=>Te.has(r)))return!0;if(e===!0)return n.includes("true")||n.includes("boolean");if(e===!1)return n.includes("false")||n.includes("boolean");let t=m(e).toLowerCase();return t==="object"&&n.includes("object")?j(e):n.includes(t)}function fe(e){return e.includes("object")&&!e.some(n=>Te.has(n))}function ot(e){let n=Array.isArray(e)?e:[e];if(!n.length)return null;let t=[];for(let r=0;r<n.length;r++){if(!V.call(n,r))return null;let o=n[r];if(o!=null&&typeof o!="string")return null;let u=String(o).toLowerCase().trim();if(!u)return null;t.includes(u)||t.push(u)}return t}function $(e){return Array.isArray(e)?Object.keys(e).filter(n=>{let t=Number(n);return Number.isInteger(t)&&t>=0&&t<e.length&&String(t)===n}):Object.keys(e)}function st(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function $e(e,n){if(e)try{e(n)}catch{}}function h(e,n,t={}){throw new ye(e,n,t)}function b(e,n){return V.call(e,n)&&e[n]!==void 0?e[n]:ie[n]}function U(e,n){return e[n]}function Ae(e,n,t){return!!(n?.(e)||t?.(Q(e)))}function W(e,n,t,r,o){return h(e,n,{actualType:r,context:o,path:C(t)})}function ge(e,n){if(e===void 0)return Array.from(n);let t=typeof e=="string"?[e]:e;if(!Array.isArray(t))return null;let r=[];for(let o=0;o<t.length;o++){if(!V.call(t,o)||typeof t[o]!="string")return null;r.push(t[o])}return r}function yt(...e){let[n,t,r]=e;j(n)||h("THROW_ID_01",`The first argument must be a plain object; received ${k(n,4)}.`,{actualType:m(n).toLowerCase()}),(e.length<2||t!==null&&!j(t))&&h("THROW_ID_02",`The second argument must be a plain object or null; received ${k(t,4)}. Pass null explicitly when validating against only a schema.`,{actualType:m(t).toLowerCase()}),r!=null&&!j(r)&&h("THROW_ID_03",`The third argument must be a plain options object, null, or undefined; received ${k(r,4)}.`,{actualType:m(r).toLowerCase()});let o=r??We,u=Object.keys(o).find(s=>!Xe.has(s));u!==void 0&&h("THROW_ID_04",`Unknown option ${k(u)}.`,{path:[u]});let w=ge(b(o,"ignoreKeys"),R),S=ge(b(o,"ignorePaths"),R),Y=ge(b(o,"acceptArraysIgnore"),R);(!w||!S||!Y)&&h("THROW_ID_05","opts.ignoreKeys, opts.ignorePaths, and opts.acceptArraysIgnore must each be a string or a dense array of strings.");let we=b(o,"acceptArrays"),Oe=b(o,"enforceStrictKeyset");(typeof we!="boolean"||typeof Oe!="boolean")&&h("THROW_ID_06","opts.acceptArrays and opts.enforceStrictKeyset must be Booleans.");let A=b(o,"schema");j(A)||h("THROW_ID_07",`opts.schema was customised to ${k(A)} which is not a plain object but ${m(A).toLowerCase()}.`,{actualType:m(A).toLowerCase(),path:["schema"]});let je=b(o,"msg"),ke=b(o,"optsVarName");(typeof je!="string"||typeof ke!="string")&&h("THROW_ID_08","opts.msg and opts.optsVarName must be strings.");let p=je.trim();p.endsWith(":")&&(p=p.slice(0,-1).trim()),p||(p=ie.msg);let Ve=ke,ce=b(o,"reportCompletionFunc"),le=b(o,"reportProgressFunc");(ce!==null&&typeof ce!="function"||le!==null&&typeof le!="function")&&h("THROW_ID_09","opts.reportCompletionFunc and opts.reportProgressFunc must each be a function, null, or undefined.",{context:p});let Z=b(o,"reportProgressFuncFrom"),G=b(o,"reportProgressFuncTo");(!Number.isFinite(Z)||!Number.isFinite(G))&&h("THROW_ID_10","opts.reportProgressFuncFrom and opts.reportProgressFuncTo must be finite numbers.",{context:p}),Z>G&&h("THROW_ID_11",`opts.reportProgressFuncFrom cannot exceed opts.reportProgressFuncTo; received ${Z} and ${G}.`,{context:p});let i={acceptArrays:we,acceptArraysIgnore:Y,enforceStrictKeyset:Oe,ignoreKeys:w,ignorePaths:S,msg:p,optsVarName:Ve,reportCompletionFunc:ce,reportProgressFunc:le,reportProgressFuncFrom:Z,reportProgressFuncTo:G,schema:A},P=!!(i.reportCompletionFunc||i.reportProgressFunc),Ke=i.reportCompletionFunc?Date.now():0,X=0,v=0,Pe=0,ve=0,pe=0,M=0,ee=0,Se,te=null,_=null;P&&(te=(s=!1)=>{if(!i.reportProgressFunc)return;let c=i.reportProgressFuncTo-i.reportProgressFuncFrom,a=s?i.reportProgressFuncTo:i.reportProgressFuncFrom+c*Math.min(.99,ee/(ee+1e3));a!==Se&&(Se=a,$e(i.reportProgressFunc,a))},_=()=>{ee++,ee%1e3===0&&te?.()},te());let K=n,F=t,ne=A,re=$(ne),E=re.length?be():Fe,L="THROW_ID_12",Ee="THROW_ID_13",ue=re.length?new Set([ne]):null,z=re.length?[{value:ne},{index:0,keys:re,node:E,path:null,value:ne}]:[];for(;z.length;){let s=z.pop();if(!tt(s)){ue?.delete(s.value);continue}if(s.index>=s.keys.length)continue;let c=s.keys[s.index++];z.push(s);let a=U(s.value,c),l=rt(c),f=s.node,d=s.path;for(let D=0;D<l.length;D++){let g=l[D],y=f.children.get(g);y||(y=be(),f.children.set(g,y),ve++,_?.()),d={depth:(d?.depth??0)+1,encoded:d?`${d.encoded}.${Q(g)}`:Q(g),parent:d,segment:g},D<l.length-1&&(y.descriptors&&!fe(y.descriptors)&&W(L,`${T("schema",d)} cannot have both a terminal descriptor and nested schema paths.`,d,null,p),y.implicitContainer=!0),d.depth>v&&(v=d.depth),f=y}if(j(a)){f.descriptors&&!fe(f.descriptors)&&W(L,`${T("schema",d)} cannot have both a terminal descriptor and nested schema paths.`,d,"object",p),f.implicitContainer=!0,ue?.has(a)&&W(Ee,`${T("schema",d)} contains a cycle. Cyclic schemas are not supported.`,d,"object",p),ue?.add(a),z.push({value:a}),z.push({index:0,keys:$(a),node:f,path:d,value:a});continue}let O=ot(a);O||W(L,`${T("schema",d)} must be a non-empty type name, null, undefined, or a dense array of those values; received ${k(a,4)}.`,d,m(a).toLowerCase(),p);let N=O;f.descriptors&&W(L,`${T("schema",d)} is declared more than once.`,d,m(a).toLowerCase(),p),(f.children.size||f.implicitContainer)&&!fe(N)&&W(L,`${T("schema",d)} cannot have both a terminal descriptor and nested schema paths.`,d,m(a).toLowerCase(),p),f.descriptors=N}let de=me(i.ignoreKeys,!1),he=me(i.ignorePaths,!0),_e=me(i.acceptArraysIgnore,!1),Ie=$(K),Le=F?$(F):R;if(i.enforceStrictKeyset&&!F&&E.children.size===0&&h("THROW_ID_14",`Both ${i.optsVarName}.schema and reference objects are missing! We don't have anything to match the keys as requested via ${i.optsVarName}.enforceStrictKeyset.`,{context:p}),i.enforceStrictKeyset){let s=Ie.filter(c=>!Ae(c,de,he)&&!(F&&V.call(F,c))&&!E.children.has(c));if(s.length){let c=s.length>1,a=E.children.size?`The ${i.optsVarName}.enforceStrictKeyset is on and the following key${c?"s are":" is"} not covered by schema and/or reference objects: ${s.join(", ")}`:`The input object has key${c?"s":""} which ${c?"are":"is"} not covered by the reference object: ${s.join(", ")}`;h("THROW_ID_15",a,{context:p})}}if(i.enforceStrictKeyset&&F){let s=Le.filter(c=>!V.call(K,c)&&!Ae(c,de,he));if(s.length){let c=s.length>1;h("THROW_ID_16",`The reference object has key${c?"s":""} which ${c?"are":"is"} not present in the input object: ${s.join(", ")}`,{context:p})}}let H=[K],I=null,q=[{value:K},{index:0,keys:Ie,path:null,refValue:F,schemaNode:E,value:K}];for(;q.length;){let s=q.pop();if(!et(s)){H.pop(),I?.delete(s.value),I&&H.length<=32&&(I=null);continue}if(s.index>=s.keys.length)continue;let c=s.keys[s.index++];q.push(s);let a={depth:(s.path?.depth??0)+1,encoded:s.path?`${s.path.encoded}.${Q(c)}`:Q(c),parent:s.path,segment:c};P&&(Array.isArray(s.value)?X++:Pe++,a.depth>v&&(v=a.depth),_?.());let l=U(s.value,c),f=Array.isArray(s.value);if(!!(!f&&de?.(c)||he?.(nt(a)))){P&&pe++;continue}let O=s.schemaNode.children.get(c),N=!1;if(O?.descriptors){let x=O.descriptors;if(x.some(B=>Te.has(B))){P&&pe++;continue}if(P&&(M++,_?.()),De(l,x))if((O.implicitContainer||O.children.size)&&j(l))N=!0;else continue;if(!N&&i.acceptArrays&&Array.isArray(l)&&!_e?.(c)){let B=$(l);for(let J of B){let oe=U(l,J);P&&(X++,M++,a.depth+1>v&&(v=a.depth+1),_?.()),De(oe,x)||it(oe,x,a,Number(J),i,p)}continue}N||Me(l,x,a,i,p)}let D=!1,g;st(s.refValue)&&V.call(s.refValue,c)&&(D=!0,g=U(s.refValue,c));let y=!1,ze=g,qe=O??Fe;if(O&&(O.implicitContainer||O.children.size))N||(P&&(M++,_?.()),j(l)||Me(l,["object"],a,i,p)),y=!0;else if(D){if(i.acceptArrays&&Array.isArray(l)&&!Array.isArray(g)&&!_e?.(c)){let x=m(g).toLowerCase(),B=$(l);for(let J of B){let oe=U(l,J);P&&(X++,M++,a.depth+1>v&&(v=a.depth+1),_?.());let xe=m(oe).toLowerCase();xe!==x&&ct(xe,x,a,Number(J),i,p)}continue}P&&(M++,_?.()),m(l)!==m(g)&<(l,g,a,i,p),(Array.isArray(l)&&Array.isArray(g)||j(l))&&(y=!0)}else i.enforceStrictKeyset&&(!f||j(l)||Array.isArray(l))&&at(a,i,p);y&&((I?I.has(l):H.includes(l))&&pt(a,i,p),H.push(l),I?I.add(l):H.length>32&&(I=new Set(H)),q.push({value:l}),q.push({index:0,keys:$(l),path:a,refValue:ze,schemaNode:qe,value:l}))}te?.(!0),$e(i.reportCompletionFunc,Object.freeze({arrayElementsVisited:X,maxDepth:v,objectPropertiesVisited:Pe,schemaEntries:ve,timeTakenInMilliseconds:i.reportCompletionFunc?Date.now()-Ke:0,valuesIgnored:pe,valuesValidated:M}))}function at(e,n,t){return h("THROW_ID_17",`${T(n.optsVarName,e)} is neither covered by reference object (second input argument), nor ${n.optsVarName}.schema! To stop this error, turn off ${n.optsVarName}.enforceStrictKeyset or provide a type reference.`,{context:t,path:C(e)})}function Me(e,n,t,r,o){let u=m(e).toLowerCase(),w=u==="string"?"":'"';return h("THROW_ID_18",`${T(r.optsVarName,t)} was customised to ${w}${k(e)}${w} (type: ${u}) which is not among the allowed types in schema (which is equal to ${k(n)})`,{actualType:u,context:o,expectedTypes:n,path:C(t)})}function it(e,n,t,r,o,u){return h("THROW_ID_19",`${T(o.optsVarName,t)}.${r}, the ${r}th element (equal to ${k(e)}) is of a type ${m(e).toLowerCase()}, but only the following are allowed by the ${o.optsVarName}.schema: ${n.join(", ")}`,{actualType:m(e).toLowerCase(),context:u,expectedTypes:n,path:C({depth:t.depth+1,encoded:`${t.encoded}.${r}`,parent:t,segment:String(r)})})}function ct(e,n,t,r,o,u){return h("THROW_ID_20",`${T(o.optsVarName,t)} was customised to be array, but not all of its elements are ${n}-type`,{actualType:e,context:u,expectedTypes:[n],path:C({depth:t.depth+1,encoded:`${t.encoded}.${r}`,parent:t,segment:String(r)})})}function lt(e,n,t,r,o){let u=m(e).toLowerCase(),w=m(n).toLowerCase(),S=u==="string"?"":'"';return h("THROW_ID_21",`${T(r.optsVarName,t)} was customised to ${S}${k(e)}${S} which is not ${w} but ${u}`,{actualType:u,context:o,expectedTypes:[w],path:C(t)})}function pt(e,n,t){return h("THROW_ID_22",`${T(n.optsVarName,e)} contains a cycle. Cyclic input structures are not supported.`,{actualType:"object",context:t,path:C(e)})}export{ye as CheckTypesMiniError,yt as checkTypesMini,gt as defaults,ft as version};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name check-types-mini
|
|
3
3
|
* @fileoverview Validate options object
|
|
4
|
-
* @version 8.2.
|
|
4
|
+
* @version 8.2.4
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/check-types-mini/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var checkTypesMini=(()=>{var xe=Object.defineProperty;var Zt=Object.getOwnPropertyDescriptor;var Yt=Object.getOwnPropertyNames,lt=Object.getOwnPropertySymbols;var ct=Object.prototype.hasOwnProperty,Xt=Object.prototype.propertyIsEnumerable;var Me=(e,t,n)=>t in e?xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ut=(e,t)=>{for(var n in t||(t={}))ct.call(t,n)&&Me(e,n,t[n]);if(lt)for(var n of lt(t))Xt.call(t,n)&&Me(e,n,t[n]);return e};var pt=(e,t)=>{for(var n in t)xe(e,n,{get:t[n],enumerable:!0})},en=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Yt(t))!ct.call(e,o)&&o!==n&&xe(e,o,{get:()=>t[o],enumerable:!(r=Zt(t,o))||r.enumerable});return e};var tn=e=>en(xe({},"__esModule",{value:!0}),e);var H=(e,t,n)=>Me(e,typeof t!="symbol"?t+"":t,n);var Yr={};pt(Yr,{CheckTypesMiniError:()=>$e,checkTypesMini:()=>Ur,defaults:()=>$r,version:()=>Fr});var De={};pt(De,{backslash:()=>yn,backtick:()=>wn,codsenCLI:()=>hr,compareFn:()=>or,createMatcher:()=>Ar,deepClone:()=>$n,deepCloneWithMetadata:()=>Nn,detectEol:()=>$t,doublePrime:()=>mn,ellipsis:()=>fn,existy:()=>er,findAllIdx:()=>Yn,formatDiagnosticValue:()=>ke,hairspace:()=>dn,hasOwnProp:()=>rr,includes:()=>ir,inlineTags:()=>_r,intersection:()=>ar,isBool:()=>Jn,isCurrencyChar:()=>Wn,isCurrencySymbol:()=>Hn,isDate:()=>Ft,isInt:()=>Qn,isLatinLetter:()=>Vn,isLetter:()=>En,isLowercaseLetter:()=>Kn,isNull:()=>Gn,isNum:()=>Dt,isNumberChar:()=>Mn,isPlainObject:()=>Rt,isQuote:()=>Ln,isRegExp:()=>Qe,isStr:()=>I,isUppercaseLetter:()=>zn,isWhitespaceChar:()=>Bn,leftDoubleQuote:()=>jt,leftSingleQuote:()=>Ot,match:()=>Sr,multiplicationSign:()=>vn,omit:()=>gr,pullAll:()=>Xn,punctuationChars:()=>On,rawMDash:()=>un,rawNDash:()=>cn,rawNbsp:()=>pn,rawReplacementMark:()=>bn,removeTrailingSlash:()=>Un,resolveEolSetting:()=>nr,rightDoubleQuote:()=>xt,rightSingleQuote:()=>Tt,singlePrime:()=>gn,stringSplice:()=>qn,thinSpace:()=>hn,trimChars:()=>Zn,uniq:()=>tr,version:()=>ln,voidTags:()=>sr});function nn(){let e=[],t=0,n=!1;return{append(r){return n?!1:t+r.length>1999?(e.push("\u2026"),t+=1,n=!0,!1):(e.push(r),t+=r.length,!0)},result(){return e.join("")},stopped(){return n}}}function rn(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function Ce(e,t){if(e.append('"')){for(let n=0;n<t.length&&!e.stopped();n+=1){let r=t.charCodeAt(n);r===34?e.append('\\"'):r===92?e.append("\\\\"):r===8?e.append("\\b"):r===9?e.append("\\t"):r===10?e.append("\\n"):r===12?e.append("\\f"):r===13?e.append("\\r"):r<32||r===8232||r===8233||r>=55296&&r<=57343?e.append(rn(r)):e.append(t[n])}e.append('"')}}function on(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function dt(e,t){e.append("Symbol(");let n=String(t);n.length>8&&Ce(e,n.slice(7,-1)),e.append(")")}function ft(e,t){typeof t=="symbol"?dt(e,t):Ce(e,String(t))}function ke(e,t=0){let n=nn(),r=t===4?4:0,o=new WeakSet,s=0;function _(l){r&&n.append(" ".repeat(l*r))}function a(l,g){l&&n.append(","),r&&(n.append("\n"),_(g+1))}function i(l,g,h){r&&g&&(n.append("\n"),_(h)),n.append(l)}function u(l,g){Object.prototype.hasOwnProperty.call(l,"value")?S(l.value,g):n.append(on(l))}function x(l,g){let h;try{h=Reflect.getOwnPropertyDescriptor(l,"length")}catch(T){n.append("[Uninspectable]");return}let j=h==null?void 0:h.value;if(!Number.isSafeInteger(j)||j<0){n.append("[Uninspectable]");return}n.append("[");let O=!1;for(let T=0;T<j&&!n.stopped();T+=1){if(a(O,g),O=!0,s>=50){n.append("[MaxEntries]");break}s+=1;let d;try{d=Reflect.getOwnPropertyDescriptor(l,String(T))}catch(M){n.append("[Uninspectable]");continue}d!=null&&d.enumerable?u(d,g+1):n.append("[Empty]")}i("]",O,g)}function A(l,g){let h;try{h=Reflect.ownKeys(l)}catch(O){n.append("[Uninspectable]");return}n.append("{");let j=!1;for(let O of h){if(n.stopped())break;if(s>=50){a(j,g),j=!0,Ce(n,"\u2026"),n.append(r?": ":":"),n.append("[MaxEntries]");break}s+=1;let T;try{T=Reflect.getOwnPropertyDescriptor(l,O)}catch(d){a(j,g),j=!0,ft(n,O),n.append(r?": ":":"),n.append("[Uninspectable]");continue}T!=null&&T.enumerable&&(a(j,g),j=!0,ft(n,O),n.append(r?": ":":"),u(T,g+1))}i("}",j,g)}function b(l,g){if(o.has(l)){n.append("[Circular]");return}if(g>=5){n.append("[MaxDepth]");return}let h;try{h=Array.isArray(l)}catch(j){n.append("[Uninspectable]");return}o.add(l);try{h?x(l,g):A(l,g)}finally{o.delete(l)}}function S(l,g){l===null?n.append("null"):typeof l=="string"?Ce(n,l):typeof l=="number"?n.append(Object.is(l,-0)?"-0":String(l)):typeof l=="boolean"?n.append(l?"true":"false"):typeof l>"u"?n.append("undefined"):typeof l=="bigint"?n.append("".concat(l,"n")):typeof l=="symbol"?dt(n,l):typeof l=="function"?n.append("[Function]"):b(l,g)}try{return S(e,0),n.result()}catch(l){return"[Uninspectable]"}}var sn="1.10.1",_n=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_9_1_4_0_5_l_4_0_9_0_3_0_n_o_7_","a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4_c_c_0_h_11_1_0_5_","0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_11_f_g_2d_2_5_3_h7_2_g_1_","p_5_22_6_7_7_h_d_i_e_h_e_c_1_2_f_1f_z_0_4_0_1v_2g_7_4_2_x_1_0_5_1x_a_u_1d_t_2_4_b_17_4_p_1i_m_9_1g_2","a_0_2l_1a_h_7_1i_t_d_1_a_17_q_z_15_2_a_z_2_a_5_16_2_2_15_3_1_5_1_1_3_0_5_5b_1s_7p_2_5_2_11_2_5_2_7_1","_0_1_0_1_0_1_u_2_1g_1_6_1_0_3_2_1_6_3_3_2_5_4_c_5_2_1_6_38_0_d_0_g_c_2t_0_4_0_2_9_1_0_3_4_6_0_1_0_1_","0_1_3_1_a_2_3_5_4_4_0_1g_1_22j_6c_6_3_3_1_c_11_1_0_5_0_2_1j_7_0_g_m_9_6_1_6_1_6_1_6_1_6_1_6_1_6_1_6_","28_0_d1_1_16_4_5_1_4_2d_6_2_1_2h_1_3_5_16_1_2l_h_v_1c_f_e8_533_1s_h3g_1v_19_2_7g_3_f_a_1_k_1a_g_u_2_","1x_1d_8_2_2u_2_29_k_g_1_2_1_3_1_m_t_1f_e_1d_1q_5_3_0_1_1_b_r_a_m_p_s_7_1a_s_0_g_4_1_9_a_4_1_14_n_2_1","_7_k_m_3_0_3_1d_1_0_3_1_2_4_2_0_1_0_o_2_2_a_7_2_c_5_2_5_2_5_9_6_1_6_1_16_1_d_6_36_t_8mb_c_m_4_1c_6is","_a5_2_2x_12_6_c_4_5_0_1_9_1_c_1_4_1_0_1_1_1_1_1_2z_x_a2_i_1r_2_1h_14_b_38_4_1_3q_10_p_6_p_b_2g_3_5_2","_5_2_5_2_2_z_b_1_p_1_i_1_1_1_e_2_d_y_3e_at_s_3_1c_1b_v_d_j_1_7_6_11_a_t_2_z_4_7_1c_4d_i_z_4_z_4_13_8","_1f_c_a_1_e_1_6_1_1_1_a_1_e_1_6_1_1_3_1f_c_8m_9_l_a_7_o_5_1_15_1_8_1x_5_2_0_1_17_1_1_3_0_2_m_a_m_9_u","_1t_i_1_1_a_l_a_p_6_p_12_1j_6_1_1s_0_f_3_1_2_1_s_16_s_3_s_z_7_1_r_r_1h_a_l_a_i_d_h_32_20_1j_1e_d_1e_","d_z_12_r_9_m_6y_15_6_1_g_5_1k_s_a_0_8_l_16_h_1a_k_r_m_c_1g_1l_1_2_0_d_18_w_o_q_z_t_0_2_0_8_y_3_0_c_1","b_e_3_l_0_1_0_z_h_1_o_j_1_1r_6_1_0_1_3_1_e_1_9_7_1a_12_7_2_1_2_l_1_6_1_1_1_4_3_0_i_0_c_4_u_9_1_0_2_0","_1_11_1_0_p_0_1_0_18_1g_i_3_k_2_u_1b_k_1_1_0_54_1a_15_3_10_1b_k_0_1n_16_d_0_1z_q_11_6_55_17_38_1r_v_","7_2_0_2_7_1_1_1_n_f_0_1_0_2m_7_2_12_g_0_1_0_s_0_a_13_7_0_l_0_b_19_j_0_i_20_5j_w_v_8_1_10_h_0_1d_t_34","_6_1_1_1_11_l_0_p_5_1_1_1_v_e_0_n_17_78_i_f_0_1_c_1_x_3g_0_27_pl_6e_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a","1_t_1cy_fs_7_u_h_26_h_t_i_1b_g_3_v_k_5_i_c0_18_5v_1r_w_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_1_c_5p1_15_v_","2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_4me_2c_1_1y_1_1_2_0_2_1_2_3_1_b_1_0","_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_7_1f8_u_6_5","_79_1p_42_18_a_6_g_0_8x_t_i_17_dg_r_6c_t_2_0_5r_u_1_2_1_1_1_6_2_4_9_1_68_6_1_3_1_1_1_e_1_5g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),We=_n.slice(1).split("_"),Ke=[],ht=127;for(let e=0;e<We.length;e+=2){let t=ht+1+Number.parseInt(We[e],36),n=t+Number.parseInt(We[e+1],36);Ke.push([t,n]),ht=n}function an(e){if(Number.isNaN(e)||e<128||e>1114111)return!1;let t=0,n=Ke.length-1;for(;t<=n;){let r=t+n>>1,o=Ke[r];if(e<o[0])n=r-1;else if(e>o[1])t=r+1;else return!0}return!1}var ln=sn,Ot="\u2018",Tt="\u2019",jt="\u201C",xt="\u201D",cn="\u2013",un="\u2014",pn="\xA0",fn="\u2026",dn="\u200A",hn="\u2009",gn="\u2032",mn="\u2033",yn="\\",bn="\uFFFD",wn="`",vn="\xD7",On=[".",",",";","!","?"],Ct=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),Se=Object.prototype.hasOwnProperty,kt=Function.prototype.toString,Tn=kt.call(Object),Be=class{constructor(){H(this,"hasRepeatedReferences",!1);H(this,"clones",[]);H(this,"index");H(this,"sources",[])}get(e){if(this.index){let n=this.index.get(e);return n!==void 0&&(this.hasRepeatedReferences=!0),n}let t=this.sources.indexOf(e);if(t!==-1)return this.hasRepeatedReferences=!0,this.clones[t]}set(e,t){if(this.index){this.index.set(e,t);return}if(this.sources.push(e),this.clones.push(t),this.sources.length===32){this.index=new WeakMap;for(let n=0;n<this.sources.length;n++)this.index.set(this.sources[n],this.clones[n]);this.sources=[],this.clones=[]}}};function At(e,t){let n=t.get(e);if(n!==void 0)return n;let r=e.slice(0);return t.set(e,r),r}function jn(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let s=Buffer.from(e);return t.set(e,s),s}let n=At(e.buffer,t);if(e instanceof DataView||Object.prototype.toString.call(e)==="[object DataView]"){let s=new DataView(n,e.byteOffset,e.byteLength);return t.set(e,s),s}let r=e.constructor,o=new r(n,e.byteOffset,e.length);return t.set(e,o),o}function St(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function Ae(e,t,n,r){for(let o of n){let s=t[o],_=typeof s!="object"||s===null?s:Z(s,r);o==="__proto__"?St(e,o,_):e[o]=_}}function le(e,t,n,r){for(let o of n){let s=Object.getOwnPropertyDescriptor(t,o);if(s){if("value"in s){let _=s.value;s.value=typeof _!="object"||_===null?_:Z(_,r)}Object.defineProperty(e,o,s)}}}var xn=Map.prototype.entries,Cn=Set.prototype.values,Ue=Object.prototype.toString,yt,kn=(yt=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:yt.get,bt,An=(bt=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:bt.get,wt,Sn=(wt=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:wt.get,vt,Pt=(vt=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:vt.get,Pn=RegExp.prototype.test,He;function Rn(e){if(e instanceof ArrayBuffer)return!0;try{return kn.call(e),!0}catch(t){return!1}}function Dn(e){try{return xn.call(e)}catch(t){return null}}function In(e){try{return Cn.call(e)}catch(t){return null}}function Fn(e){var t;try{return He||(He=(t=Object.getOwnPropertyDescriptor(URL.prototype,"href"))==null?void 0:t.get),He.call(e)}catch(n){return null}}function Z(e,t){if(typeof e!="object"||e===null)return e;let n=t.get(e);if(n!==void 0)return n;if(Array.isArray(e)){let i=e.length,u=new Array(i);t.set(e,u);let x=e,A=Object.keys(e);if(A.length===i&&(i===0||A[i-1]==="".concat(i-1)))for(let b=0;b<i;b++){let S=x[b];u[b]=typeof S!="object"||S===null?S:Z(S,t)}else Ae(u,x,A,t);return u}let r=Object.getPrototypeOf(e);if(r===Object.prototype){let i={};return t.set(e,i),Ae(i,e,Object.keys(e),t),i}if(r===null){let i=Object.create(null);return t.set(e,i),Ae(i,e,Object.keys(e),t),i}if(Ft(e)){let i=new Date(It.call(e));return t.set(e,i),le(i,e,Object.keys(e),t),i}if(ArrayBuffer.isView(e))return jn(e,t);if(Rn(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return At(e,t);let o=Dn(e);if(o){let i=new Map;t.set(e,i);for(let[u,x]of o)i.set(Z(u,t),Z(x,t));return le(i,e,Object.keys(e),t),i}let s=In(e);if(s){let i=new Set;t.set(e,i);for(let u of s)i.add(Z(u,t));return le(i,e,Object.keys(e),t),i}if(Qe(e)&&e!==RegExp.prototype){let i=new RegExp(Pt.call(e),An.call(e));return i.lastIndex=e.lastIndex,t.set(e,i),le(i,e,Object.keys(e),t),i}let _=Fn(e);if(_!==null){let i=new URL(_);return t.set(e,i),le(i,e,Object.keys(e),t),i}if(e instanceof Error||Ue.call(e)==="[object Error]"){let i=Object.create(Object.getPrototypeOf(e));return t.set(e,i),le(i,e,Reflect.ownKeys(e),t),i}let a=Object.create(r);return t.set(e,a),Ae(a,e,Object.keys(e),t),a}function $n(e){return Z(e,new Be)}function Nn(e){let t=new Be,n=Z(e,t);return{hasRepeatedReferences:t.hasRepeatedReferences,value:n}}function Mn(e){if(!I(e))return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function Wn(e){return I(e)&&e.length===1&&Ct.has(e)}function Hn(e){return I(e)&&Ct.has(e)}function qe(e){if(e.length===1){let t=e.charCodeAt(0);return t<55296||t>57343?t:-1}if(e.length===2){let t=e.charCodeAt(0),n=e.charCodeAt(1);if(t>=55296&&t<=56319&&n>=56320&&n<=57343)return(t-55296)*1024+n-56320+65536}return-1}function En(e){if(!I(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91||t>96&&t<123:an(qe(e))}function Vn(e){if(!e||!I(e))return!1;let t=e.charCodeAt(0);return t>64&&t<91||t>96&&t<123}function Ln(e){return I(e)&&(e==='"'||e==="'"||e===Ot||e===Tt||e===jt||e===xt)}function Kn(e){if(!I(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>96&&t<123:qe(e)<0?!1:e===e.toLowerCase()&&e!==e.toUpperCase()}function zn(e){if(!I(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91:qe(e)<0?!1:e===e.toUpperCase()&&e!==e.toLowerCase()}function Bn(e){if(!I(e)||!e)return!1;let t=e.charCodeAt(0);return t<128?t===32||t>8&&t<14:!e[0].trim()}var Un=e=>I(e)&&e.length&&e.endsWith("/")?e.slice(0,-1).trim():e;function Rt(e){var r;if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.getOwnPropertyDescriptor(t,"constructor");return!n||!("value"in n)||typeof n.value!="function"?!1:((r=Object.getOwnPropertyDescriptor(n.value,"prototype"))==null?void 0:r.value)===t&&kt.call(n.value)===Tn}function qn(e="",t=0,n=0,r=""){return t<0&&(t+=e.length,t<0&&(t=0)),e.slice(0,t)+(r||"")+e.slice(t+n)}function I(e){return typeof e=="string"}function Dt(e){return Number.isFinite(e)}function Qn(e){return Number.isSafeInteger(e)&&e>=0}function Jn(e){return typeof e=="boolean"}function Gn(e){return e===null}function Qe(e){if(e===null||typeof e!="object")return!1;try{return e instanceof RegExp?(e.source,!0):Ue.call(e)!=="[object RegExp]"?!1:(Pt.call(e),!0)}catch(t){return!1}}var It=Date.prototype.getTime;function Ft(e){if(e instanceof Date)return!0;if(e===null||typeof e!="object"||Ue.call(e)!=="[object Date]")return!1;try{return It.call(e),!0}catch(t){return!1}}function Zn(e,t){if(!e||!t)return e;let n=!0;for(let a=t.length;a--;)if(t.charCodeAt(a)>127){n=!1;break}if(n){let a=0,i=e.length;if(t.length===1){let u=t.charCodeAt(0);for(;a<i&&e.charCodeAt(a)===u;)a++;for(;i>a&&e.charCodeAt(i-1)===u;)i--}else{for(;a<i&&t.includes(e[a]);)a++;for(;i>a&&t.includes(e[i-1]);)i--}return a===0&&i===e.length?e:e.slice(a,i)}let r=Array.from(e),o=new Set(t),s=0,_=r.length;for(;s<_&&o.has(r[s]);)s++;for(;_>s&&o.has(r[_-1]);)_--;return s===0&&_===r.length?e:r.slice(s,_).join("")}function Yn(e,t){if(!I(e)||!I(t)||t.length===0)return[];let n=[],r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function Xn(e=[],t=[]){if(!e||!Array.isArray(e)||!e.length)return[];if(!t||!Array.isArray(t)||!t.length)return e.slice();if(e.length*t.length<400)return e.filter(r=>!t.includes(r));let n=new Set(t);return e.filter(r=>!n.has(r))}function er(e){return e!=null}function tr(e){return[...new Set(e)]}function $t(e){if(!(typeof e!="string"||!e)){if(e.includes("\r\n"))return"\r\n";if(e.includes("\n"))return"\n";if(e.includes("\r"))return"\r"}}function nr(e,t,n="\n"){if(n!=="\n"&&n!=="\r\n"&&n!=="\r")throw new Error('codsen-utils/resolveEolSetting(): [THROW_ID_01] the input argument defaultEolChar should be one of EOL values: "\\n", "\\r", or "\\r\\n", but it was given as '.concat(ke(n)));return t==="crlf"?"\r\n":t==="cr"?"\r":t==="lf"?"\n":$t(e)||n}function rr(e,t){return e!=null&&Se.call(e,t)}function or(e,t){return e.localeCompare(t)}var sr=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],_r=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]);function ir(e,t){if(!Array.isArray(e)||!e.length||!I(t))return!1;for(let n of e){if(typeof n=="string"){if(t===n)return!0;continue}if(Qe(n)){let r=Sn.call(n);r&&(n.lastIndex=0);let o=Pn.call(n,t);if(r&&(n.lastIndex=0),o)return!0}}return!1}function ar(e=[],t=[]){if(!Array.isArray(e)||!Array.isArray(t)||!e.length||!t.length)return[];let n=[];if(e.length*t.length<64){for(let s of e)t.includes(s)&&!n.includes(s)&&n.push(s);return n}let r=new Set(t),o=new Set;for(let s of e)r.has(s)&&!o.has(s)&&(o.add(s),n.push(s));return n}var Ee=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;function lr(e){return e.replace(/-+([^-])/g,(t,n)=>n.toUpperCase())}function cr(e){return e.replace(/([\da-z])([A-Z])/g,"$1-$2").toLowerCase()}function ur(e){return e.replace(/^[\r\n]+/,"").replace(/[\r\n]+$/,"")}function gt(e,t){let n=Number.POSITIVE_INFINITY,r=e.split("\n");for(let s of r){let _=/^[ \t]*(?=\S)/.exec(s);_&&(n=Math.min(n,_[0].length))}let o=" ".repeat(t);return r.map(s=>s.trim()?o+s.slice(n):s).join("\n")}function pr(e,t,n){let r="";return e&&(r=ur(e.replace(/\t+\n*$/,"")),r.includes("\n")&&(r=gt(r,n)),r="\n".concat(r)),t&&(r=r?"".concat(gt("\n".concat(t,"\n"),n)).concat(r):"\n".concat(t)),"".concat(r,"\n")}function fr(e){var r;let t=I(e.name)?e.name:"",{bin:n}=e;return I(n)?t.slice(t.startsWith("@")?t.indexOf("/")+1:0):n&&typeof n=="object"&&(r=Object.keys(n)[0])!=null?r:t}function dr(e,t){let n=e?e.type:void 0;return t===void 0?n==="string"?"":n==="number"?void 0:!0:n==="boolean"?t==="true":n==="number"?Number(t):t}function hr(e="",t={}){var Te,te,E,pe,fe,_e,J,ne,de,z;let n=typeof process>"u"?void 0:process,r=(Te=t.pkg)!=null?Te:{},o=(E=(te=t.argv)!=null?te:n==null?void 0:n.argv.slice(2))!=null?E:[],s=(pe=t.helpIndent)!=null?pe:2,_=(fe=t.autoHelp)!=null?fe:!0,a=(_e=t.autoVersion)!=null?_e:!0,i=(ne=(J=t.version)!=null?J:r.version)!=null?ne:"No version found",u=Se.call(t,"booleanDefault")?t.booleanDefault:!1,x=pr(e,(de=t.description)!=null?de:r.description,s);function A(c){console.log(x),n==null||n.exit(Dt(c)?c:2)}function b(){console.log(i),n==null||n.exit(0)}let S=[],l=new Map;for(let[c,f]of Object.entries((z=t.flags)!=null?z:{})){let y={key:c,type:f.type,isMultiple:!!f.isMultiple,source:f};S.push(y),l.set(c,y),l.set(cr(c),y),f.shortFlag&&l.set(f.shortFlag,y)}let g=[],h={};function j(c,f){let y=l.get(c),R=y?y.key:lr(c);if(y!=null&&y.isMultiple){let D=h[R];Array.isArray(D)?D.push(f):h[R]=[f];return}h[R]=f}function O(c,f){j(c,dr(l.get(c),f))}function T(c,f){return f===void 0?!1:(c==null?void 0:c.type)==="boolean"?f==="true"||f==="false":!(f.startsWith("-")&&f.length>1&&!Ee.test(f))}function d(c,f){let y=c.slice(1);for(let R=0;R<y.length;R++){let D=y[R],F=y.slice(R+1);if(F.startsWith("="))return O(D,F.slice(1)),f;if(Ee.test(F)||F&&/\W/.test(F[0]))return O(D,F),f;let B=l.get(D);if(F&&(B!=null&&B.type)&&B.type!=="boolean")return O(D,F),f;if(F){O(D,void 0);continue}if(T(B,o[f+1]))return O(D,o[f+1]),f+1;O(D,void 0)}return f}for(let c=0;c<o.length;c++){let f=o[c];if(f==="--"){g.push(...o.slice(c+1));break}if(f.startsWith("--")){let y=f.slice(2),R=y.indexOf("=");if(R!==-1){O(y.slice(0,R),y.slice(R+1));continue}if(y.startsWith("no-")){j(y.slice(3),!1);continue}let D=l.get(y);if(T(D,o[c+1])){O(y,o[c+1]),c++;continue}O(y,void 0);continue}if(f.startsWith("-")&&f.length>1&&!Ee.test(f)){c=d(f,c);continue}g.push(f)}for(let c of S)Se.call(h,c.key)||(Se.call(c.source,"default")?h[c.key]=c.source.default:c.isMultiple?h[c.key]=[]:c.type==="boolean"&&u!==void 0&&(h[c.key]=u));!g.length&&o.length===1&&(a&&h.version===!0?b():_&&h.help===!0&&A(0));let M=fr(r);return M&&n&&(n.title=M),{input:g,flags:h,pkg:r,help:x,showHelp:A,showVersion:b}}function gr(e,t=[]){if(!e)return e;if(!Rt(e))throw new Error("codsen-utils/omit(): [THROW_ID_02] Input must be a plain object! It was given as ".concat(ke(e,4),' (typeof is "').concat(typeof e,'")'));let n=Object.getPrototypeOf(e)===null?Object.create(null):{},r=new Be;r.set(e,n);let o=Object.keys(e),s=o.length*t.length<400?void 0:new Set(t);for(let _ of o){if(s?s.has(_):t.includes(_))continue;let a=Z(e[_],r);_==="__proto__"?St(n,_,a):n[_]=a}return n}var mr=256,yr=1024,br=1,wr=new Map,vr=new Map;function ze(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let t=String.fromCharCode(e).toUpperCase();if(t.length!==1)return e;let n=t.charCodeAt(0);return e>127&&n<128?e:n}function Ve(e,t,n,r,o,s){for(let _=0;_<o;_++){let a=e.charCodeAt(t+_),i=n.charCodeAt(r+_);if(s||(a>=97&&a<=122&&(a-=32),i>=97&&i<=122&&(i-=32)),a!==i)return!1}return!0}function Nt(e,t,n){let r=t.indexOf("\\");if(r===-1&&e===t)return!0;let o=t.indexOf("*");if(r===-1&&o===-1){if(n)return!1;for(let x=0;x<t.length;x++)if(t.charCodeAt(x)>127)return;return e.length===t.length&&Ve(e,0,t,0,t.length,!1)}if(r!==-1)return;let s=0,_=!1,a=-1;for(let x=0;x<t.length;x++){let A=t.charCodeAt(x);if(A>127)return;if(A===42){if(a=x,!_){if(s++,s>1)return;_=!0}}else _=!1}let i=a+1,u=t.length-i;return e.length<o+u?!1:Ve(e,0,t,0,o,n)&&Ve(e,e.length-u,t,i,u,n)}function Or(e){let t=new Uint32Array(e.length),n=0;for(let r=1;r<e.length;r++){for(;n>0&&e[r]!==e[n];)n=t[n-1];e[r]===e[n]&&n++,t[r]=n}return t}function Tr(e,t){let n=[[]],r=!0,o=!1,s=!1,_=0;for(let b=0;b<e.length;){let S=e.codePointAt(b);if(S!==92){if(S===42)o=!0,s||(n.push([]),s=!0);else{let T=t?S:ze(S);n[n.length-1].push(T),r&&(r=T<=127),_++,s=!1}b+=S>65535?2:1;continue}let l=b+1;for(;e.charCodeAt(l)===92;)l++;let g=l-b,h=e.codePointAt(l),j,O=!1;h===42?(O=g%2===0,j=O?g/2:(g-1)/2):h===void 0||h===10||h===13||h===8232||h===8233?j=Math.ceil(g/2):j=Math.floor(g/2);for(let T=0;T<j;T++)n[n.length-1].push(92),_++;if(O){s=!1,b=l;continue}if(h!==void 0){let T=t?h:ze(h);n[n.length-1].push(T),r&&(r=T<=127),_++,l+=h>65535?2:1}s=!1,b=l}let a=o&&n[0].length===0,i=o&&n[n.length-1].length===0,u=[];for(let b of n)b.length&&u.push({values:b});let x=a?0:1,A=u.length-(i?0:1);for(let b=x;b<A;b++)u[b].values.length>br&&(u[b].failure=Or(u[b].values));return{asciiOnly:r,endsWithWildcard:i,hasWildcard:o,minimumInputLength:_,segments:u,startsWithWildcard:a}}function Je(e,t){let n=t?wr:vr,r=e.length<=yr;if(r){let s=n.get(e);if(s)return s}let o=Tr(e,t);if(r){if(n.size>=mr){let s=n.keys().next().value;s!==void 0&&n.delete(s)}n.set(e,o)}return o}function Ge(e,t){if(t){let o=[];for(let s=0;s<e.length;){let _=e.codePointAt(s);o.push(_),s+=_>65535?2:1}return o}let n=new Uint32Array(e.length),r=0;for(let o=0;o<e.length;){let s=e.codePointAt(o);n[r]=ze(s),r++,o+=s>65535?2:1}return r===n.length?n:n.subarray(0,r)}function Pe(e,t,n,r){for(let o=0;o<n.values.length;o++){let s=e.charCodeAt(t+o);if(!r&&s>=97&&s<=122&&(s-=32),s!==n.values[o])return!1}return!0}function jr(e,t,n,r,o){let s=r-t.values.length;if(s<n)return-1;if(!t.failure){for(let a=n;a<=s;a++)if(Pe(e,a,t,o))return a;return-1}let _=0;for(let a=n;a<r;a++){let i=e.charCodeAt(a);for(!o&&i>=97&&i<=122&&(i-=32);_>0&&i!==t.values[_];)_=t.failure[_-1];if(i===t.values[_]&&(_++,_===t.values.length))return a-_+1}return-1}function Ze(e,t,n){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&Pe(e,0,t.segments[0],n);let r=0,o=t.segments.length,s=0,_=e.length;if(!t.startsWithWildcard){let a=t.segments[0];if(!Pe(e,0,a,n))return!1;s=a.values.length,r++}if(!t.endsWithWildcard){o--;let a=t.segments[o];if(_-=a.values.length,!Pe(e,_,a,n))return!1}for(let a=r;a<o;a++){let i=t.segments[a],u=jr(e,i,s,_,n);if(u===-1)return!1;s=u+i.values.length}return!0}function Re(e,t,n){for(let r=0;r<n.values.length;r++)if(e[t+r]!==n.values[r])return!1;return!0}function xr(e,t,n,r){let o=r-t.values.length;if(o<n)return-1;if(!t.failure){for(let _=n;_<=o;_++)if(Re(e,_,t))return _;return-1}let s=0;for(let _=n;_<r;_++){for(;s>0&&e[_]!==t.values[s];)s=t.failure[s-1];if(e[_]===t.values[s]&&(s++,s===t.values.length))return _-s+1}return-1}function Ye(e,t){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&Re(e,0,t.segments[0]);let n=0,r=t.segments.length,o=0,s=e.length;if(!t.startsWithWildcard){let _=t.segments[0];if(!Re(e,0,_))return!1;o=_.values.length,n++}if(!t.endsWithWildcard){r--;let _=t.segments[r];if(s-=_.values.length,!Re(e,s,_))return!1}for(let _=n;_<r;_++){let a=t.segments[_],i=xr(e,a,o,s);if(i===-1)return!1;o=i+a.values.length}return!0}function Cr(e,t,n){let r=Nt(e,t,n);if(r!==void 0)return r;let o=Je(t,n);return o.asciiOnly?Ze(e,o,n):Ye(Ge(e,n),o)}function mt(e,t,n,r){var _;let o=Nt(e,t,n);if(o!==void 0)return o;let s=Je(t,n);return s.asciiOnly?Ze(e,s,n):((_=r.tokens)!=null||(r.tokens=Ge(e,n)),Ye(r.tokens,s))}function kr(e,t){let n=e.charCodeAt(0)===33,r=n?e.slice(1):e;return{compiled:r.length===0?void 0:Je(r,t),negative:n}}function Le(e,t,n,r){var s;let o;return t.compiled?t.compiled.asciiOnly?o=Ze(e,t.compiled,n):((s=r.tokens)!=null||(r.tokens=Ge(e,n)),o=Ye(r.tokens,t.compiled)):o=e.length===0,t.negative?!o:o}function Ar(e,t){let n=(t==null?void 0:t.caseSensitiveMatch)===!0,r=typeof e=="string"?[e]:Array.from(new Set(e));if(r.length===0)return()=>!1;let o=r.map(s=>kr(s,n));if(typeof e=="string"){let s=o[0];return _=>Le(_,s,n,{})}return s=>{let _={},a=!1,i=!1;for(let u of o)if(u.negative){if(!Le(s,u,n,_))return!1}else a=!0,!i&&Le(s,u,n,_)&&(i=!0);return a?i:!0}}function Sr(e,t,n){if(typeof t!="string"&&!t.length)return!1;let r=n===void 0?!1:n.caseSensitiveMatch===!0;if(typeof t=="string"){let a=t.charCodeAt(0)===33,i=a?t.slice(1):t,u=Cr(e,i,r);return a?!u:u}let o={},s=!1,_=!1;for(let a of t){let i=a.charCodeAt(0)===33,u=i?a.slice(1):a;if(i){if(mt(e,u,r,o))return!1}else s=!0,!_&&mt(e,u,r,o)&&(_=!0)}return s?_:!0}var Mt="8.2.3";var Rr=Object.prototype.toString,Dr=typeof self=="object"?self:global,Ir=new Map([[null,"Object"],[Date.prototype,"Date"],[RegExp.prototype,"RegExp"],[Promise.prototype,"Promise"],[Map.prototype,"Map"],[Set.prototype,"Set"],[WeakMap.prototype,"WeakMap"],[WeakSet.prototype,"WeakSet"],[DataView.prototype,"DataView"],[Object.getPrototypeOf(new Map().entries()),"Map Iterator"],[Object.getPrototypeOf(new Set().entries()),"Set Iterator"],[Object.getPrototypeOf([][Symbol.iterator]()),"Array Iterator"],[Object.getPrototypeOf(""[Symbol.iterator]()),"String Iterator"]]);function P(e){var o,s,_;let t=typeof e;if(t!=="object")return t;if(e===null)return"null";if(e===Dr)return"global";let n=e;if(Array.isArray(n)&&!(Symbol.toStringTag in n))return"Array";if(typeof window=="object"&&window!==null){if(n===window.location)return"Location";if(n===window.document)return"Document";if(n===((o=window.navigator)==null?void 0:o.mimeTypes))return"MimeTypeArray";if(n===((s=window.navigator)==null?void 0:s.plugins))return"PluginArray";if(typeof window.HTMLElement=="function"&&n instanceof window.HTMLElement){if(n.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(n.tagName==="TD")return"HTMLTableDataCellElement";if(n.tagName==="TH")return"HTMLTableHeaderCellElement"}}let r=n[Symbol.toStringTag];return typeof r=="string"?r:(_=Ir.get(Object.getPrototypeOf(n)))!=null?_:Rr.call(n).slice(8,-1)}var Fr=Mt,{formatDiagnosticValue:Q,isPlainObject:q,match:Wt}=De,Bt,Ie=(Bt=Object.getOwnPropertyDescriptor(De,"createMatcher"))==null?void 0:Bt.value,X=Object.freeze([]),Ut=Object.freeze({}),Ne={acceptArrays:!1,acceptArraysIgnore:X,enforceStrictKeyset:!0,ignoreKeys:X,ignorePaths:X,msg:"check-types-mini",optsVarName:"opts",reportCompletionFunc:null,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,schema:Ut},$r=Object.freeze(ut({},Ne)),$e=class extends TypeError{constructor(n,r,o={}){var _,a;let s=o.context||Ne.msg;super("check-types-mini/checkTypesMini(): [".concat(n,"] ").concat(s,": ").concat(r));H(this,"actualType");H(this,"context");H(this,"expectedTypes");H(this,"name","CheckTypesMiniError");H(this,"path");H(this,"reason");H(this,"validatorCode");this.actualType=(_=o.actualType)!=null?_:null,this.context=s,this.expectedTypes=o.expectedTypes?Object.freeze(Array.from(o.expectedTypes)):null,this.path=Object.freeze(Array.from((a=o.path)!=null?a:X)),this.reason=r,this.validatorCode=n}toJSON(){return{actualType:this.actualType,context:this.context,expectedTypes:this.expectedTypes,message:this.message,name:this.name,path:this.path,reason:this.reason,validatorCode:this.validatorCode}}},rt=new Set(["all","any","anything","every","everything","whatever","whatevs"]),ue=Object.prototype.hasOwnProperty,Fe={caseSensitiveMatch:!0},Nr=new Map,Mr=new Map,Wr=100,Hr=new Set(["acceptArrays","acceptArraysIgnore","enforceStrictKeyset","ignoreKeys","ignorePaths","msg","optsVarName","reportCompletionFunc","reportProgressFunc","reportProgressFuncFrom","reportProgressFuncTo","schema"]);function nt(){return{children:new Map,descriptors:null,implicitContainer:!1}}var Ht=nt();function Er(e){return"keys"in e}function Vr(e){return"keys"in e}function ee(e){if(!e)return[];let t=new Array(e.depth),n=e;for(;n;)t[n.depth-1]=n.segment,n=n.parent;return t}function K(e,t){let n=e;for(let r of ee(t))/^(?:[A-Za-z_$][A-Za-z0-9_$]*|\d+)$/u.test(r)?n+=".".concat(r):n+="[".concat(JSON.stringify(r),"]");return n}function Oe(e){let t="";for(let n of e)n==="%"?t+="%25":n==="."?t+="%2E":n==="\\"?t+="%5C":t+=n;return t}function Lr(e){return e.encoded}function Et(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r==="\\"&&n+1<e.length){let o=e[n+1];o==="."?t+="%2E":o==="%"?t+="%25":o==="\\"?t+="%5C":t+="\\".concat(o),n++}else r==="%"?t+="%25":t+=r}return t}function Xe(e,t){if(!e.length)return null;if(e.length===1){let r=e[0],o=t?Mr:Nr,s=o.get(r);if(s)return s;let _=t?Et(r):r,a=Ie?Ie(_,Fe):i=>Wt(i,_,Fe);return o.size<Wr&&o.set(r,a),a}let n=t?e.map(Et):Array.from(e);return Ie?Ie(n,Fe):r=>Wt(r,n,Fe)}function Kr(e){let t=[],n="";for(let r=0;r<e.length;r++){let o=e[r];o==="\\"&&r+1<e.length?(n+=e[r+1],r++):o==="."?(t.push(n),n=""):n+=o}return t.push(n),t}function Vt(e,t){if(t.some(r=>rt.has(r)))return!0;if(e===!0)return t.includes("true")||t.includes("boolean");if(e===!1)return t.includes("false")||t.includes("boolean");let n=P(e).toLowerCase();return n==="object"&&t.includes("object")?q(e):t.includes(n)}function et(e){return e.includes("object")&&!e.some(t=>rt.has(t))}function zr(e){let t=Array.isArray(e)?e:[e];if(!t.length)return null;let n=[];for(let r=0;r<t.length;r++){if(!ue.call(t,r))return null;let o=t[r];if(o!=null&&typeof o!="string")return null;let s=String(o).toLowerCase().trim();if(!s)return null;n.includes(s)||n.push(s)}return n}function se(e){return Array.isArray(e)?Object.keys(e).filter(t=>{let n=Number(t);return Number.isInteger(n)&&n>=0&&n<e.length&&String(n)===t}):Object.keys(e)}function Br(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function Lt(e,t){if(e)try{e(t)}catch(n){}}function k(e,t,n={}){throw new $e(e,t,n)}function L(e,t){return ue.call(e,t)&&e[t]!==void 0?e[t]:Ne[t]}function ve(e,t){return e[t]}function Kt(e,t,n){return!!(t!=null&&t(e)||n!=null&&n(Oe(e)))}function ce(e,t,n,r,o){return k(e,t,{actualType:r,context:o,path:ee(n)})}function tt(e,t){if(e===void 0)return Array.from(t);let n=typeof e=="string"?[e]:e;if(!Array.isArray(n))return null;let r=[];for(let o=0;o<n.length;o++){if(!ue.call(n,o)||typeof n[o]!="string")return null;r.push(n[o])}return r}function Ur(...e){var st,_t,it;let[t,n,r]=e;q(t)||k("THROW_ID_01","The first argument must be a plain object; received ".concat(Q(t,4),"."),{actualType:P(t).toLowerCase()}),(e.length<2||n!==null&&!q(n))&&k("THROW_ID_02","The second argument must be a plain object or null; received ".concat(Q(n,4),". Pass null explicitly when validating against only a schema."),{actualType:P(n).toLowerCase()}),r!=null&&!q(r)&&k("THROW_ID_03","The third argument must be a plain options object, null, or undefined; received ".concat(Q(r,4),"."),{actualType:P(r).toLowerCase()});let o=r!=null?r:Ut,s=Object.keys(o).find(p=>!Hr.has(p));s!==void 0&&k("THROW_ID_04","Unknown option ".concat(Q(s),"."),{path:[s]});let _=tt(L(o,"ignoreKeys"),X),a=tt(L(o,"ignorePaths"),X),i=tt(L(o,"acceptArraysIgnore"),X);(!_||!a||!i)&&k("THROW_ID_05","opts.ignoreKeys, opts.ignorePaths, and opts.acceptArraysIgnore must each be a string or a dense array of strings.");let u=L(o,"acceptArrays"),x=L(o,"enforceStrictKeyset");(typeof u!="boolean"||typeof x!="boolean")&&k("THROW_ID_06","opts.acceptArrays and opts.enforceStrictKeyset must be Booleans.");let A=L(o,"schema");q(A)||k("THROW_ID_07","opts.schema was customised to ".concat(Q(A)," which is not a plain object but ").concat(P(A).toLowerCase(),"."),{actualType:P(A).toLowerCase(),path:["schema"]});let b=L(o,"msg"),S=L(o,"optsVarName");(typeof b!="string"||typeof S!="string")&&k("THROW_ID_08","opts.msg and opts.optsVarName must be strings.");let l=b.trim();l.endsWith(":")&&(l=l.slice(0,-1).trim()),l||(l=Ne.msg);let g=S,h=L(o,"reportCompletionFunc"),j=L(o,"reportProgressFunc");(h!==null&&typeof h!="function"||j!==null&&typeof j!="function")&&k("THROW_ID_09","opts.reportCompletionFunc and opts.reportProgressFunc must each be a function, null, or undefined.",{context:l});let O=L(o,"reportProgressFuncFrom"),T=L(o,"reportProgressFuncTo");(!Number.isFinite(O)||!Number.isFinite(T))&&k("THROW_ID_10","opts.reportProgressFuncFrom and opts.reportProgressFuncTo must be finite numbers.",{context:l}),O>T&&k("THROW_ID_11","opts.reportProgressFuncFrom cannot exceed opts.reportProgressFuncTo; received ".concat(O," and ").concat(T,"."),{context:l});let d={acceptArrays:u,acceptArraysIgnore:i,enforceStrictKeyset:x,ignoreKeys:_,ignorePaths:a,msg:l,optsVarName:g,reportCompletionFunc:h,reportProgressFunc:j,reportProgressFuncFrom:O,reportProgressFuncTo:T,schema:A},M=!!(d.reportCompletionFunc||d.reportProgressFunc),Te=d.reportCompletionFunc?Date.now():0,te=0,E=0,pe=0,fe=0,_e=0,J=0,ne=0,de,z=null,c=null;M&&(z=(p=!1)=>{if(!d.reportProgressFunc)return;let w=d.reportProgressFuncTo-d.reportProgressFuncFrom,m=p?d.reportProgressFuncTo:d.reportProgressFuncFrom+w*Math.min(.99,ne/(ne+1e3));m!==de&&(de=m,Lt(d.reportProgressFunc,m))},c=()=>{ne++,ne%1e3===0&&(z==null||z())},z());let f=t,y=n,R=A,D=se(R),F=D.length?nt():Ht,B="THROW_ID_12",qt="THROW_ID_13",G=D.length?new Set([R]):null,he=D.length?[{value:R},{index:0,keys:D,node:F,path:null,value:R}]:[];for(;he.length;){let p=he.pop();if(!Vr(p)){G==null||G.delete(p.value);continue}if(p.index>=p.keys.length)continue;let w=p.keys[p.index++];he.push(p);let m=ve(p.value,w),v=Kr(w),N=p.node,C=p.path;for(let oe=0;oe<v.length;oe++){let W=v[oe],V=N.children.get(W);V||(V=nt(),N.children.set(W,V),fe++,c==null||c()),C={depth:((st=C==null?void 0:C.depth)!=null?st:0)+1,encoded:C?"".concat(C.encoded,".").concat(Oe(W)):Oe(W),parent:C,segment:W},oe<v.length-1&&(V.descriptors&&!et(V.descriptors)&&ce(B,"".concat(K("schema",C)," cannot have both a terminal descriptor and nested schema paths."),C,null,l),V.implicitContainer=!0),C.depth>E&&(E=C.depth),N=V}if(q(m)){N.descriptors&&!et(N.descriptors)&&ce(B,"".concat(K("schema",C)," cannot have both a terminal descriptor and nested schema paths."),C,"object",l),N.implicitContainer=!0,G!=null&&G.has(m)&&ce(qt,"".concat(K("schema",C)," contains a cycle. Cyclic schemas are not supported."),C,"object",l),G==null||G.add(m),he.push({value:m}),he.push({index:0,keys:se(m),node:N,path:C,value:m});continue}let $=zr(m);$||ce(B,"".concat(K("schema",C)," must be a non-empty type name, null, undefined, or a dense array of those values; received ").concat(Q(m,4),"."),C,P(m).toLowerCase(),l);let re=$;N.descriptors&&ce(B,"".concat(K("schema",C)," is declared more than once."),C,P(m).toLowerCase(),l),(N.children.size||N.implicitContainer)&&!et(re)&&ce(B,"".concat(K("schema",C)," cannot have both a terminal descriptor and nested schema paths."),C,P(m).toLowerCase(),l),N.descriptors=re}let ge=Xe(d.ignoreKeys,!1),me=Xe(d.ignorePaths,!0),ie=Xe(d.acceptArraysIgnore,!1),ot=se(f),Qt=y?se(y):X;if(d.enforceStrictKeyset&&!y&&F.children.size===0&&k("THROW_ID_14","Both ".concat(d.optsVarName,".schema and reference objects are missing! We don't have anything to match the keys as requested via ").concat(d.optsVarName,".enforceStrictKeyset."),{context:l}),d.enforceStrictKeyset){let p=ot.filter(w=>!Kt(w,ge,me)&&!(y&&ue.call(y,w))&&!F.children.has(w));if(p.length){let w=p.length>1,m=F.children.size?"The ".concat(d.optsVarName,".enforceStrictKeyset is on and the following key").concat(w?"s are":" is"," not covered by schema and/or reference objects: ").concat(p.join(", ")):"The input object has key".concat(w?"s":""," which ").concat(w?"are":"is"," not covered by the reference object: ").concat(p.join(", "));k("THROW_ID_15",m,{context:l})}}if(d.enforceStrictKeyset&&y){let p=Qt.filter(w=>!ue.call(f,w)&&!Kt(w,ge,me));if(p.length){let w=p.length>1;k("THROW_ID_16","The reference object has key".concat(w?"s":""," which ").concat(w?"are":"is"," not present in the input object: ").concat(p.join(", ")),{context:l})}}let ae=[f],U=null,ye=[{value:f},{index:0,keys:ot,path:null,refValue:y,schemaNode:F,value:f}];for(;ye.length;){let p=ye.pop();if(!Er(p)){ae.pop(),U==null||U.delete(p.value),U&&ae.length<=32&&(U=null);continue}if(p.index>=p.keys.length)continue;let w=p.keys[p.index++];ye.push(p);let m={depth:((it=(_t=p.path)==null?void 0:_t.depth)!=null?it:0)+1,encoded:p.path?"".concat(p.path.encoded,".").concat(Oe(w)):Oe(w),parent:p.path,segment:w};M&&(Array.isArray(p.value)?te++:pe++,m.depth>E&&(E=m.depth),c==null||c());let v=ve(p.value,w),N=Array.isArray(p.value);if(!!(!N&&(ge!=null&&ge(w))||me!=null&&me(Lr(m)))){M&&_e++;continue}let $=p.schemaNode.children.get(w),re=!1;if($!=null&&$.descriptors){let Y=$.descriptors;if(Y.some(be=>rt.has(be))){M&&_e++;continue}if(M&&(J++,c==null||c()),Vt(v,Y))if(($.implicitContainer||$.children.size)&&q(v))re=!0;else continue;if(!re&&d.acceptArrays&&Array.isArray(v)&&!(ie!=null&&ie(w))){let be=se(v);for(let we of be){let je=ve(v,we);M&&(te++,J++,m.depth+1>E&&(E=m.depth+1),c==null||c()),Vt(je,Y)||Qr(je,Y,m,Number(we),d,l)}continue}re||zt(v,Y,m,d,l)}let oe=!1,W;Br(p.refValue)&&ue.call(p.refValue,w)&&(oe=!0,W=ve(p.refValue,w));let V=!1,Jt=W,Gt=$!=null?$:Ht;if($&&($.implicitContainer||$.children.size))re||(M&&(J++,c==null||c()),q(v)||zt(v,["object"],m,d,l)),V=!0;else if(oe){if(d.acceptArrays&&Array.isArray(v)&&!Array.isArray(W)&&!(ie!=null&&ie(w))){let Y=P(W).toLowerCase(),be=se(v);for(let we of be){let je=ve(v,we);M&&(te++,J++,m.depth+1>E&&(E=m.depth+1),c==null||c());let at=P(je).toLowerCase();at!==Y&&Jr(at,Y,m,Number(we),d,l)}continue}M&&(J++,c==null||c()),P(v)!==P(W)&&Gr(v,W,m,d,l),(Array.isArray(v)&&Array.isArray(W)||q(v))&&(V=!0)}else d.enforceStrictKeyset&&(!N||q(v)||Array.isArray(v))&&qr(m,d,l);V&&((U?U.has(v):ae.includes(v))&&Zr(m,d,l),ae.push(v),U?U.add(v):ae.length>32&&(U=new Set(ae)),ye.push({value:v}),ye.push({index:0,keys:se(v),path:m,refValue:Jt,schemaNode:Gt,value:v}))}z==null||z(!0),Lt(d.reportCompletionFunc,Object.freeze({arrayElementsVisited:te,maxDepth:E,objectPropertiesVisited:pe,schemaEntries:fe,timeTakenInMilliseconds:d.reportCompletionFunc?Date.now()-Te:0,valuesIgnored:_e,valuesValidated:J}))}function qr(e,t,n){return k("THROW_ID_17","".concat(K(t.optsVarName,e)," is neither covered by reference object (second input argument), nor ").concat(t.optsVarName,".schema! To stop this error, turn off ").concat(t.optsVarName,".enforceStrictKeyset or provide a type reference."),{context:n,path:ee(e)})}function zt(e,t,n,r,o){let s=P(e).toLowerCase(),_=s==="string"?"":'"';return k("THROW_ID_18","".concat(K(r.optsVarName,n)," was customised to ").concat(_).concat(Q(e)).concat(_," (type: ").concat(s,") which is not among the allowed types in schema (which is equal to ").concat(Q(t),")"),{actualType:s,context:o,expectedTypes:t,path:ee(n)})}function Qr(e,t,n,r,o,s){return k("THROW_ID_19","".concat(K(o.optsVarName,n),".").concat(r,", the ").concat(r,"th element (equal to ").concat(Q(e),") is of a type ").concat(P(e).toLowerCase(),", but only the following are allowed by the ").concat(o.optsVarName,".schema: ").concat(t.join(", ")),{actualType:P(e).toLowerCase(),context:s,expectedTypes:t,path:ee({depth:n.depth+1,encoded:"".concat(n.encoded,".").concat(r),parent:n,segment:String(r)})})}function Jr(e,t,n,r,o,s){return k("THROW_ID_20","".concat(K(o.optsVarName,n)," was customised to be array, but not all of its elements are ").concat(t,"-type"),{actualType:e,context:s,expectedTypes:[t],path:ee({depth:n.depth+1,encoded:"".concat(n.encoded,".").concat(r),parent:n,segment:String(r)})})}function Gr(e,t,n,r,o){let s=P(e).toLowerCase(),_=P(t).toLowerCase(),a=s==="string"?"":'"';return k("THROW_ID_21","".concat(K(r.optsVarName,n)," was customised to ").concat(a).concat(Q(e)).concat(a," which is not ").concat(_," but ").concat(s),{actualType:s,context:o,expectedTypes:[_],path:ee(n)})}function Zr(e,t,n){return k("THROW_ID_22","".concat(K(t.optsVarName,e)," contains a cycle. Cyclic input structures are not supported."),{actualType:"object",context:n,path:ee(e)})}return tn(Yr);})();
|
|
10
|
+
"use strict";var checkTypesMini=(()=>{var xe=Object.defineProperty;var Zt=Object.getOwnPropertyDescriptor;var Yt=Object.getOwnPropertyNames,lt=Object.getOwnPropertySymbols;var ct=Object.prototype.hasOwnProperty,Xt=Object.prototype.propertyIsEnumerable;var Me=(e,t,n)=>t in e?xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ut=(e,t)=>{for(var n in t||(t={}))ct.call(t,n)&&Me(e,n,t[n]);if(lt)for(var n of lt(t))Xt.call(t,n)&&Me(e,n,t[n]);return e};var pt=(e,t)=>{for(var n in t)xe(e,n,{get:t[n],enumerable:!0})},en=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Yt(t))!ct.call(e,o)&&o!==n&&xe(e,o,{get:()=>t[o],enumerable:!(r=Zt(t,o))||r.enumerable});return e};var tn=e=>en(xe({},"__esModule",{value:!0}),e);var H=(e,t,n)=>Me(e,typeof t!="symbol"?t+"":t,n);var Yr={};pt(Yr,{CheckTypesMiniError:()=>$e,checkTypesMini:()=>Ur,defaults:()=>$r,version:()=>Fr});var De={};pt(De,{backslash:()=>yn,backtick:()=>wn,codsenCLI:()=>hr,compareFn:()=>or,createMatcher:()=>Ar,deepClone:()=>$n,deepCloneWithMetadata:()=>Nn,detectEol:()=>$t,doublePrime:()=>mn,ellipsis:()=>fn,existy:()=>er,findAllIdx:()=>Yn,formatDiagnosticValue:()=>ke,hairspace:()=>dn,hasOwnProp:()=>rr,includes:()=>ir,inlineTags:()=>_r,intersection:()=>ar,isBool:()=>Jn,isCurrencyChar:()=>Wn,isCurrencySymbol:()=>Hn,isDate:()=>Ft,isInt:()=>Qn,isLatinLetter:()=>Vn,isLetter:()=>En,isLowercaseLetter:()=>Kn,isNull:()=>Gn,isNum:()=>Dt,isNumberChar:()=>Mn,isPlainObject:()=>Rt,isQuote:()=>Ln,isRegExp:()=>Qe,isStr:()=>I,isUppercaseLetter:()=>zn,isWhitespaceChar:()=>Bn,leftDoubleQuote:()=>jt,leftSingleQuote:()=>Ot,match:()=>Sr,multiplicationSign:()=>vn,omit:()=>gr,pullAll:()=>Xn,punctuationChars:()=>On,rawMDash:()=>un,rawNDash:()=>cn,rawNbsp:()=>pn,rawReplacementMark:()=>bn,removeTrailingSlash:()=>Un,resolveEolSetting:()=>nr,rightDoubleQuote:()=>xt,rightSingleQuote:()=>Tt,singlePrime:()=>gn,stringSplice:()=>qn,thinSpace:()=>hn,trimChars:()=>Zn,uniq:()=>tr,version:()=>ln,voidTags:()=>sr});function nn(){let e=[],t=0,n=!1;return{append(r){return n?!1:t+r.length>1999?(e.push("\u2026"),t+=1,n=!0,!1):(e.push(r),t+=r.length,!0)},result(){return e.join("")},stopped(){return n}}}function rn(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function Ce(e,t){if(e.append('"')){for(let n=0;n<t.length&&!e.stopped();n+=1){let r=t.charCodeAt(n);r===34?e.append('\\"'):r===92?e.append("\\\\"):r===8?e.append("\\b"):r===9?e.append("\\t"):r===10?e.append("\\n"):r===12?e.append("\\f"):r===13?e.append("\\r"):r<32||r===8232||r===8233||r>=55296&&r<=57343?e.append(rn(r)):e.append(t[n])}e.append('"')}}function on(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function dt(e,t){e.append("Symbol(");let n=String(t);n.length>8&&Ce(e,n.slice(7,-1)),e.append(")")}function ft(e,t){typeof t=="symbol"?dt(e,t):Ce(e,String(t))}function ke(e,t=0){let n=nn(),r=t===4?4:0,o=new WeakSet,s=0;function _(l){r&&n.append(" ".repeat(l*r))}function a(l,g){l&&n.append(","),r&&(n.append("\n"),_(g+1))}function i(l,g,h){r&&g&&(n.append("\n"),_(h)),n.append(l)}function u(l,g){Object.prototype.hasOwnProperty.call(l,"value")?S(l.value,g):n.append(on(l))}function x(l,g){let h;try{h=Reflect.getOwnPropertyDescriptor(l,"length")}catch(T){n.append("[Uninspectable]");return}let j=h==null?void 0:h.value;if(!Number.isSafeInteger(j)||j<0){n.append("[Uninspectable]");return}n.append("[");let O=!1;for(let T=0;T<j&&!n.stopped();T+=1){if(a(O,g),O=!0,s>=50){n.append("[MaxEntries]");break}s+=1;let d;try{d=Reflect.getOwnPropertyDescriptor(l,String(T))}catch(M){n.append("[Uninspectable]");continue}d!=null&&d.enumerable?u(d,g+1):n.append("[Empty]")}i("]",O,g)}function A(l,g){let h;try{h=Reflect.ownKeys(l)}catch(O){n.append("[Uninspectable]");return}n.append("{");let j=!1;for(let O of h){if(n.stopped())break;if(s>=50){a(j,g),j=!0,Ce(n,"\u2026"),n.append(r?": ":":"),n.append("[MaxEntries]");break}s+=1;let T;try{T=Reflect.getOwnPropertyDescriptor(l,O)}catch(d){a(j,g),j=!0,ft(n,O),n.append(r?": ":":"),n.append("[Uninspectable]");continue}T!=null&&T.enumerable&&(a(j,g),j=!0,ft(n,O),n.append(r?": ":":"),u(T,g+1))}i("}",j,g)}function b(l,g){if(o.has(l)){n.append("[Circular]");return}if(g>=5){n.append("[MaxDepth]");return}let h;try{h=Array.isArray(l)}catch(j){n.append("[Uninspectable]");return}o.add(l);try{h?x(l,g):A(l,g)}finally{o.delete(l)}}function S(l,g){l===null?n.append("null"):typeof l=="string"?Ce(n,l):typeof l=="number"?n.append(Object.is(l,-0)?"-0":String(l)):typeof l=="boolean"?n.append(l?"true":"false"):typeof l>"u"?n.append("undefined"):typeof l=="bigint"?n.append("".concat(l,"n")):typeof l=="symbol"?dt(n,l):typeof l=="function"?n.append("[Function]"):b(l,g)}try{return S(e,0),n.result()}catch(l){return"[Uninspectable]"}}var sn="1.10.2",_n=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_9_1_4_0_5_l_4_0_9_0_3_0_n_o_7_","a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4_c_c_0_h_11_1_0_5_","0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_11_f_g_2d_2_5_3_h7_2_g_1_","p_5_22_6_7_7_h_d_i_e_h_e_c_1_2_f_1f_z_0_4_0_1v_2g_7_4_2_x_1_0_5_1x_a_u_1d_t_2_4_b_17_4_p_1i_m_9_1g_2","a_0_2l_1a_h_7_1i_t_d_1_a_17_q_z_15_2_a_z_2_a_5_16_2_2_15_3_1_5_1_1_3_0_5_5b_1s_7p_2_5_2_11_2_5_2_7_1","_0_1_0_1_0_1_u_2_1g_1_6_1_0_3_2_1_6_3_3_2_5_4_c_5_2_1_6_38_0_d_0_g_c_2t_0_4_0_2_9_1_0_3_4_6_0_1_0_1_","0_1_3_1_a_2_3_5_4_4_0_1g_1_22j_6c_6_3_3_1_c_11_1_0_5_0_2_1j_7_0_g_m_9_6_1_6_1_6_1_6_1_6_1_6_1_6_1_6_","28_0_d1_1_16_4_5_1_4_2d_6_2_1_2h_1_3_5_16_1_2l_h_v_1c_f_e8_533_1s_h3g_1v_19_2_7g_3_f_a_1_k_1a_g_u_2_","1x_1d_8_2_2u_2_29_k_g_1_2_1_3_1_m_t_1f_e_1d_1q_5_3_0_1_1_b_r_a_m_p_s_7_1a_s_0_g_4_1_9_a_4_1_14_n_2_1","_7_k_m_3_0_3_1d_1_0_3_1_2_4_2_0_1_0_o_2_2_a_7_2_c_5_2_5_2_5_9_6_1_6_1_16_1_d_6_36_t_8mb_c_m_4_1c_6is","_a5_2_2x_12_6_c_4_5_0_1_9_1_c_1_4_1_0_1_1_1_1_1_2z_x_a2_i_1r_2_1h_14_b_38_4_1_3q_10_p_6_p_b_2g_3_5_2","_5_2_5_2_2_z_b_1_p_1_i_1_1_1_e_2_d_y_3e_at_s_3_1c_1b_v_d_j_1_7_6_11_a_t_2_z_4_7_1c_4d_i_z_4_z_4_13_8","_1f_c_a_1_e_1_6_1_1_1_a_1_e_1_6_1_1_3_1f_c_8m_9_l_a_7_o_5_1_15_1_8_1x_5_2_0_1_17_1_1_3_0_2_m_a_m_9_u","_1t_i_1_1_a_l_a_p_6_p_12_1j_6_1_1s_0_f_3_1_2_1_s_16_s_3_s_z_7_1_r_r_1h_a_l_a_i_d_h_32_20_1j_1e_d_1e_","d_z_12_r_9_m_6y_15_6_1_g_5_1k_s_a_0_8_l_16_h_1a_k_r_m_c_1g_1l_1_2_0_d_18_w_o_q_z_t_0_2_0_8_y_3_0_c_1","b_e_3_l_0_1_0_z_h_1_o_j_1_1r_6_1_0_1_3_1_e_1_9_7_1a_12_7_2_1_2_l_1_6_1_1_1_4_3_0_i_0_c_4_u_9_1_0_2_0","_1_11_1_0_p_0_1_0_18_1g_i_3_k_2_u_1b_k_1_1_0_54_1a_15_3_10_1b_k_0_1n_16_d_0_1z_q_11_6_55_17_38_1r_v_","7_2_0_2_7_1_1_1_n_f_0_1_0_2m_7_2_12_g_0_1_0_s_0_a_13_7_0_l_0_b_19_j_0_i_20_5j_w_v_8_1_10_h_0_1d_t_34","_6_1_1_1_11_l_0_p_5_1_1_1_v_e_0_n_17_78_i_f_0_1_c_1_x_3g_0_27_pl_6e_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a","1_t_1cy_fs_7_u_h_26_h_t_i_1b_g_3_v_k_5_i_c0_18_5v_1r_w_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_1_c_5p1_15_v_","2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_4me_2c_1_1y_1_1_2_0_2_1_2_3_1_b_1_0","_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_7_1f8_u_6_5","_79_1p_42_18_a_6_g_0_8x_t_i_17_dg_r_6c_t_2_0_5r_u_1_2_1_1_1_6_2_4_9_1_68_6_1_3_1_1_1_e_1_5g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),We=_n.slice(1).split("_"),Ke=[],ht=127;for(let e=0;e<We.length;e+=2){let t=ht+1+Number.parseInt(We[e],36),n=t+Number.parseInt(We[e+1],36);Ke.push([t,n]),ht=n}function an(e){if(Number.isNaN(e)||e<128||e>1114111)return!1;let t=0,n=Ke.length-1;for(;t<=n;){let r=t+n>>1,o=Ke[r];if(e<o[0])n=r-1;else if(e>o[1])t=r+1;else return!0}return!1}var ln=sn,Ot="\u2018",Tt="\u2019",jt="\u201C",xt="\u201D",cn="\u2013",un="\u2014",pn="\xA0",fn="\u2026",dn="\u200A",hn="\u2009",gn="\u2032",mn="\u2033",yn="\\",bn="\uFFFD",wn="`",vn="\xD7",On=[".",",",";","!","?"],Ct=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),Se=Object.prototype.hasOwnProperty,kt=Function.prototype.toString,Tn=kt.call(Object),Be=class{constructor(){H(this,"hasRepeatedReferences",!1);H(this,"clones",[]);H(this,"index");H(this,"sources",[])}get(e){if(this.index){let n=this.index.get(e);return n!==void 0&&(this.hasRepeatedReferences=!0),n}let t=this.sources.indexOf(e);if(t!==-1)return this.hasRepeatedReferences=!0,this.clones[t]}set(e,t){if(this.index){this.index.set(e,t);return}if(this.sources.push(e),this.clones.push(t),this.sources.length===32){this.index=new WeakMap;for(let n=0;n<this.sources.length;n++)this.index.set(this.sources[n],this.clones[n]);this.sources=[],this.clones=[]}}};function At(e,t){let n=t.get(e);if(n!==void 0)return n;let r=e.slice(0);return t.set(e,r),r}function jn(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let s=Buffer.from(e);return t.set(e,s),s}let n=At(e.buffer,t);if(e instanceof DataView||Object.prototype.toString.call(e)==="[object DataView]"){let s=new DataView(n,e.byteOffset,e.byteLength);return t.set(e,s),s}let r=e.constructor,o=new r(n,e.byteOffset,e.length);return t.set(e,o),o}function St(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function Ae(e,t,n,r){for(let o of n){let s=t[o],_=typeof s!="object"||s===null?s:Z(s,r);o==="__proto__"?St(e,o,_):e[o]=_}}function le(e,t,n,r){for(let o of n){let s=Object.getOwnPropertyDescriptor(t,o);if(s){if("value"in s){let _=s.value;s.value=typeof _!="object"||_===null?_:Z(_,r)}Object.defineProperty(e,o,s)}}}var xn=Map.prototype.entries,Cn=Set.prototype.values,Ue=Object.prototype.toString,yt,kn=(yt=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:yt.get,bt,An=(bt=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:bt.get,wt,Sn=(wt=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:wt.get,vt,Pt=(vt=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:vt.get,Pn=RegExp.prototype.test,He;function Rn(e){if(e instanceof ArrayBuffer)return!0;try{return kn.call(e),!0}catch(t){return!1}}function Dn(e){try{return xn.call(e)}catch(t){return null}}function In(e){try{return Cn.call(e)}catch(t){return null}}function Fn(e){var t;try{return He||(He=(t=Object.getOwnPropertyDescriptor(URL.prototype,"href"))==null?void 0:t.get),He.call(e)}catch(n){return null}}function Z(e,t){if(typeof e!="object"||e===null)return e;let n=t.get(e);if(n!==void 0)return n;if(Array.isArray(e)){let i=e.length,u=new Array(i);t.set(e,u);let x=e,A=Object.keys(e);if(A.length===i&&(i===0||A[i-1]==="".concat(i-1)))for(let b=0;b<i;b++){let S=x[b];u[b]=typeof S!="object"||S===null?S:Z(S,t)}else Ae(u,x,A,t);return u}let r=Object.getPrototypeOf(e);if(r===Object.prototype){let i={};return t.set(e,i),Ae(i,e,Object.keys(e),t),i}if(r===null){let i=Object.create(null);return t.set(e,i),Ae(i,e,Object.keys(e),t),i}if(Ft(e)){let i=new Date(It.call(e));return t.set(e,i),le(i,e,Object.keys(e),t),i}if(ArrayBuffer.isView(e))return jn(e,t);if(Rn(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return At(e,t);let o=Dn(e);if(o){let i=new Map;t.set(e,i);for(let[u,x]of o)i.set(Z(u,t),Z(x,t));return le(i,e,Object.keys(e),t),i}let s=In(e);if(s){let i=new Set;t.set(e,i);for(let u of s)i.add(Z(u,t));return le(i,e,Object.keys(e),t),i}if(Qe(e)&&e!==RegExp.prototype){let i=new RegExp(Pt.call(e),An.call(e));return i.lastIndex=e.lastIndex,t.set(e,i),le(i,e,Object.keys(e),t),i}let _=Fn(e);if(_!==null){let i=new URL(_);return t.set(e,i),le(i,e,Object.keys(e),t),i}if(e instanceof Error||Ue.call(e)==="[object Error]"){let i=Object.create(Object.getPrototypeOf(e));return t.set(e,i),le(i,e,Reflect.ownKeys(e),t),i}let a=Object.create(r);return t.set(e,a),Ae(a,e,Object.keys(e),t),a}function $n(e){return Z(e,new Be)}function Nn(e){let t=new Be,n=Z(e,t);return{hasRepeatedReferences:t.hasRepeatedReferences,value:n}}function Mn(e){if(!I(e))return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function Wn(e){return I(e)&&e.length===1&&Ct.has(e)}function Hn(e){return I(e)&&Ct.has(e)}function qe(e){if(e.length===1){let t=e.charCodeAt(0);return t<55296||t>57343?t:-1}if(e.length===2){let t=e.charCodeAt(0),n=e.charCodeAt(1);if(t>=55296&&t<=56319&&n>=56320&&n<=57343)return(t-55296)*1024+n-56320+65536}return-1}function En(e){if(!I(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91||t>96&&t<123:an(qe(e))}function Vn(e){if(!e||!I(e))return!1;let t=e.charCodeAt(0);return t>64&&t<91||t>96&&t<123}function Ln(e){return I(e)&&(e==='"'||e==="'"||e===Ot||e===Tt||e===jt||e===xt)}function Kn(e){if(!I(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>96&&t<123:qe(e)<0?!1:e===e.toLowerCase()&&e!==e.toUpperCase()}function zn(e){if(!I(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91:qe(e)<0?!1:e===e.toUpperCase()&&e!==e.toLowerCase()}function Bn(e){if(!I(e)||!e)return!1;let t=e.charCodeAt(0);return t<128?t===32||t>8&&t<14:!e[0].trim()}var Un=e=>I(e)&&e.length&&e.endsWith("/")?e.slice(0,-1).trim():e;function Rt(e){var r;if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.getOwnPropertyDescriptor(t,"constructor");return!n||!("value"in n)||typeof n.value!="function"?!1:((r=Object.getOwnPropertyDescriptor(n.value,"prototype"))==null?void 0:r.value)===t&&kt.call(n.value)===Tn}function qn(e="",t=0,n=0,r=""){return t<0&&(t+=e.length,t<0&&(t=0)),e.slice(0,t)+(r||"")+e.slice(t+n)}function I(e){return typeof e=="string"}function Dt(e){return Number.isFinite(e)}function Qn(e){return Number.isSafeInteger(e)&&e>=0}function Jn(e){return typeof e=="boolean"}function Gn(e){return e===null}function Qe(e){if(e===null||typeof e!="object")return!1;try{return e instanceof RegExp?(e.source,!0):Ue.call(e)!=="[object RegExp]"?!1:(Pt.call(e),!0)}catch(t){return!1}}var It=Date.prototype.getTime;function Ft(e){if(e instanceof Date)return!0;if(e===null||typeof e!="object"||Ue.call(e)!=="[object Date]")return!1;try{return It.call(e),!0}catch(t){return!1}}function Zn(e,t){if(!e||!t)return e;let n=!0;for(let a=t.length;a--;)if(t.charCodeAt(a)>127){n=!1;break}if(n){let a=0,i=e.length;if(t.length===1){let u=t.charCodeAt(0);for(;a<i&&e.charCodeAt(a)===u;)a++;for(;i>a&&e.charCodeAt(i-1)===u;)i--}else{for(;a<i&&t.includes(e[a]);)a++;for(;i>a&&t.includes(e[i-1]);)i--}return a===0&&i===e.length?e:e.slice(a,i)}let r=Array.from(e),o=new Set(t),s=0,_=r.length;for(;s<_&&o.has(r[s]);)s++;for(;_>s&&o.has(r[_-1]);)_--;return s===0&&_===r.length?e:r.slice(s,_).join("")}function Yn(e,t){if(!I(e)||!I(t)||t.length===0)return[];let n=[],r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function Xn(e=[],t=[]){if(!e||!Array.isArray(e)||!e.length)return[];if(!t||!Array.isArray(t)||!t.length)return e.slice();if(e.length*t.length<400)return e.filter(r=>!t.includes(r));let n=new Set(t);return e.filter(r=>!n.has(r))}function er(e){return e!=null}function tr(e){return[...new Set(e)]}function $t(e){if(!(typeof e!="string"||!e)){if(e.includes("\r\n"))return"\r\n";if(e.includes("\n"))return"\n";if(e.includes("\r"))return"\r"}}function nr(e,t,n="\n"){if(n!=="\n"&&n!=="\r\n"&&n!=="\r")throw new Error('codsen-utils/resolveEolSetting(): [THROW_ID_01] the input argument defaultEolChar should be one of EOL values: "\\n", "\\r", or "\\r\\n", but it was given as '.concat(ke(n)));return t==="crlf"?"\r\n":t==="cr"?"\r":t==="lf"?"\n":$t(e)||n}function rr(e,t){return e!=null&&Se.call(e,t)}function or(e,t){return e.localeCompare(t)}var sr=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],_r=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]);function ir(e,t){if(!Array.isArray(e)||!e.length||!I(t))return!1;for(let n of e){if(typeof n=="string"){if(t===n)return!0;continue}if(Qe(n)){let r=Sn.call(n);r&&(n.lastIndex=0);let o=Pn.call(n,t);if(r&&(n.lastIndex=0),o)return!0}}return!1}function ar(e=[],t=[]){if(!Array.isArray(e)||!Array.isArray(t)||!e.length||!t.length)return[];let n=[];if(e.length*t.length<64){for(let s of e)t.includes(s)&&!n.includes(s)&&n.push(s);return n}let r=new Set(t),o=new Set;for(let s of e)r.has(s)&&!o.has(s)&&(o.add(s),n.push(s));return n}var Ee=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;function lr(e){return e.replace(/-+([^-])/g,(t,n)=>n.toUpperCase())}function cr(e){return e.replace(/([\da-z])([A-Z])/g,"$1-$2").toLowerCase()}function ur(e){return e.replace(/^[\r\n]+/,"").replace(/[\r\n]+$/,"")}function gt(e,t){let n=Number.POSITIVE_INFINITY,r=e.split("\n");for(let s of r){let _=/^[ \t]*(?=\S)/.exec(s);_&&(n=Math.min(n,_[0].length))}let o=" ".repeat(t);return r.map(s=>s.trim()?o+s.slice(n):s).join("\n")}function pr(e,t,n){let r="";return e&&(r=ur(e.replace(/\t+\n*$/,"")),r.includes("\n")&&(r=gt(r,n)),r="\n".concat(r)),t&&(r=r?"".concat(gt("\n".concat(t,"\n"),n)).concat(r):"\n".concat(t)),"".concat(r,"\n")}function fr(e){var r;let t=I(e.name)?e.name:"",{bin:n}=e;return I(n)?t.slice(t.startsWith("@")?t.indexOf("/")+1:0):n&&typeof n=="object"&&(r=Object.keys(n)[0])!=null?r:t}function dr(e,t){let n=e?e.type:void 0;return t===void 0?n==="string"?"":n==="number"?void 0:!0:n==="boolean"?t==="true":n==="number"?Number(t):t}function hr(e="",t={}){var Te,te,E,pe,fe,_e,J,ne,de,z;let n=typeof process>"u"?void 0:process,r=(Te=t.pkg)!=null?Te:{},o=(E=(te=t.argv)!=null?te:n==null?void 0:n.argv.slice(2))!=null?E:[],s=(pe=t.helpIndent)!=null?pe:2,_=(fe=t.autoHelp)!=null?fe:!0,a=(_e=t.autoVersion)!=null?_e:!0,i=(ne=(J=t.version)!=null?J:r.version)!=null?ne:"No version found",u=Se.call(t,"booleanDefault")?t.booleanDefault:!1,x=pr(e,(de=t.description)!=null?de:r.description,s);function A(c){console.log(x),n==null||n.exit(Dt(c)?c:2)}function b(){console.log(i),n==null||n.exit(0)}let S=[],l=new Map;for(let[c,f]of Object.entries((z=t.flags)!=null?z:{})){let y={key:c,type:f.type,isMultiple:!!f.isMultiple,source:f};S.push(y),l.set(c,y),l.set(cr(c),y),f.shortFlag&&l.set(f.shortFlag,y)}let g=[],h={};function j(c,f){let y=l.get(c),R=y?y.key:lr(c);if(y!=null&&y.isMultiple){let D=h[R];Array.isArray(D)?D.push(f):h[R]=[f];return}h[R]=f}function O(c,f){j(c,dr(l.get(c),f))}function T(c,f){return f===void 0?!1:(c==null?void 0:c.type)==="boolean"?f==="true"||f==="false":!(f.startsWith("-")&&f.length>1&&!Ee.test(f))}function d(c,f){let y=c.slice(1);for(let R=0;R<y.length;R++){let D=y[R],F=y.slice(R+1);if(F.startsWith("="))return O(D,F.slice(1)),f;if(Ee.test(F)||F&&/\W/.test(F[0]))return O(D,F),f;let B=l.get(D);if(F&&(B!=null&&B.type)&&B.type!=="boolean")return O(D,F),f;if(F){O(D,void 0);continue}if(T(B,o[f+1]))return O(D,o[f+1]),f+1;O(D,void 0)}return f}for(let c=0;c<o.length;c++){let f=o[c];if(f==="--"){g.push(...o.slice(c+1));break}if(f.startsWith("--")){let y=f.slice(2),R=y.indexOf("=");if(R!==-1){O(y.slice(0,R),y.slice(R+1));continue}if(y.startsWith("no-")){j(y.slice(3),!1);continue}let D=l.get(y);if(T(D,o[c+1])){O(y,o[c+1]),c++;continue}O(y,void 0);continue}if(f.startsWith("-")&&f.length>1&&!Ee.test(f)){c=d(f,c);continue}g.push(f)}for(let c of S)Se.call(h,c.key)||(Se.call(c.source,"default")?h[c.key]=c.source.default:c.isMultiple?h[c.key]=[]:c.type==="boolean"&&u!==void 0&&(h[c.key]=u));!g.length&&o.length===1&&(a&&h.version===!0?b():_&&h.help===!0&&A(0));let M=fr(r);return M&&n&&(n.title=M),{input:g,flags:h,pkg:r,help:x,showHelp:A,showVersion:b}}function gr(e,t=[]){if(!e)return e;if(!Rt(e))throw new Error("codsen-utils/omit(): [THROW_ID_02] Input must be a plain object! It was given as ".concat(ke(e,4),' (typeof is "').concat(typeof e,'")'));let n=Object.getPrototypeOf(e)===null?Object.create(null):{},r=new Be;r.set(e,n);let o=Object.keys(e),s=o.length*t.length<400?void 0:new Set(t);for(let _ of o){if(s?s.has(_):t.includes(_))continue;let a=Z(e[_],r);_==="__proto__"?St(n,_,a):n[_]=a}return n}var mr=256,yr=1024,br=1,wr=new Map,vr=new Map;function ze(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let t=String.fromCharCode(e).toUpperCase();if(t.length!==1)return e;let n=t.charCodeAt(0);return e>127&&n<128?e:n}function Ve(e,t,n,r,o,s){for(let _=0;_<o;_++){let a=e.charCodeAt(t+_),i=n.charCodeAt(r+_);if(s||(a>=97&&a<=122&&(a-=32),i>=97&&i<=122&&(i-=32)),a!==i)return!1}return!0}function Nt(e,t,n){let r=t.indexOf("\\");if(r===-1&&e===t)return!0;let o=t.indexOf("*");if(r===-1&&o===-1){if(n)return!1;for(let x=0;x<t.length;x++)if(t.charCodeAt(x)>127)return;return e.length===t.length&&Ve(e,0,t,0,t.length,!1)}if(r!==-1)return;let s=0,_=!1,a=-1;for(let x=0;x<t.length;x++){let A=t.charCodeAt(x);if(A>127)return;if(A===42){if(a=x,!_){if(s++,s>1)return;_=!0}}else _=!1}let i=a+1,u=t.length-i;return e.length<o+u?!1:Ve(e,0,t,0,o,n)&&Ve(e,e.length-u,t,i,u,n)}function Or(e){let t=new Uint32Array(e.length),n=0;for(let r=1;r<e.length;r++){for(;n>0&&e[r]!==e[n];)n=t[n-1];e[r]===e[n]&&n++,t[r]=n}return t}function Tr(e,t){let n=[[]],r=!0,o=!1,s=!1,_=0;for(let b=0;b<e.length;){let S=e.codePointAt(b);if(S!==92){if(S===42)o=!0,s||(n.push([]),s=!0);else{let T=t?S:ze(S);n[n.length-1].push(T),r&&(r=T<=127),_++,s=!1}b+=S>65535?2:1;continue}let l=b+1;for(;e.charCodeAt(l)===92;)l++;let g=l-b,h=e.codePointAt(l),j,O=!1;h===42?(O=g%2===0,j=O?g/2:(g-1)/2):h===void 0||h===10||h===13||h===8232||h===8233?j=Math.ceil(g/2):j=Math.floor(g/2);for(let T=0;T<j;T++)n[n.length-1].push(92),_++;if(O){s=!1,b=l;continue}if(h!==void 0){let T=t?h:ze(h);n[n.length-1].push(T),r&&(r=T<=127),_++,l+=h>65535?2:1}s=!1,b=l}let a=o&&n[0].length===0,i=o&&n[n.length-1].length===0,u=[];for(let b of n)b.length&&u.push({values:b});let x=a?0:1,A=u.length-(i?0:1);for(let b=x;b<A;b++)u[b].values.length>br&&(u[b].failure=Or(u[b].values));return{asciiOnly:r,endsWithWildcard:i,hasWildcard:o,minimumInputLength:_,segments:u,startsWithWildcard:a}}function Je(e,t){let n=t?wr:vr,r=e.length<=yr;if(r){let s=n.get(e);if(s)return s}let o=Tr(e,t);if(r){if(n.size>=mr){let s=n.keys().next().value;s!==void 0&&n.delete(s)}n.set(e,o)}return o}function Ge(e,t){if(t){let o=[];for(let s=0;s<e.length;){let _=e.codePointAt(s);o.push(_),s+=_>65535?2:1}return o}let n=new Uint32Array(e.length),r=0;for(let o=0;o<e.length;){let s=e.codePointAt(o);n[r]=ze(s),r++,o+=s>65535?2:1}return r===n.length?n:n.subarray(0,r)}function Pe(e,t,n,r){for(let o=0;o<n.values.length;o++){let s=e.charCodeAt(t+o);if(!r&&s>=97&&s<=122&&(s-=32),s!==n.values[o])return!1}return!0}function jr(e,t,n,r,o){let s=r-t.values.length;if(s<n)return-1;if(!t.failure){for(let a=n;a<=s;a++)if(Pe(e,a,t,o))return a;return-1}let _=0;for(let a=n;a<r;a++){let i=e.charCodeAt(a);for(!o&&i>=97&&i<=122&&(i-=32);_>0&&i!==t.values[_];)_=t.failure[_-1];if(i===t.values[_]&&(_++,_===t.values.length))return a-_+1}return-1}function Ze(e,t,n){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&Pe(e,0,t.segments[0],n);let r=0,o=t.segments.length,s=0,_=e.length;if(!t.startsWithWildcard){let a=t.segments[0];if(!Pe(e,0,a,n))return!1;s=a.values.length,r++}if(!t.endsWithWildcard){o--;let a=t.segments[o];if(_-=a.values.length,!Pe(e,_,a,n))return!1}for(let a=r;a<o;a++){let i=t.segments[a],u=jr(e,i,s,_,n);if(u===-1)return!1;s=u+i.values.length}return!0}function Re(e,t,n){for(let r=0;r<n.values.length;r++)if(e[t+r]!==n.values[r])return!1;return!0}function xr(e,t,n,r){let o=r-t.values.length;if(o<n)return-1;if(!t.failure){for(let _=n;_<=o;_++)if(Re(e,_,t))return _;return-1}let s=0;for(let _=n;_<r;_++){for(;s>0&&e[_]!==t.values[s];)s=t.failure[s-1];if(e[_]===t.values[s]&&(s++,s===t.values.length))return _-s+1}return-1}function Ye(e,t){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&Re(e,0,t.segments[0]);let n=0,r=t.segments.length,o=0,s=e.length;if(!t.startsWithWildcard){let _=t.segments[0];if(!Re(e,0,_))return!1;o=_.values.length,n++}if(!t.endsWithWildcard){r--;let _=t.segments[r];if(s-=_.values.length,!Re(e,s,_))return!1}for(let _=n;_<r;_++){let a=t.segments[_],i=xr(e,a,o,s);if(i===-1)return!1;o=i+a.values.length}return!0}function Cr(e,t,n){let r=Nt(e,t,n);if(r!==void 0)return r;let o=Je(t,n);return o.asciiOnly?Ze(e,o,n):Ye(Ge(e,n),o)}function mt(e,t,n,r){var _;let o=Nt(e,t,n);if(o!==void 0)return o;let s=Je(t,n);return s.asciiOnly?Ze(e,s,n):((_=r.tokens)!=null||(r.tokens=Ge(e,n)),Ye(r.tokens,s))}function kr(e,t){let n=e.charCodeAt(0)===33,r=n?e.slice(1):e;return{compiled:r.length===0?void 0:Je(r,t),negative:n}}function Le(e,t,n,r){var s;let o;return t.compiled?t.compiled.asciiOnly?o=Ze(e,t.compiled,n):((s=r.tokens)!=null||(r.tokens=Ge(e,n)),o=Ye(r.tokens,t.compiled)):o=e.length===0,t.negative?!o:o}function Ar(e,t){let n=(t==null?void 0:t.caseSensitiveMatch)===!0,r=typeof e=="string"?[e]:Array.from(new Set(e));if(r.length===0)return()=>!1;let o=r.map(s=>kr(s,n));if(typeof e=="string"){let s=o[0];return _=>Le(_,s,n,{})}return s=>{let _={},a=!1,i=!1;for(let u of o)if(u.negative){if(!Le(s,u,n,_))return!1}else a=!0,!i&&Le(s,u,n,_)&&(i=!0);return a?i:!0}}function Sr(e,t,n){if(typeof t!="string"&&!t.length)return!1;let r=n===void 0?!1:n.caseSensitiveMatch===!0;if(typeof t=="string"){let a=t.charCodeAt(0)===33,i=a?t.slice(1):t,u=Cr(e,i,r);return a?!u:u}let o={},s=!1,_=!1;for(let a of t){let i=a.charCodeAt(0)===33,u=i?a.slice(1):a;if(i){if(mt(e,u,r,o))return!1}else s=!0,!_&&mt(e,u,r,o)&&(_=!0)}return s?_:!0}var Mt="8.2.4";var Rr=Object.prototype.toString,Dr=typeof self=="object"?self:global,Ir=new Map([[null,"Object"],[Date.prototype,"Date"],[RegExp.prototype,"RegExp"],[Promise.prototype,"Promise"],[Map.prototype,"Map"],[Set.prototype,"Set"],[WeakMap.prototype,"WeakMap"],[WeakSet.prototype,"WeakSet"],[DataView.prototype,"DataView"],[Object.getPrototypeOf(new Map().entries()),"Map Iterator"],[Object.getPrototypeOf(new Set().entries()),"Set Iterator"],[Object.getPrototypeOf([][Symbol.iterator]()),"Array Iterator"],[Object.getPrototypeOf(""[Symbol.iterator]()),"String Iterator"]]);function P(e){var o,s,_;let t=typeof e;if(t!=="object")return t;if(e===null)return"null";if(e===Dr)return"global";let n=e;if(Array.isArray(n)&&!(Symbol.toStringTag in n))return"Array";if(typeof window=="object"&&window!==null){if(n===window.location)return"Location";if(n===window.document)return"Document";if(n===((o=window.navigator)==null?void 0:o.mimeTypes))return"MimeTypeArray";if(n===((s=window.navigator)==null?void 0:s.plugins))return"PluginArray";if(typeof window.HTMLElement=="function"&&n instanceof window.HTMLElement){if(n.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(n.tagName==="TD")return"HTMLTableDataCellElement";if(n.tagName==="TH")return"HTMLTableHeaderCellElement"}}let r=n[Symbol.toStringTag];return typeof r=="string"?r:(_=Ir.get(Object.getPrototypeOf(n)))!=null?_:Rr.call(n).slice(8,-1)}var Fr=Mt,{formatDiagnosticValue:Q,isPlainObject:q,match:Wt}=De,Bt,Ie=(Bt=Object.getOwnPropertyDescriptor(De,"createMatcher"))==null?void 0:Bt.value,X=Object.freeze([]),Ut=Object.freeze({}),Ne={acceptArrays:!1,acceptArraysIgnore:X,enforceStrictKeyset:!0,ignoreKeys:X,ignorePaths:X,msg:"check-types-mini",optsVarName:"opts",reportCompletionFunc:null,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,schema:Ut},$r=Object.freeze(ut({},Ne)),$e=class extends TypeError{constructor(n,r,o={}){var _,a;let s=o.context||Ne.msg;super("check-types-mini/checkTypesMini(): [".concat(n,"] ").concat(s,": ").concat(r));H(this,"actualType");H(this,"context");H(this,"expectedTypes");H(this,"name","CheckTypesMiniError");H(this,"path");H(this,"reason");H(this,"validatorCode");this.actualType=(_=o.actualType)!=null?_:null,this.context=s,this.expectedTypes=o.expectedTypes?Object.freeze(Array.from(o.expectedTypes)):null,this.path=Object.freeze(Array.from((a=o.path)!=null?a:X)),this.reason=r,this.validatorCode=n}toJSON(){return{actualType:this.actualType,context:this.context,expectedTypes:this.expectedTypes,message:this.message,name:this.name,path:this.path,reason:this.reason,validatorCode:this.validatorCode}}},rt=new Set(["all","any","anything","every","everything","whatever","whatevs"]),ue=Object.prototype.hasOwnProperty,Fe={caseSensitiveMatch:!0},Nr=new Map,Mr=new Map,Wr=100,Hr=new Set(["acceptArrays","acceptArraysIgnore","enforceStrictKeyset","ignoreKeys","ignorePaths","msg","optsVarName","reportCompletionFunc","reportProgressFunc","reportProgressFuncFrom","reportProgressFuncTo","schema"]);function nt(){return{children:new Map,descriptors:null,implicitContainer:!1}}var Ht=nt();function Er(e){return"keys"in e}function Vr(e){return"keys"in e}function ee(e){if(!e)return[];let t=new Array(e.depth),n=e;for(;n;)t[n.depth-1]=n.segment,n=n.parent;return t}function K(e,t){let n=e;for(let r of ee(t))/^(?:[A-Za-z_$][A-Za-z0-9_$]*|\d+)$/u.test(r)?n+=".".concat(r):n+="[".concat(JSON.stringify(r),"]");return n}function Oe(e){let t="";for(let n of e)n==="%"?t+="%25":n==="."?t+="%2E":n==="\\"?t+="%5C":t+=n;return t}function Lr(e){return e.encoded}function Et(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r==="\\"&&n+1<e.length){let o=e[n+1];o==="."?t+="%2E":o==="%"?t+="%25":o==="\\"?t+="%5C":t+="\\".concat(o),n++}else r==="%"?t+="%25":t+=r}return t}function Xe(e,t){if(!e.length)return null;if(e.length===1){let r=e[0],o=t?Mr:Nr,s=o.get(r);if(s)return s;let _=t?Et(r):r,a=Ie?Ie(_,Fe):i=>Wt(i,_,Fe);return o.size<Wr&&o.set(r,a),a}let n=t?e.map(Et):Array.from(e);return Ie?Ie(n,Fe):r=>Wt(r,n,Fe)}function Kr(e){let t=[],n="";for(let r=0;r<e.length;r++){let o=e[r];o==="\\"&&r+1<e.length?(n+=e[r+1],r++):o==="."?(t.push(n),n=""):n+=o}return t.push(n),t}function Vt(e,t){if(t.some(r=>rt.has(r)))return!0;if(e===!0)return t.includes("true")||t.includes("boolean");if(e===!1)return t.includes("false")||t.includes("boolean");let n=P(e).toLowerCase();return n==="object"&&t.includes("object")?q(e):t.includes(n)}function et(e){return e.includes("object")&&!e.some(t=>rt.has(t))}function zr(e){let t=Array.isArray(e)?e:[e];if(!t.length)return null;let n=[];for(let r=0;r<t.length;r++){if(!ue.call(t,r))return null;let o=t[r];if(o!=null&&typeof o!="string")return null;let s=String(o).toLowerCase().trim();if(!s)return null;n.includes(s)||n.push(s)}return n}function se(e){return Array.isArray(e)?Object.keys(e).filter(t=>{let n=Number(t);return Number.isInteger(n)&&n>=0&&n<e.length&&String(n)===t}):Object.keys(e)}function Br(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function Lt(e,t){if(e)try{e(t)}catch(n){}}function k(e,t,n={}){throw new $e(e,t,n)}function L(e,t){return ue.call(e,t)&&e[t]!==void 0?e[t]:Ne[t]}function ve(e,t){return e[t]}function Kt(e,t,n){return!!(t!=null&&t(e)||n!=null&&n(Oe(e)))}function ce(e,t,n,r,o){return k(e,t,{actualType:r,context:o,path:ee(n)})}function tt(e,t){if(e===void 0)return Array.from(t);let n=typeof e=="string"?[e]:e;if(!Array.isArray(n))return null;let r=[];for(let o=0;o<n.length;o++){if(!ue.call(n,o)||typeof n[o]!="string")return null;r.push(n[o])}return r}function Ur(...e){var st,_t,it;let[t,n,r]=e;q(t)||k("THROW_ID_01","The first argument must be a plain object; received ".concat(Q(t,4),"."),{actualType:P(t).toLowerCase()}),(e.length<2||n!==null&&!q(n))&&k("THROW_ID_02","The second argument must be a plain object or null; received ".concat(Q(n,4),". Pass null explicitly when validating against only a schema."),{actualType:P(n).toLowerCase()}),r!=null&&!q(r)&&k("THROW_ID_03","The third argument must be a plain options object, null, or undefined; received ".concat(Q(r,4),"."),{actualType:P(r).toLowerCase()});let o=r!=null?r:Ut,s=Object.keys(o).find(p=>!Hr.has(p));s!==void 0&&k("THROW_ID_04","Unknown option ".concat(Q(s),"."),{path:[s]});let _=tt(L(o,"ignoreKeys"),X),a=tt(L(o,"ignorePaths"),X),i=tt(L(o,"acceptArraysIgnore"),X);(!_||!a||!i)&&k("THROW_ID_05","opts.ignoreKeys, opts.ignorePaths, and opts.acceptArraysIgnore must each be a string or a dense array of strings.");let u=L(o,"acceptArrays"),x=L(o,"enforceStrictKeyset");(typeof u!="boolean"||typeof x!="boolean")&&k("THROW_ID_06","opts.acceptArrays and opts.enforceStrictKeyset must be Booleans.");let A=L(o,"schema");q(A)||k("THROW_ID_07","opts.schema was customised to ".concat(Q(A)," which is not a plain object but ").concat(P(A).toLowerCase(),"."),{actualType:P(A).toLowerCase(),path:["schema"]});let b=L(o,"msg"),S=L(o,"optsVarName");(typeof b!="string"||typeof S!="string")&&k("THROW_ID_08","opts.msg and opts.optsVarName must be strings.");let l=b.trim();l.endsWith(":")&&(l=l.slice(0,-1).trim()),l||(l=Ne.msg);let g=S,h=L(o,"reportCompletionFunc"),j=L(o,"reportProgressFunc");(h!==null&&typeof h!="function"||j!==null&&typeof j!="function")&&k("THROW_ID_09","opts.reportCompletionFunc and opts.reportProgressFunc must each be a function, null, or undefined.",{context:l});let O=L(o,"reportProgressFuncFrom"),T=L(o,"reportProgressFuncTo");(!Number.isFinite(O)||!Number.isFinite(T))&&k("THROW_ID_10","opts.reportProgressFuncFrom and opts.reportProgressFuncTo must be finite numbers.",{context:l}),O>T&&k("THROW_ID_11","opts.reportProgressFuncFrom cannot exceed opts.reportProgressFuncTo; received ".concat(O," and ").concat(T,"."),{context:l});let d={acceptArrays:u,acceptArraysIgnore:i,enforceStrictKeyset:x,ignoreKeys:_,ignorePaths:a,msg:l,optsVarName:g,reportCompletionFunc:h,reportProgressFunc:j,reportProgressFuncFrom:O,reportProgressFuncTo:T,schema:A},M=!!(d.reportCompletionFunc||d.reportProgressFunc),Te=d.reportCompletionFunc?Date.now():0,te=0,E=0,pe=0,fe=0,_e=0,J=0,ne=0,de,z=null,c=null;M&&(z=(p=!1)=>{if(!d.reportProgressFunc)return;let w=d.reportProgressFuncTo-d.reportProgressFuncFrom,m=p?d.reportProgressFuncTo:d.reportProgressFuncFrom+w*Math.min(.99,ne/(ne+1e3));m!==de&&(de=m,Lt(d.reportProgressFunc,m))},c=()=>{ne++,ne%1e3===0&&(z==null||z())},z());let f=t,y=n,R=A,D=se(R),F=D.length?nt():Ht,B="THROW_ID_12",qt="THROW_ID_13",G=D.length?new Set([R]):null,he=D.length?[{value:R},{index:0,keys:D,node:F,path:null,value:R}]:[];for(;he.length;){let p=he.pop();if(!Vr(p)){G==null||G.delete(p.value);continue}if(p.index>=p.keys.length)continue;let w=p.keys[p.index++];he.push(p);let m=ve(p.value,w),v=Kr(w),N=p.node,C=p.path;for(let oe=0;oe<v.length;oe++){let W=v[oe],V=N.children.get(W);V||(V=nt(),N.children.set(W,V),fe++,c==null||c()),C={depth:((st=C==null?void 0:C.depth)!=null?st:0)+1,encoded:C?"".concat(C.encoded,".").concat(Oe(W)):Oe(W),parent:C,segment:W},oe<v.length-1&&(V.descriptors&&!et(V.descriptors)&&ce(B,"".concat(K("schema",C)," cannot have both a terminal descriptor and nested schema paths."),C,null,l),V.implicitContainer=!0),C.depth>E&&(E=C.depth),N=V}if(q(m)){N.descriptors&&!et(N.descriptors)&&ce(B,"".concat(K("schema",C)," cannot have both a terminal descriptor and nested schema paths."),C,"object",l),N.implicitContainer=!0,G!=null&&G.has(m)&&ce(qt,"".concat(K("schema",C)," contains a cycle. Cyclic schemas are not supported."),C,"object",l),G==null||G.add(m),he.push({value:m}),he.push({index:0,keys:se(m),node:N,path:C,value:m});continue}let $=zr(m);$||ce(B,"".concat(K("schema",C)," must be a non-empty type name, null, undefined, or a dense array of those values; received ").concat(Q(m,4),"."),C,P(m).toLowerCase(),l);let re=$;N.descriptors&&ce(B,"".concat(K("schema",C)," is declared more than once."),C,P(m).toLowerCase(),l),(N.children.size||N.implicitContainer)&&!et(re)&&ce(B,"".concat(K("schema",C)," cannot have both a terminal descriptor and nested schema paths."),C,P(m).toLowerCase(),l),N.descriptors=re}let ge=Xe(d.ignoreKeys,!1),me=Xe(d.ignorePaths,!0),ie=Xe(d.acceptArraysIgnore,!1),ot=se(f),Qt=y?se(y):X;if(d.enforceStrictKeyset&&!y&&F.children.size===0&&k("THROW_ID_14","Both ".concat(d.optsVarName,".schema and reference objects are missing! We don't have anything to match the keys as requested via ").concat(d.optsVarName,".enforceStrictKeyset."),{context:l}),d.enforceStrictKeyset){let p=ot.filter(w=>!Kt(w,ge,me)&&!(y&&ue.call(y,w))&&!F.children.has(w));if(p.length){let w=p.length>1,m=F.children.size?"The ".concat(d.optsVarName,".enforceStrictKeyset is on and the following key").concat(w?"s are":" is"," not covered by schema and/or reference objects: ").concat(p.join(", ")):"The input object has key".concat(w?"s":""," which ").concat(w?"are":"is"," not covered by the reference object: ").concat(p.join(", "));k("THROW_ID_15",m,{context:l})}}if(d.enforceStrictKeyset&&y){let p=Qt.filter(w=>!ue.call(f,w)&&!Kt(w,ge,me));if(p.length){let w=p.length>1;k("THROW_ID_16","The reference object has key".concat(w?"s":""," which ").concat(w?"are":"is"," not present in the input object: ").concat(p.join(", ")),{context:l})}}let ae=[f],U=null,ye=[{value:f},{index:0,keys:ot,path:null,refValue:y,schemaNode:F,value:f}];for(;ye.length;){let p=ye.pop();if(!Er(p)){ae.pop(),U==null||U.delete(p.value),U&&ae.length<=32&&(U=null);continue}if(p.index>=p.keys.length)continue;let w=p.keys[p.index++];ye.push(p);let m={depth:((it=(_t=p.path)==null?void 0:_t.depth)!=null?it:0)+1,encoded:p.path?"".concat(p.path.encoded,".").concat(Oe(w)):Oe(w),parent:p.path,segment:w};M&&(Array.isArray(p.value)?te++:pe++,m.depth>E&&(E=m.depth),c==null||c());let v=ve(p.value,w),N=Array.isArray(p.value);if(!!(!N&&(ge!=null&&ge(w))||me!=null&&me(Lr(m)))){M&&_e++;continue}let $=p.schemaNode.children.get(w),re=!1;if($!=null&&$.descriptors){let Y=$.descriptors;if(Y.some(be=>rt.has(be))){M&&_e++;continue}if(M&&(J++,c==null||c()),Vt(v,Y))if(($.implicitContainer||$.children.size)&&q(v))re=!0;else continue;if(!re&&d.acceptArrays&&Array.isArray(v)&&!(ie!=null&&ie(w))){let be=se(v);for(let we of be){let je=ve(v,we);M&&(te++,J++,m.depth+1>E&&(E=m.depth+1),c==null||c()),Vt(je,Y)||Qr(je,Y,m,Number(we),d,l)}continue}re||zt(v,Y,m,d,l)}let oe=!1,W;Br(p.refValue)&&ue.call(p.refValue,w)&&(oe=!0,W=ve(p.refValue,w));let V=!1,Jt=W,Gt=$!=null?$:Ht;if($&&($.implicitContainer||$.children.size))re||(M&&(J++,c==null||c()),q(v)||zt(v,["object"],m,d,l)),V=!0;else if(oe){if(d.acceptArrays&&Array.isArray(v)&&!Array.isArray(W)&&!(ie!=null&&ie(w))){let Y=P(W).toLowerCase(),be=se(v);for(let we of be){let je=ve(v,we);M&&(te++,J++,m.depth+1>E&&(E=m.depth+1),c==null||c());let at=P(je).toLowerCase();at!==Y&&Jr(at,Y,m,Number(we),d,l)}continue}M&&(J++,c==null||c()),P(v)!==P(W)&&Gr(v,W,m,d,l),(Array.isArray(v)&&Array.isArray(W)||q(v))&&(V=!0)}else d.enforceStrictKeyset&&(!N||q(v)||Array.isArray(v))&&qr(m,d,l);V&&((U?U.has(v):ae.includes(v))&&Zr(m,d,l),ae.push(v),U?U.add(v):ae.length>32&&(U=new Set(ae)),ye.push({value:v}),ye.push({index:0,keys:se(v),path:m,refValue:Jt,schemaNode:Gt,value:v}))}z==null||z(!0),Lt(d.reportCompletionFunc,Object.freeze({arrayElementsVisited:te,maxDepth:E,objectPropertiesVisited:pe,schemaEntries:fe,timeTakenInMilliseconds:d.reportCompletionFunc?Date.now()-Te:0,valuesIgnored:_e,valuesValidated:J}))}function qr(e,t,n){return k("THROW_ID_17","".concat(K(t.optsVarName,e)," is neither covered by reference object (second input argument), nor ").concat(t.optsVarName,".schema! To stop this error, turn off ").concat(t.optsVarName,".enforceStrictKeyset or provide a type reference."),{context:n,path:ee(e)})}function zt(e,t,n,r,o){let s=P(e).toLowerCase(),_=s==="string"?"":'"';return k("THROW_ID_18","".concat(K(r.optsVarName,n)," was customised to ").concat(_).concat(Q(e)).concat(_," (type: ").concat(s,") which is not among the allowed types in schema (which is equal to ").concat(Q(t),")"),{actualType:s,context:o,expectedTypes:t,path:ee(n)})}function Qr(e,t,n,r,o,s){return k("THROW_ID_19","".concat(K(o.optsVarName,n),".").concat(r,", the ").concat(r,"th element (equal to ").concat(Q(e),") is of a type ").concat(P(e).toLowerCase(),", but only the following are allowed by the ").concat(o.optsVarName,".schema: ").concat(t.join(", ")),{actualType:P(e).toLowerCase(),context:s,expectedTypes:t,path:ee({depth:n.depth+1,encoded:"".concat(n.encoded,".").concat(r),parent:n,segment:String(r)})})}function Jr(e,t,n,r,o,s){return k("THROW_ID_20","".concat(K(o.optsVarName,n)," was customised to be array, but not all of its elements are ").concat(t,"-type"),{actualType:e,context:s,expectedTypes:[t],path:ee({depth:n.depth+1,encoded:"".concat(n.encoded,".").concat(r),parent:n,segment:String(r)})})}function Gr(e,t,n,r,o){let s=P(e).toLowerCase(),_=P(t).toLowerCase(),a=s==="string"?"":'"';return k("THROW_ID_21","".concat(K(r.optsVarName,n)," was customised to ").concat(a).concat(Q(e)).concat(a," which is not ").concat(_," but ").concat(s),{actualType:s,context:o,expectedTypes:[_],path:ee(n)})}function Zr(e,t,n){return k("THROW_ID_22","".concat(K(t.optsVarName,e)," contains a cycle. Cyclic input structures are not supported."),{actualType:"object",context:n,path:ee(e)})}return tn(Yr);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-format-diagnostic-value
|
|
13
13
|
* @fileoverview Safely format untrusted JavaScript values for diagnostics
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/**
|
|
20
20
|
* @name codsen-utils
|
|
21
21
|
* @fileoverview Various utility functions
|
|
22
|
-
* @version 1.10.
|
|
22
|
+
* @version 1.10.2
|
|
23
23
|
* @author Roy Revelt
|
|
24
24
|
* @license MIT
|
|
25
25
|
* {@link https://codsen.com/os/codsen-utils/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "check-types-mini",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.4",
|
|
4
4
|
"description": "Validate options object",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compare",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"codsen-utils": "^1.10.
|
|
71
|
+
"codsen-utils": "^1.10.2"
|
|
72
72
|
},
|
|
73
73
|
"engines": {
|
|
74
74
|
"node": ">=18.20.8"
|