check-types-mini 8.2.2 → 8.2.3
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 +6 -0
- package/README.md +3 -1
- package/dist/check-types-mini.esm.js +2 -2
- package/dist/check-types-mini.umd.js +4 -4
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 8.2.3 (2026-09-06)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **check-types-mini:** replace type-detect with an internal TypeScript helper ([06d7446](https://github.com/codsen/codsen/commit/06d74468c3f28f432a8c4c4fd72d4f9807f34115))
|
|
11
|
+
|
|
6
12
|
## 8.2.2 (2026-09-01)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
<img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT Licence">
|
|
22
22
|
</p>
|
|
23
23
|
|
|
24
|
+
**No 3rd party dependencies.** All dependencies, checked recursively, are Codsen packages.
|
|
25
|
+
|
|
24
26
|
## Install
|
|
25
27
|
|
|
26
28
|
This package is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). If you're not ready yet, install an older version of this program, 6.1.0 (`npm i check-types-mini@6.1.0`).
|
|
@@ -63,7 +65,7 @@ assert.throws(
|
|
|
63
65
|
|
|
64
66
|
## Documentation
|
|
65
67
|
|
|
66
|
-
Please [visit codsen.com](https://codsen.com/os/check-types-mini/) for a full description of the API.
|
|
68
|
+
Please [visit codsen.com](https://codsen.com/os/check-types-mini/) for a full description of the API. For **Changelog**, see [raw md on GitHub](https://github.com/codsen/codsen/blob/main/packages/check-types-mini/CHANGELOG.md) or [the website](https://codsen.com/os/check-types-mini/changelog).
|
|
67
69
|
|
|
68
70
|
## Contributing
|
|
69
71
|
|
|
@@ -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.3
|
|
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 Me from"codsen-utils";import m from"type-detect";var Ce="8.2.2";var pt=Ce,{formatDiagnosticValue:_,isPlainObject:v,match:Fe}=Me,se=Object.getOwnPropertyDescriptor(Me,"createMatcher")?.value,C=Object.freeze([]),He=Object.freeze({}),ce={acceptArrays:!1,acceptArraysIgnore:C,enforceStrictKeyset:!0,ignoreKeys:C,ignorePaths:C,msg:"check-types-mini",optsVarName:"opts",reportCompletionFunc:null,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,schema:He},dt=Object.freeze({...ce}),ye=class extends TypeError{actualType;context;expectedTypes;name="CheckTypesMiniError";path;reason;validatorCode;constructor(t,n,r={}){let o=r.context||ce.msg;super(`check-types-mini/checkTypesMini(): [${t}] ${o}: ${n}`),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??C)),this.reason=n,this.validatorCode=t}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},Je=new Map,Ue=new Map,Ye=100,Ze=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 Se=be();function Ge(e){return"keys"in e}function Qe(e){return"keys"in e}function F(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 T(e,t){let n=e;for(let r of F(t))/^(?:[A-Za-z_$][A-Za-z0-9_$]*|\d+)$/u.test(r)?n+=`.${r}`:n+=`[${JSON.stringify(r)}]`;return n}function Y(e){let t="";for(let n of e)n==="%"?t+="%25":n==="."?t+="%2E":n==="\\"?t+="%5C":t+=n;return t}function Xe(e){return e.encoded}function $e(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+=`\\${o}`,n++}else r==="%"?t+="%25":t+=r}return t}function me(e,t){if(!e.length)return null;if(e.length===1){let r=e[0],o=t?Ue:Je,p=o.get(r);if(p)return p;let w=t?$e(r):r,j=se?se(w,ae):Z=>Fe(Z,w,ae);return o.size<Ye&&o.set(r,j),j}let n=t?e.map($e):Array.from(e);return se?se(n,ae):r=>Fe(r,n,ae)}function et(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 Ne(e,t){if(t.some(r=>Te.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=m(e).toLowerCase();return n==="object"&&t.includes("object")?v(e):t.includes(n)}function fe(e){return e.includes("object")&&!e.some(t=>Te.has(t))}function tt(e){let t=Array.isArray(e)?e:[e];if(!t.length)return null;let n=[];for(let r=0;r<t.length;r++){if(!V.call(t,r))return null;let o=t[r];if(o!=null&&typeof o!="string")return null;let p=String(o).toLowerCase().trim();if(!p)return null;n.includes(p)||n.push(p)}return n}function D(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 nt(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function De(e,t){if(e)try{e(t)}catch{}}function h(e,t,n={}){throw new ye(e,t,n)}function b(e,t){return V.call(e,t)&&e[t]!==void 0?e[t]:ce[t]}function U(e,t){return e[t]}function Ae(e,t,n){return!!(t?.(e)||n?.(Y(e)))}function H(e,t,n,r,o){return h(e,t,{actualType:r,context:o,path:F(n)})}function ge(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(!V.call(n,o)||typeof n[o]!="string")return null;r.push(n[o])}return r}function ht(...e){let[t,n,r]=e;v(t)||h("THROW_ID_01",`The first argument must be a plain object; received ${_(t,4)}.`,{actualType:m(t).toLowerCase()}),(e.length<2||n!==null&&!v(n))&&h("THROW_ID_02",`The second argument must be a plain object or null; received ${_(n,4)}. Pass null explicitly when validating against only a schema.`,{actualType:m(n).toLowerCase()}),r!=null&&!v(r)&&h("THROW_ID_03",`The third argument must be a plain options object, null, or undefined; received ${_(r,4)}.`,{actualType:m(r).toLowerCase()});let o=r??He,p=Object.keys(o).find(s=>!Ze.has(s));p!==void 0&&h("THROW_ID_04",`Unknown option ${_(p)}.`,{path:[p]});let w=ge(b(o,"ignoreKeys"),C),j=ge(b(o,"ignorePaths"),C),Z=ge(b(o,"acceptArraysIgnore"),C);(!w||!j||!Z)&&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"),ke=b(o,"enforceStrictKeyset");(typeof we!="boolean"||typeof ke!="boolean")&&h("THROW_ID_06","opts.acceptArrays and opts.enforceStrictKeyset must be Booleans.");let A=b(o,"schema");v(A)||h("THROW_ID_07",`opts.schema was customised to ${_(A)} which is not a plain object but ${m(A).toLowerCase()}.`,{actualType:m(A).toLowerCase(),path:["schema"]});let ve=b(o,"msg"),_e=b(o,"optsVarName");(typeof ve!="string"||typeof _e!="string")&&h("THROW_ID_08","opts.msg and opts.optsVarName must be strings.");let u=ve.trim();u.endsWith(":")&&(u=u.slice(0,-1).trim()),u||(u=ce.msg);let Ve=_e,ie=b(o,"reportCompletionFunc"),le=b(o,"reportProgressFunc");(ie!==null&&typeof ie!="function"||le!==null&&typeof le!="function")&&h("THROW_ID_09","opts.reportCompletionFunc and opts.reportProgressFunc must each be a function, null, or undefined.",{context:u});let G=b(o,"reportProgressFuncFrom"),Q=b(o,"reportProgressFuncTo");(!Number.isFinite(G)||!Number.isFinite(Q))&&h("THROW_ID_10","opts.reportProgressFuncFrom and opts.reportProgressFuncTo must be finite numbers.",{context:u}),G>Q&&h("THROW_ID_11",`opts.reportProgressFuncFrom cannot exceed opts.reportProgressFuncTo; received ${G} and ${Q}.`,{context:u});let c={acceptArrays:we,acceptArraysIgnore:Z,enforceStrictKeyset:ke,ignoreKeys:w,ignorePaths:j,msg:u,optsVarName:Ve,reportCompletionFunc:ie,reportProgressFunc:le,reportProgressFuncFrom:G,reportProgressFuncTo:Q,schema:A},P=!!(c.reportCompletionFunc||c.reportProgressFunc),Ke=c.reportCompletionFunc?Date.now():0,X=0,O=0,Pe=0,Oe=0,ue=0,W=0,ee=0,je,te=null,I=null;P&&(te=(s=!1)=>{if(!c.reportProgressFunc)return;let i=c.reportProgressFuncTo-c.reportProgressFuncFrom,a=s?c.reportProgressFuncTo:c.reportProgressFuncFrom+i*Math.min(.99,ee/(ee+1e3));a!==je&&(je=a,De(c.reportProgressFunc,a))},I=()=>{ee++,ee%1e3===0&&te?.()},te());let K=t,S=n,ne=A,re=D(ne),E=re.length?be():Se,L="THROW_ID_12",Ee="THROW_ID_13",pe=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(!Qe(s)){pe?.delete(s.value);continue}if(s.index>=s.keys.length)continue;let i=s.keys[s.index++];z.push(s);let a=U(s.value,i),l=et(i),f=s.node,d=s.path;for(let N=0;N<l.length;N++){let g=l[N],y=f.children.get(g);y||(y=be(),f.children.set(g,y),Oe++,I?.()),d={depth:(d?.depth??0)+1,encoded:d?`${d.encoded}.${Y(g)}`:Y(g),parent:d,segment:g},N<l.length-1&&(y.descriptors&&!fe(y.descriptors)&&H(L,`${T("schema",d)} cannot have both a terminal descriptor and nested schema paths.`,d,null,u),y.implicitContainer=!0),d.depth>O&&(O=d.depth),f=y}if(v(a)){f.descriptors&&!fe(f.descriptors)&&H(L,`${T("schema",d)} cannot have both a terminal descriptor and nested schema paths.`,d,"object",u),f.implicitContainer=!0,pe?.has(a)&&H(Ee,`${T("schema",d)} contains a cycle. Cyclic schemas are not supported.`,d,"object",u),pe?.add(a),z.push({value:a}),z.push({index:0,keys:D(a),node:f,path:d,value:a});continue}let k=tt(a);k||H(L,`${T("schema",d)} must be a non-empty type name, null, undefined, or a dense array of those values; received ${_(a,4)}.`,d,m(a).toLowerCase(),u);let $=k;f.descriptors&&H(L,`${T("schema",d)} is declared more than once.`,d,m(a).toLowerCase(),u),(f.children.size||f.implicitContainer)&&!fe($)&&H(L,`${T("schema",d)} cannot have both a terminal descriptor and nested schema paths.`,d,m(a).toLowerCase(),u),f.descriptors=$}let de=me(c.ignoreKeys,!1),he=me(c.ignorePaths,!0),Ie=me(c.acceptArraysIgnore,!1),Re=D(K),Le=S?D(S):C;if(c.enforceStrictKeyset&&!S&&E.children.size===0&&h("THROW_ID_14",`Both ${c.optsVarName}.schema and reference objects are missing! We don't have anything to match the keys as requested via ${c.optsVarName}.enforceStrictKeyset.`,{context:u}),c.enforceStrictKeyset){let s=Re.filter(i=>!Ae(i,de,he)&&!(S&&V.call(S,i))&&!E.children.has(i));if(s.length){let i=s.length>1,a=E.children.size?`The ${c.optsVarName}.enforceStrictKeyset is on and the following key${i?"s are":" is"} not covered by schema and/or reference objects: ${s.join(", ")}`:`The input object has key${i?"s":""} which ${i?"are":"is"} not covered by the reference object: ${s.join(", ")}`;h("THROW_ID_15",a,{context:u})}}if(c.enforceStrictKeyset&&S){let s=Le.filter(i=>!V.call(K,i)&&!Ae(i,de,he));if(s.length){let i=s.length>1;h("THROW_ID_16",`The reference object has key${i?"s":""} which ${i?"are":"is"} not present in the input object: ${s.join(", ")}`,{context:u})}}let M=[K],R=null,q=[{value:K},{index:0,keys:Re,path:null,refValue:S,schemaNode:E,value:K}];for(;q.length;){let s=q.pop();if(!Ge(s)){M.pop(),R?.delete(s.value),R&&M.length<=32&&(R=null);continue}if(s.index>=s.keys.length)continue;let i=s.keys[s.index++];q.push(s);let a={depth:(s.path?.depth??0)+1,encoded:s.path?`${s.path.encoded}.${Y(i)}`:Y(i),parent:s.path,segment:i};P&&(Array.isArray(s.value)?X++:Pe++,a.depth>O&&(O=a.depth),I?.());let l=U(s.value,i),f=Array.isArray(s.value);if(!!(!f&&de?.(i)||he?.(Xe(a)))){P&&ue++;continue}let k=s.schemaNode.children.get(i),$=!1;if(k?.descriptors){let x=k.descriptors;if(x.some(B=>Te.has(B))){P&&ue++;continue}if(P&&(W++,I?.()),Ne(l,x))if((k.implicitContainer||k.children.size)&&v(l))$=!0;else continue;if(!$&&c.acceptArrays&&Array.isArray(l)&&!Ie?.(i)){let B=D(l);for(let J of B){let oe=U(l,J);P&&(X++,W++,a.depth+1>O&&(O=a.depth+1),I?.()),Ne(oe,x)||ot(oe,x,a,Number(J),c,u)}continue}$||We(l,x,a,c,u)}let N=!1,g;nt(s.refValue)&&V.call(s.refValue,i)&&(N=!0,g=U(s.refValue,i));let y=!1,ze=g,qe=k??Se;if(k&&(k.implicitContainer||k.children.size))$||(P&&(W++,I?.()),v(l)||We(l,["object"],a,c,u)),y=!0;else if(N){if(c.acceptArrays&&Array.isArray(l)&&!Array.isArray(g)&&!Ie?.(i)){let x=m(g).toLowerCase(),B=D(l);for(let J of B){let oe=U(l,J);P&&(X++,W++,a.depth+1>O&&(O=a.depth+1),I?.());let xe=m(oe).toLowerCase();xe!==x&&st(xe,x,a,Number(J),c,u)}continue}P&&(W++,I?.()),m(l)!==m(g)&&at(l,g,a,c,u),(Array.isArray(l)&&Array.isArray(g)||v(l))&&(y=!0)}else c.enforceStrictKeyset&&(!f||v(l)||Array.isArray(l))&&rt(a,c,u);y&&((R?R.has(l):M.includes(l))&&ct(a,c,u),M.push(l),R?R.add(l):M.length>32&&(R=new Set(M)),q.push({value:l}),q.push({index:0,keys:D(l),path:a,refValue:ze,schemaNode:qe,value:l}))}te?.(!0),De(c.reportCompletionFunc,Object.freeze({arrayElementsVisited:X,maxDepth:O,objectPropertiesVisited:Pe,schemaEntries:Oe,timeTakenInMilliseconds:c.reportCompletionFunc?Date.now()-Ke:0,valuesIgnored:ue,valuesValidated:W}))}function rt(e,t,n){return h("THROW_ID_17",`${T(t.optsVarName,e)} is neither covered by reference object (second input argument), nor ${t.optsVarName}.schema! To stop this error, turn off ${t.optsVarName}.enforceStrictKeyset or provide a type reference.`,{context:n,path:F(e)})}function We(e,t,n,r,o){let p=m(e).toLowerCase(),w=p==="string"?"":'"';return h("THROW_ID_18",`${T(r.optsVarName,n)} was customised to ${w}${_(e)}${w} (type: ${p}) which is not among the allowed types in schema (which is equal to ${_(t)})`,{actualType:p,context:o,expectedTypes:t,path:F(n)})}function ot(e,t,n,r,o,p){return h("THROW_ID_19",`${T(o.optsVarName,n)}.${r}, the ${r}th element (equal to ${_(e)}) is of a type ${m(e).toLowerCase()}, but only the following are allowed by the ${o.optsVarName}.schema: ${t.join(", ")}`,{actualType:m(e).toLowerCase(),context:p,expectedTypes:t,path:F({depth:n.depth+1,encoded:`${n.encoded}.${r}`,parent:n,segment:String(r)})})}function st(e,t,n,r,o,p){return h("THROW_ID_20",`${T(o.optsVarName,n)} was customised to be array, but not all of its elements are ${t}-type`,{actualType:e,context:p,expectedTypes:[t],path:F({depth:n.depth+1,encoded:`${n.encoded}.${r}`,parent:n,segment:String(r)})})}function at(e,t,n,r,o){let p=m(e).toLowerCase(),w=m(t).toLowerCase(),j=p==="string"?"":'"';return h("THROW_ID_21",`${T(r.optsVarName,n)} was customised to ${j}${_(e)}${j} which is not ${w} but ${p}`,{actualType:p,context:o,expectedTypes:[w],path:F(n)})}function ct(e,t,n){return h("THROW_ID_22",`${T(t.optsVarName,e)} contains a cycle. Cyclic input structures are not supported.`,{actualType:"object",context:n,path:F(e)})}export{ye as CheckTypesMiniError,ht as checkTypesMini,dt as defaults,pt as version};
|
|
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};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name check-types-mini
|
|
3
3
|
* @fileoverview Validate options object
|
|
4
|
-
* @version 8.2.
|
|
4
|
+
* @version 8.2.3
|
|
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 tn=Object.create;var Oe=Object.defineProperty;var nn=Object.getOwnPropertyDescriptor;var rn=Object.getOwnPropertyNames,ut=Object.getOwnPropertySymbols,on=Object.getPrototypeOf,pt=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable;var Me=(e,t,n)=>t in e?Oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ft=(e,t)=>{for(var n in t||(t={}))pt.call(t,n)&&Me(e,n,t[n]);if(ut)for(var n of ut(t))sn.call(t,n)&&Me(e,n,t[n]);return e};var _n=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},dt=(e,t)=>{for(var n in t)Oe(e,n,{get:t[n],enumerable:!0})},ht=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rn(t))!pt.call(e,o)&&o!==n&&Oe(e,o,{get:()=>t[o],enumerable:!(r=nn(t,o))||r.enumerable});return e};var an=(e,t,n)=>(n=e!=null?tn(on(e)):{},ht(t||!e||!e.__esModule?Oe(n,"default",{value:e,enumerable:!0}):n,e)),ln=e=>ht(Oe({},"__esModule",{value:!0}),e);var H=(e,t,n)=>Me(e,typeof t!="symbol"?t+"":t,n);var Ht=_n((Xe,et)=>{(function(e,t){typeof Xe=="object"&&typeof et<"u"?et.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.typeDetect=t())})(Xe,(function(){"use strict";var e=typeof Promise=="function",t=(function(y){if(typeof globalThis=="object")return globalThis;Object.defineProperty(y,"typeDetectGlobalObject",{get:function(){return this},configurable:!0});var J=typeDetectGlobalObject;return delete y.typeDetectGlobalObject,J})(Object.prototype),n=typeof Symbol<"u",r=typeof Map<"u",o=typeof Set<"u",s=typeof WeakMap<"u",i=typeof WeakSet<"u",a=typeof DataView<"u",_=n&&typeof Symbol.iterator<"u",u=n&&typeof Symbol.toStringTag<"u",k=o&&typeof Set.prototype.entries=="function",A=r&&typeof Map.prototype.entries=="function",b=k&&Object.getPrototypeOf(new Set().entries()),P=A&&Object.getPrototypeOf(new Map().entries()),l=_&&typeof Array.prototype[Symbol.iterator]=="function",g=l&&Object.getPrototypeOf([][Symbol.iterator]()),f=_&&typeof String.prototype[Symbol.iterator]=="function",x=f&&Object.getPrototypeOf(""[Symbol.iterator]()),v=8,O=-1;function d(y){var J=typeof y;if(J!=="object")return J;if(y===null)return"null";if(y===t)return"global";if(Array.isArray(y)&&(u===!1||!(Symbol.toStringTag in y)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&y===window.location)return"Location";if(typeof window.document=="object"&&y===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&y===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&y===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&y instanceof window.HTMLElement){if(y.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(y.tagName==="TD")return"HTMLTableDataCellElement";if(y.tagName==="TH")return"HTMLTableHeaderCellElement"}}var z=u&&y[Symbol.toStringTag];if(typeof z=="string")return z;var S=Object.getPrototypeOf(y);return S===RegExp.prototype?"RegExp":S===Date.prototype?"Date":e&&S===Promise.prototype?"Promise":o&&S===Set.prototype?"Set":r&&S===Map.prototype?"Map":i&&S===WeakSet.prototype?"WeakSet":s&&S===WeakMap.prototype?"WeakMap":a&&S===DataView.prototype?"DataView":r&&S===P?"Map Iterator":o&&S===b?"Set Iterator":l&&S===g?"Array Iterator":f&&S===x?"String Iterator":S===null?"Object":Object.prototype.toString.call(y).slice(v,O)}return d}))});var no={};dt(no,{CheckTypesMiniError:()=>$e,checkTypesMini:()=>Jr,defaults:()=>Wr,version:()=>Er});var De={};dt(De,{backslash:()=>xn,backtick:()=>kn,codsenCLI:()=>Or,compareFn:()=>ur,createMatcher:()=>$r,deepClone:()=>Ln,deepCloneWithMetadata:()=>Kn,detectEol:()=>Et,doublePrime:()=>jn,ellipsis:()=>wn,existy:()=>_r,findAllIdx:()=>sr,formatDiagnosticValue:()=>ke,hairspace:()=>vn,hasOwnProp:()=>cr,includes:()=>dr,inlineTags:()=>fr,intersection:()=>hr,isBool:()=>nr,isCurrencyChar:()=>Bn,isCurrencySymbol:()=>Un,isDate:()=>Mt,isInt:()=>tr,isLatinLetter:()=>Qn,isLetter:()=>qn,isLowercaseLetter:()=>Jn,isNull:()=>rr,isNum:()=>$t,isNumberChar:()=>zn,isPlainObject:()=>Ft,isQuote:()=>Gn,isRegExp:()=>Qe,isStr:()=>$,isUppercaseLetter:()=>Zn,isWhitespaceChar:()=>Yn,leftDoubleQuote:()=>kt,leftSingleQuote:()=>xt,match:()=>Nr,multiplicationSign:()=>Cn,omit:()=>Tr,pullAll:()=>ir,punctuationChars:()=>An,rawMDash:()=>mn,rawNDash:()=>yn,rawNbsp:()=>bn,rawReplacementMark:()=>Sn,removeTrailingSlash:()=>Xn,resolveEolSetting:()=>lr,rightDoubleQuote:()=>Ct,rightSingleQuote:()=>St,singlePrime:()=>Tn,stringSplice:()=>er,thinSpace:()=>On,trimChars:()=>or,uniq:()=>ar,version:()=>gn,voidTags:()=>pr});function cn(){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 un(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function Se(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(un(r)):e.append(t[n])}e.append('"')}}function pn(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function yt(e,t){e.append("Symbol(");let n=String(t);n.length>8&&Se(e,n.slice(7,-1)),e.append(")")}function gt(e,t){typeof t=="symbol"?yt(e,t):Se(e,String(t))}function ke(e,t=0){let n=cn(),r=t===4?4:0,o=new WeakSet,s=0;function i(l){r&&n.append(" ".repeat(l*r))}function a(l,g){l&&n.append(","),r&&(n.append("\n"),i(g+1))}function _(l,g,f){r&&g&&(n.append("\n"),i(f)),n.append(l)}function u(l,g){Object.prototype.hasOwnProperty.call(l,"value")?P(l.value,g):n.append(pn(l))}function k(l,g){let f;try{f=Reflect.getOwnPropertyDescriptor(l,"length")}catch(O){n.append("[Uninspectable]");return}let x=f==null?void 0:f.value;if(!Number.isSafeInteger(x)||x<0){n.append("[Uninspectable]");return}n.append("[");let v=!1;for(let O=0;O<x&&!n.stopped();O+=1){if(a(v,g),v=!0,s>=50){n.append("[MaxEntries]");break}s+=1;let d;try{d=Reflect.getOwnPropertyDescriptor(l,String(O))}catch(y){n.append("[Uninspectable]");continue}d!=null&&d.enumerable?u(d,g+1):n.append("[Empty]")}_("]",v,g)}function A(l,g){let f;try{f=Reflect.ownKeys(l)}catch(v){n.append("[Uninspectable]");return}n.append("{");let x=!1;for(let v of f){if(n.stopped())break;if(s>=50){a(x,g),x=!0,Se(n,"\u2026"),n.append(r?": ":":"),n.append("[MaxEntries]");break}s+=1;let O;try{O=Reflect.getOwnPropertyDescriptor(l,v)}catch(d){a(x,g),x=!0,gt(n,v),n.append(r?": ":":"),n.append("[Uninspectable]");continue}O!=null&&O.enumerable&&(a(x,g),x=!0,gt(n,v),n.append(r?": ":":"),u(O,g+1))}_("}",x,g)}function b(l,g){if(o.has(l)){n.append("[Circular]");return}if(g>=5){n.append("[MaxDepth]");return}let f;try{f=Array.isArray(l)}catch(x){n.append("[Uninspectable]");return}o.add(l);try{f?k(l,g):A(l,g)}finally{o.delete(l)}}function P(l,g){l===null?n.append("null"):typeof l=="string"?Se(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"?yt(n,l):typeof l=="function"?n.append("[Function]"):b(l,g)}try{return P(e,0),n.result()}catch(l){return"[Uninspectable]"}}var fn="1.10.0",dn=["_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(""),Ee=dn.slice(1).split("_"),Ke=[],mt=127;for(let e=0;e<Ee.length;e+=2){let t=mt+1+Number.parseInt(Ee[e],36),n=t+Number.parseInt(Ee[e+1],36);Ke.push([t,n]),mt=n}function hn(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 gn=fn,xt="\u2018",St="\u2019",kt="\u201C",Ct="\u201D",yn="\u2013",mn="\u2014",bn="\xA0",wn="\u2026",vn="\u200A",On="\u2009",Tn="\u2032",jn="\u2033",xn="\\",Sn="\uFFFD",kn="`",Cn="\xD7",An=[".",",",";","!","?"],At=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"]),Ae=Object.prototype.hasOwnProperty,Pt=Function.prototype.toString,Pn=Pt.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 Rt(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 Rn(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let s=Buffer.from(e);return t.set(e,s),s}let n=Rt(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 Dt(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function Ce(e,t,n,r){for(let o of n){let s=t[o],i=typeof s!="object"||s===null?s:X(s,r);o==="__proto__"?Dt(e,o,i):e[o]=i}}function ce(e,t,n,r){for(let o of n){let s=Object.getOwnPropertyDescriptor(t,o);if(s){if("value"in s){let i=s.value;s.value=typeof i!="object"||i===null?i:X(i,r)}Object.defineProperty(e,o,s)}}}var Dn=Map.prototype.entries,In=Set.prototype.values,Ue=Object.prototype.toString,vt,Fn=(vt=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:vt.get,Ot,$n=(Ot=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:Ot.get,Tt,Nn=(Tt=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:Tt.get,jt,It=(jt=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:jt.get,Mn=RegExp.prototype.test,We;function En(e){if(e instanceof ArrayBuffer)return!0;try{return Fn.call(e),!0}catch(t){return!1}}function Wn(e){try{return Dn.call(e)}catch(t){return null}}function Hn(e){try{return In.call(e)}catch(t){return null}}function Vn(e){var t;try{return We||(We=(t=Object.getOwnPropertyDescriptor(URL.prototype,"href"))==null?void 0:t.get),We.call(e)}catch(n){return null}}function X(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 _=e.length,u=new Array(_);t.set(e,u);let k=e,A=Object.keys(e);if(A.length===_&&(_===0||A[_-1]==="".concat(_-1)))for(let b=0;b<_;b++){let P=k[b];u[b]=typeof P!="object"||P===null?P:X(P,t)}else Ce(u,k,A,t);return u}let r=Object.getPrototypeOf(e);if(r===Object.prototype){let _={};return t.set(e,_),Ce(_,e,Object.keys(e),t),_}if(r===null){let _=Object.create(null);return t.set(e,_),Ce(_,e,Object.keys(e),t),_}if(Mt(e)){let _=new Date(Nt.call(e));return t.set(e,_),ce(_,e,Object.keys(e),t),_}if(ArrayBuffer.isView(e))return Rn(e,t);if(En(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return Rt(e,t);let o=Wn(e);if(o){let _=new Map;t.set(e,_);for(let[u,k]of o)_.set(X(u,t),X(k,t));return ce(_,e,Object.keys(e),t),_}let s=Hn(e);if(s){let _=new Set;t.set(e,_);for(let u of s)_.add(X(u,t));return ce(_,e,Object.keys(e),t),_}if(Qe(e)&&e!==RegExp.prototype){let _=new RegExp(It.call(e),$n.call(e));return _.lastIndex=e.lastIndex,t.set(e,_),ce(_,e,Object.keys(e),t),_}let i=Vn(e);if(i!==null){let _=new URL(i);return t.set(e,_),ce(_,e,Object.keys(e),t),_}if(e instanceof Error||Ue.call(e)==="[object Error]"){let _=Object.create(Object.getPrototypeOf(e));return t.set(e,_),ce(_,e,Reflect.ownKeys(e),t),_}let a=Object.create(r);return t.set(e,a),Ce(a,e,Object.keys(e),t),a}function Ln(e){return X(e,new Be)}function Kn(e){let t=new Be,n=X(e,t);return{hasRepeatedReferences:t.hasRepeatedReferences,value:n}}function zn(e){if(!$(e))return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function Bn(e){return $(e)&&e.length===1&&At.has(e)}function Un(e){return $(e)&&At.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 qn(e){if(!$(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:hn(qe(e))}function Qn(e){if(!e||!$(e))return!1;let t=e.charCodeAt(0);return t>64&&t<91||t>96&&t<123}function Gn(e){return $(e)&&(e==='"'||e==="'"||e===xt||e===St||e===kt||e===Ct)}function Jn(e){if(!$(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(!$(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 Yn(e){if(!$(e)||!e)return!1;let t=e.charCodeAt(0);return t<128?t===32||t>8&&t<14:!e[0].trim()}var Xn=e=>$(e)&&e.length&&e.endsWith("/")?e.slice(0,-1).trim():e;function Ft(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&&Pt.call(n.value)===Pn}function er(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 $(e){return typeof e=="string"}function $t(e){return Number.isFinite(e)}function tr(e){return Number.isSafeInteger(e)&&e>=0}function nr(e){return typeof e=="boolean"}function rr(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:(It.call(e),!0)}catch(t){return!1}}var Nt=Date.prototype.getTime;function Mt(e){if(e instanceof Date)return!0;if(e===null||typeof e!="object"||Ue.call(e)!=="[object Date]")return!1;try{return Nt.call(e),!0}catch(t){return!1}}function or(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,_=e.length;if(t.length===1){let u=t.charCodeAt(0);for(;a<_&&e.charCodeAt(a)===u;)a++;for(;_>a&&e.charCodeAt(_-1)===u;)_--}else{for(;a<_&&t.includes(e[a]);)a++;for(;_>a&&t.includes(e[_-1]);)_--}return a===0&&_===e.length?e:e.slice(a,_)}let r=Array.from(e),o=new Set(t),s=0,i=r.length;for(;s<i&&o.has(r[s]);)s++;for(;i>s&&o.has(r[i-1]);)i--;return s===0&&i===r.length?e:r.slice(s,i).join("")}function sr(e,t){if(!$(e)||!$(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 ir(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 _r(e){return e!=null}function ar(e){return[...new Set(e)]}function Et(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 lr(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":Et(e)||n}function cr(e,t){return e!=null&&Ae.call(e,t)}function ur(e,t){return e.localeCompare(t)}var pr=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],fr=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 dr(e,t){if(!Array.isArray(e)||!e.length||!$(t))return!1;for(let n of e){if(typeof n=="string"){if(t===n)return!0;continue}if(Qe(n)){let r=Nn.call(n);r&&(n.lastIndex=0);let o=Mn.call(n,t);if(r&&(n.lastIndex=0),o)return!0}}return!1}function hr(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 He=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;function gr(e){return e.replace(/-+([^-])/g,(t,n)=>n.toUpperCase())}function yr(e){return e.replace(/([\da-z])([A-Z])/g,"$1-$2").toLowerCase()}function mr(e){return e.replace(/^[\r\n]+/,"").replace(/[\r\n]+$/,"")}function bt(e,t){let n=Number.POSITIVE_INFINITY,r=e.split("\n");for(let s of r){let i=/^[ \t]*(?=\S)/.exec(s);i&&(n=Math.min(n,i[0].length))}let o=" ".repeat(t);return r.map(s=>s.trim()?o+s.slice(n):s).join("\n")}function br(e,t,n){let r="";return e&&(r=mr(e.replace(/\t+\n*$/,"")),r.includes("\n")&&(r=bt(r,n)),r="\n".concat(r)),t&&(r=r?"".concat(bt("\n".concat(t,"\n"),n)).concat(r):"\n".concat(t)),"".concat(r,"\n")}function wr(e){var r;let t=$(e.name)?e.name:"",{bin:n}=e;return $(n)?t.slice(t.startsWith("@")?t.indexOf("/")+1:0):n&&typeof n=="object"&&(r=Object.keys(n)[0])!=null?r:t}function vr(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 Or(e="",t={}){var J,z,S,fe,de,_e,Z,re,he,B;let n=typeof process>"u"?void 0:process,r=(J=t.pkg)!=null?J:{},o=(S=(z=t.argv)!=null?z:n==null?void 0:n.argv.slice(2))!=null?S:[],s=(fe=t.helpIndent)!=null?fe:2,i=(de=t.autoHelp)!=null?de:!0,a=(_e=t.autoVersion)!=null?_e:!0,_=(re=(Z=t.version)!=null?Z:r.version)!=null?re:"No version found",u=Ae.call(t,"booleanDefault")?t.booleanDefault:!1,k=br(e,(he=t.description)!=null?he:r.description,s);function A(c){console.log(k),n==null||n.exit($t(c)?c:2)}function b(){console.log(_),n==null||n.exit(0)}let P=[],l=new Map;for(let[c,h]of Object.entries((B=t.flags)!=null?B:{})){let w={key:c,type:h.type,isMultiple:!!h.isMultiple,source:h};P.push(w),l.set(c,w),l.set(yr(c),w),h.shortFlag&&l.set(h.shortFlag,w)}let g=[],f={};function x(c,h){let w=l.get(c),I=w?w.key:gr(c);if(w!=null&&w.isMultiple){let F=f[I];Array.isArray(F)?F.push(h):f[I]=[h];return}f[I]=h}function v(c,h){x(c,vr(l.get(c),h))}function O(c,h){return h===void 0?!1:(c==null?void 0:c.type)==="boolean"?h==="true"||h==="false":!(h.startsWith("-")&&h.length>1&&!He.test(h))}function d(c,h){let w=c.slice(1);for(let I=0;I<w.length;I++){let F=w[I],N=w.slice(I+1);if(N.startsWith("="))return v(F,N.slice(1)),h;if(He.test(N)||N&&/\W/.test(N[0]))return v(F,N),h;let U=l.get(F);if(N&&(U!=null&&U.type)&&U.type!=="boolean")return v(F,N),h;if(N){v(F,void 0);continue}if(O(U,o[h+1]))return v(F,o[h+1]),h+1;v(F,void 0)}return h}for(let c=0;c<o.length;c++){let h=o[c];if(h==="--"){g.push(...o.slice(c+1));break}if(h.startsWith("--")){let w=h.slice(2),I=w.indexOf("=");if(I!==-1){v(w.slice(0,I),w.slice(I+1));continue}if(w.startsWith("no-")){x(w.slice(3),!1);continue}let F=l.get(w);if(O(F,o[c+1])){v(w,o[c+1]),c++;continue}v(w,void 0);continue}if(h.startsWith("-")&&h.length>1&&!He.test(h)){c=d(h,c);continue}g.push(h)}for(let c of P)Ae.call(f,c.key)||(Ae.call(c.source,"default")?f[c.key]=c.source.default:c.isMultiple?f[c.key]=[]:c.type==="boolean"&&u!==void 0&&(f[c.key]=u));!g.length&&o.length===1&&(a&&f.version===!0?b():i&&f.help===!0&&A(0));let y=wr(r);return y&&n&&(n.title=y),{input:g,flags:f,pkg:r,help:k,showHelp:A,showVersion:b}}function Tr(e,t=[]){if(!e)return e;if(!Ft(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 i of o){if(s?s.has(i):t.includes(i))continue;let a=X(e[i],r);i==="__proto__"?Dt(n,i,a):n[i]=a}return n}var jr=256,xr=1024,Sr=1,kr=new Map,Cr=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 i=0;i<o;i++){let a=e.charCodeAt(t+i),_=n.charCodeAt(r+i);if(s||(a>=97&&a<=122&&(a-=32),_>=97&&_<=122&&(_-=32)),a!==_)return!1}return!0}function Wt(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 k=0;k<t.length;k++)if(t.charCodeAt(k)>127)return;return e.length===t.length&&Ve(e,0,t,0,t.length,!1)}if(r!==-1)return;let s=0,i=!1,a=-1;for(let k=0;k<t.length;k++){let A=t.charCodeAt(k);if(A>127)return;if(A===42){if(a=k,!i){if(s++,s>1)return;i=!0}}else i=!1}let _=a+1,u=t.length-_;return e.length<o+u?!1:Ve(e,0,t,0,o,n)&&Ve(e,e.length-u,t,_,u,n)}function Ar(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 Pr(e,t){let n=[[]],r=!0,o=!1,s=!1,i=0;for(let b=0;b<e.length;){let P=e.codePointAt(b);if(P!==92){if(P===42)o=!0,s||(n.push([]),s=!0);else{let O=t?P:ze(P);n[n.length-1].push(O),r&&(r=O<=127),i++,s=!1}b+=P>65535?2:1;continue}let l=b+1;for(;e.charCodeAt(l)===92;)l++;let g=l-b,f=e.codePointAt(l),x,v=!1;f===42?(v=g%2===0,x=v?g/2:(g-1)/2):f===void 0||f===10||f===13||f===8232||f===8233?x=Math.ceil(g/2):x=Math.floor(g/2);for(let O=0;O<x;O++)n[n.length-1].push(92),i++;if(v){s=!1,b=l;continue}if(f!==void 0){let O=t?f:ze(f);n[n.length-1].push(O),r&&(r=O<=127),i++,l+=f>65535?2:1}s=!1,b=l}let a=o&&n[0].length===0,_=o&&n[n.length-1].length===0,u=[];for(let b of n)b.length&&u.push({values:b});let k=a?0:1,A=u.length-(_?0:1);for(let b=k;b<A;b++)u[b].values.length>Sr&&(u[b].failure=Ar(u[b].values));return{asciiOnly:r,endsWithWildcard:_,hasWildcard:o,minimumInputLength:i,segments:u,startsWithWildcard:a}}function Ge(e,t){let n=t?kr:Cr,r=e.length<=xr;if(r){let s=n.get(e);if(s)return s}let o=Pr(e,t);if(r){if(n.size>=jr){let s=n.keys().next().value;s!==void 0&&n.delete(s)}n.set(e,o)}return o}function Je(e,t){if(t){let o=[];for(let s=0;s<e.length;){let i=e.codePointAt(s);o.push(i),s+=i>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 Rr(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 i=0;for(let a=n;a<r;a++){let _=e.charCodeAt(a);for(!o&&_>=97&&_<=122&&(_-=32);i>0&&_!==t.values[i];)i=t.failure[i-1];if(_===t.values[i]&&(i++,i===t.values.length))return a-i+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,i=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(i-=a.values.length,!Pe(e,i,a,n))return!1}for(let a=r;a<o;a++){let _=t.segments[a],u=Rr(e,_,s,i,n);if(u===-1)return!1;s=u+_.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 Dr(e,t,n,r){let o=r-t.values.length;if(o<n)return-1;if(!t.failure){for(let i=n;i<=o;i++)if(Re(e,i,t))return i;return-1}let s=0;for(let i=n;i<r;i++){for(;s>0&&e[i]!==t.values[s];)s=t.failure[s-1];if(e[i]===t.values[s]&&(s++,s===t.values.length))return i-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 i=t.segments[0];if(!Re(e,0,i))return!1;o=i.values.length,n++}if(!t.endsWithWildcard){r--;let i=t.segments[r];if(s-=i.values.length,!Re(e,s,i))return!1}for(let i=n;i<r;i++){let a=t.segments[i],_=Dr(e,a,o,s);if(_===-1)return!1;o=_+a.values.length}return!0}function Ir(e,t,n){let r=Wt(e,t,n);if(r!==void 0)return r;let o=Ge(t,n);return o.asciiOnly?Ze(e,o,n):Ye(Je(e,n),o)}function wt(e,t,n,r){var i;let o=Wt(e,t,n);if(o!==void 0)return o;let s=Ge(t,n);return s.asciiOnly?Ze(e,s,n):((i=r.tokens)!=null||(r.tokens=Je(e,n)),Ye(r.tokens,s))}function Fr(e,t){let n=e.charCodeAt(0)===33,r=n?e.slice(1):e;return{compiled:r.length===0?void 0:Ge(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=Je(e,n)),o=Ye(r.tokens,t.compiled)):o=e.length===0,t.negative?!o:o}function $r(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=>Fr(s,n));if(typeof e=="string"){let s=o[0];return i=>Le(i,s,n,{})}return s=>{let i={},a=!1,_=!1;for(let u of o)if(u.negative){if(!Le(s,u,n,i))return!1}else a=!0,!_&&Le(s,u,n,i)&&(_=!0);return a?_:!0}}function Nr(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,_=a?t.slice(1):t,u=Ir(e,_,r);return a?!u:u}let o={},s=!1,i=!1;for(let a of t){let _=a.charCodeAt(0)===33,u=_?a.slice(1):a;if(_){if(wt(e,u,r,o))return!1}else s=!0,!i&&wt(e,u,r,o)&&(i=!0)}return s?i:!0}var D=an(Ht(),1);var Vt="8.2.2";var Er=Vt,{formatDiagnosticValue:G,isPlainObject:Q,match:Lt}=De,Gt,Ie=(Gt=Object.getOwnPropertyDescriptor(De,"createMatcher"))==null?void 0:Gt.value,te=Object.freeze([]),Jt=Object.freeze({}),Ne={acceptArrays:!1,acceptArraysIgnore:te,enforceStrictKeyset:!0,ignoreKeys:te,ignorePaths:te,msg:"check-types-mini",optsVarName:"opts",reportCompletionFunc:null,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,schema:Jt},Wr=Object.freeze(ft({},Ne)),$e=class extends TypeError{constructor(n,r,o={}){var i,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=(i=o.actualType)!=null?i: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:te)),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}}},st=new Set(["all","any","anything","every","everything","whatever","whatevs"]),pe=Object.prototype.hasOwnProperty,Fe={caseSensitiveMatch:!0},Hr=new Map,Vr=new Map,Lr=100,Kr=new Set(["acceptArrays","acceptArraysIgnore","enforceStrictKeyset","ignoreKeys","ignorePaths","msg","optsVarName","reportCompletionFunc","reportProgressFunc","reportProgressFuncFrom","reportProgressFuncTo","schema"]);function ot(){return{children:new Map,descriptors:null,implicitContainer:!1}}var Kt=ot();function zr(e){return"keys"in e}function Br(e){return"keys"in e}function ne(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 ne(t))/^(?:[A-Za-z_$][A-Za-z0-9_$]*|\d+)$/u.test(r)?n+=".".concat(r):n+="[".concat(JSON.stringify(r),"]");return n}function je(e){let t="";for(let n of e)n==="%"?t+="%25":n==="."?t+="%2E":n==="\\"?t+="%5C":t+=n;return t}function Ur(e){return e.encoded}function zt(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 tt(e,t){if(!e.length)return null;if(e.length===1){let r=e[0],o=t?Vr:Hr,s=o.get(r);if(s)return s;let i=t?zt(r):r,a=Ie?Ie(i,Fe):_=>Lt(_,i,Fe);return o.size<Lr&&o.set(r,a),a}let n=t?e.map(zt):Array.from(e);return Ie?Ie(n,Fe):r=>Lt(r,n,Fe)}function qr(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 Bt(e,t){if(t.some(r=>st.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=(0,D.default)(e).toLowerCase();return n==="object"&&t.includes("object")?Q(e):t.includes(n)}function nt(e){return e.includes("object")&&!e.some(t=>st.has(t))}function Qr(e){let t=Array.isArray(e)?e:[e];if(!t.length)return null;let n=[];for(let r=0;r<t.length;r++){if(!pe.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 ie(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 Gr(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function Ut(e,t){if(e)try{e(t)}catch(n){}}function R(e,t,n={}){throw new $e(e,t,n)}function L(e,t){return pe.call(e,t)&&e[t]!==void 0?e[t]:Ne[t]}function Te(e,t){return e[t]}function qt(e,t,n){return!!(t!=null&&t(e)||n!=null&&n(je(e)))}function ue(e,t,n,r,o){return R(e,t,{actualType:r,context:o,path:ne(n)})}function rt(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(!pe.call(n,o)||typeof n[o]!="string")return null;r.push(n[o])}return r}function Jr(...e){var _t,at,lt;let[t,n,r]=e;Q(t)||R("THROW_ID_01","The first argument must be a plain object; received ".concat(G(t,4),"."),{actualType:(0,D.default)(t).toLowerCase()}),(e.length<2||n!==null&&!Q(n))&&R("THROW_ID_02","The second argument must be a plain object or null; received ".concat(G(n,4),". Pass null explicitly when validating against only a schema."),{actualType:(0,D.default)(n).toLowerCase()}),r!=null&&!Q(r)&&R("THROW_ID_03","The third argument must be a plain options object, null, or undefined; received ".concat(G(r,4),"."),{actualType:(0,D.default)(r).toLowerCase()});let o=r!=null?r:Jt,s=Object.keys(o).find(p=>!Kr.has(p));s!==void 0&&R("THROW_ID_04","Unknown option ".concat(G(s),"."),{path:[s]});let i=rt(L(o,"ignoreKeys"),te),a=rt(L(o,"ignorePaths"),te),_=rt(L(o,"acceptArraysIgnore"),te);(!i||!a||!_)&&R("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"),k=L(o,"enforceStrictKeyset");(typeof u!="boolean"||typeof k!="boolean")&&R("THROW_ID_06","opts.acceptArrays and opts.enforceStrictKeyset must be Booleans.");let A=L(o,"schema");Q(A)||R("THROW_ID_07","opts.schema was customised to ".concat(G(A)," which is not a plain object but ").concat((0,D.default)(A).toLowerCase(),"."),{actualType:(0,D.default)(A).toLowerCase(),path:["schema"]});let b=L(o,"msg"),P=L(o,"optsVarName");(typeof b!="string"||typeof P!="string")&&R("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=P,f=L(o,"reportCompletionFunc"),x=L(o,"reportProgressFunc");(f!==null&&typeof f!="function"||x!==null&&typeof x!="function")&&R("THROW_ID_09","opts.reportCompletionFunc and opts.reportProgressFunc must each be a function, null, or undefined.",{context:l});let v=L(o,"reportProgressFuncFrom"),O=L(o,"reportProgressFuncTo");(!Number.isFinite(v)||!Number.isFinite(O))&&R("THROW_ID_10","opts.reportProgressFuncFrom and opts.reportProgressFuncTo must be finite numbers.",{context:l}),v>O&&R("THROW_ID_11","opts.reportProgressFuncFrom cannot exceed opts.reportProgressFuncTo; received ".concat(v," and ").concat(O,"."),{context:l});let d={acceptArrays:u,acceptArraysIgnore:_,enforceStrictKeyset:k,ignoreKeys:i,ignorePaths:a,msg:l,optsVarName:g,reportCompletionFunc:f,reportProgressFunc:x,reportProgressFuncFrom:v,reportProgressFuncTo:O,schema:A},y=!!(d.reportCompletionFunc||d.reportProgressFunc),J=d.reportCompletionFunc?Date.now():0,z=0,S=0,fe=0,de=0,_e=0,Z=0,re=0,he,B=null,c=null;y&&(B=(p=!1)=>{if(!d.reportProgressFunc)return;let T=d.reportProgressFuncTo-d.reportProgressFuncFrom,m=p?d.reportProgressFuncTo:d.reportProgressFuncFrom+T*Math.min(.99,re/(re+1e3));m!==he&&(he=m,Ut(d.reportProgressFunc,m))},c=()=>{re++,re%1e3===0&&(B==null||B())},B());let h=t,w=n,I=A,F=ie(I),N=F.length?ot():Kt,U="THROW_ID_12",Zt="THROW_ID_13",Y=F.length?new Set([I]):null,ge=F.length?[{value:I},{index:0,keys:F,node:N,path:null,value:I}]:[];for(;ge.length;){let p=ge.pop();if(!Br(p)){Y==null||Y.delete(p.value);continue}if(p.index>=p.keys.length)continue;let T=p.keys[p.index++];ge.push(p);let m=Te(p.value,T),j=qr(T),E=p.node,C=p.path;for(let se=0;se<j.length;se++){let W=j[se],V=E.children.get(W);V||(V=ot(),E.children.set(W,V),de++,c==null||c()),C={depth:((_t=C==null?void 0:C.depth)!=null?_t:0)+1,encoded:C?"".concat(C.encoded,".").concat(je(W)):je(W),parent:C,segment:W},se<j.length-1&&(V.descriptors&&!nt(V.descriptors)&&ue(U,"".concat(K("schema",C)," cannot have both a terminal descriptor and nested schema paths."),C,null,l),V.implicitContainer=!0),C.depth>S&&(S=C.depth),E=V}if(Q(m)){E.descriptors&&!nt(E.descriptors)&&ue(U,"".concat(K("schema",C)," cannot have both a terminal descriptor and nested schema paths."),C,"object",l),E.implicitContainer=!0,Y!=null&&Y.has(m)&&ue(Zt,"".concat(K("schema",C)," contains a cycle. Cyclic schemas are not supported."),C,"object",l),Y==null||Y.add(m),ge.push({value:m}),ge.push({index:0,keys:ie(m),node:E,path:C,value:m});continue}let M=Qr(m);M||ue(U,"".concat(K("schema",C)," must be a non-empty type name, null, undefined, or a dense array of those values; received ").concat(G(m,4),"."),C,(0,D.default)(m).toLowerCase(),l);let oe=M;E.descriptors&&ue(U,"".concat(K("schema",C)," is declared more than once."),C,(0,D.default)(m).toLowerCase(),l),(E.children.size||E.implicitContainer)&&!nt(oe)&&ue(U,"".concat(K("schema",C)," cannot have both a terminal descriptor and nested schema paths."),C,(0,D.default)(m).toLowerCase(),l),E.descriptors=oe}let ye=tt(d.ignoreKeys,!1),me=tt(d.ignorePaths,!0),ae=tt(d.acceptArraysIgnore,!1),it=ie(h),Yt=w?ie(w):te;if(d.enforceStrictKeyset&&!w&&N.children.size===0&&R("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=it.filter(T=>!qt(T,ye,me)&&!(w&&pe.call(w,T))&&!N.children.has(T));if(p.length){let T=p.length>1,m=N.children.size?"The ".concat(d.optsVarName,".enforceStrictKeyset is on and the following key").concat(T?"s are":" is"," not covered by schema and/or reference objects: ").concat(p.join(", ")):"The input object has key".concat(T?"s":""," which ").concat(T?"are":"is"," not covered by the reference object: ").concat(p.join(", "));R("THROW_ID_15",m,{context:l})}}if(d.enforceStrictKeyset&&w){let p=Yt.filter(T=>!pe.call(h,T)&&!qt(T,ye,me));if(p.length){let T=p.length>1;R("THROW_ID_16","The reference object has key".concat(T?"s":""," which ").concat(T?"are":"is"," not present in the input object: ").concat(p.join(", ")),{context:l})}}let le=[h],q=null,be=[{value:h},{index:0,keys:it,path:null,refValue:w,schemaNode:N,value:h}];for(;be.length;){let p=be.pop();if(!zr(p)){le.pop(),q==null||q.delete(p.value),q&&le.length<=32&&(q=null);continue}if(p.index>=p.keys.length)continue;let T=p.keys[p.index++];be.push(p);let m={depth:((lt=(at=p.path)==null?void 0:at.depth)!=null?lt:0)+1,encoded:p.path?"".concat(p.path.encoded,".").concat(je(T)):je(T),parent:p.path,segment:T};y&&(Array.isArray(p.value)?z++:fe++,m.depth>S&&(S=m.depth),c==null||c());let j=Te(p.value,T),E=Array.isArray(p.value);if(!!(!E&&(ye!=null&&ye(T))||me!=null&&me(Ur(m)))){y&&_e++;continue}let M=p.schemaNode.children.get(T),oe=!1;if(M!=null&&M.descriptors){let ee=M.descriptors;if(ee.some(we=>st.has(we))){y&&_e++;continue}if(y&&(Z++,c==null||c()),Bt(j,ee))if((M.implicitContainer||M.children.size)&&Q(j))oe=!0;else continue;if(!oe&&d.acceptArrays&&Array.isArray(j)&&!(ae!=null&&ae(T))){let we=ie(j);for(let ve of we){let xe=Te(j,ve);y&&(z++,Z++,m.depth+1>S&&(S=m.depth+1),c==null||c()),Bt(xe,ee)||Yr(xe,ee,m,Number(ve),d,l)}continue}oe||Qt(j,ee,m,d,l)}let se=!1,W;Gr(p.refValue)&&pe.call(p.refValue,T)&&(se=!0,W=Te(p.refValue,T));let V=!1,Xt=W,en=M!=null?M:Kt;if(M&&(M.implicitContainer||M.children.size))oe||(y&&(Z++,c==null||c()),Q(j)||Qt(j,["object"],m,d,l)),V=!0;else if(se){if(d.acceptArrays&&Array.isArray(j)&&!Array.isArray(W)&&!(ae!=null&&ae(T))){let ee=(0,D.default)(W).toLowerCase(),we=ie(j);for(let ve of we){let xe=Te(j,ve);y&&(z++,Z++,m.depth+1>S&&(S=m.depth+1),c==null||c());let ct=(0,D.default)(xe).toLowerCase();ct!==ee&&Xr(ct,ee,m,Number(ve),d,l)}continue}y&&(Z++,c==null||c()),(0,D.default)(j)!==(0,D.default)(W)&&eo(j,W,m,d,l),(Array.isArray(j)&&Array.isArray(W)||Q(j))&&(V=!0)}else d.enforceStrictKeyset&&(!E||Q(j)||Array.isArray(j))&&Zr(m,d,l);V&&((q?q.has(j):le.includes(j))&&to(m,d,l),le.push(j),q?q.add(j):le.length>32&&(q=new Set(le)),be.push({value:j}),be.push({index:0,keys:ie(j),path:m,refValue:Xt,schemaNode:en,value:j}))}B==null||B(!0),Ut(d.reportCompletionFunc,Object.freeze({arrayElementsVisited:z,maxDepth:S,objectPropertiesVisited:fe,schemaEntries:de,timeTakenInMilliseconds:d.reportCompletionFunc?Date.now()-J:0,valuesIgnored:_e,valuesValidated:Z}))}function Zr(e,t,n){return R("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:ne(e)})}function Qt(e,t,n,r,o){let s=(0,D.default)(e).toLowerCase(),i=s==="string"?"":'"';return R("THROW_ID_18","".concat(K(r.optsVarName,n)," was customised to ").concat(i).concat(G(e)).concat(i," (type: ").concat(s,") which is not among the allowed types in schema (which is equal to ").concat(G(t),")"),{actualType:s,context:o,expectedTypes:t,path:ne(n)})}function Yr(e,t,n,r,o,s){return R("THROW_ID_19","".concat(K(o.optsVarName,n),".").concat(r,", the ").concat(r,"th element (equal to ").concat(G(e),") is of a type ").concat((0,D.default)(e).toLowerCase(),", but only the following are allowed by the ").concat(o.optsVarName,".schema: ").concat(t.join(", ")),{actualType:(0,D.default)(e).toLowerCase(),context:s,expectedTypes:t,path:ne({depth:n.depth+1,encoded:"".concat(n.encoded,".").concat(r),parent:n,segment:String(r)})})}function Xr(e,t,n,r,o,s){return R("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:ne({depth:n.depth+1,encoded:"".concat(n.encoded,".").concat(r),parent:n,segment:String(r)})})}function eo(e,t,n,r,o){let s=(0,D.default)(e).toLowerCase(),i=(0,D.default)(t).toLowerCase(),a=s==="string"?"":'"';return R("THROW_ID_21","".concat(K(r.optsVarName,n)," was customised to ").concat(a).concat(G(e)).concat(a," which is not ").concat(i," but ").concat(s),{actualType:s,context:o,expectedTypes:[i],path:ne(n)})}function to(e,t,n){return R("THROW_ID_22","".concat(K(t.optsVarName,e)," contains a cycle. Cyclic input structures are not supported."),{actualType:"object",context:n,path:ne(e)})}return ln(no);})();
|
|
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);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name codsen-format-diagnostic-value
|
|
13
13
|
* @fileoverview Safely format untrusted JavaScript values for diagnostics
|
|
14
|
-
* @version 1.1.
|
|
14
|
+
* @version 1.1.1
|
|
15
15
|
* @author Roy Revelt
|
|
16
16
|
* @license MIT
|
|
17
17
|
* {@link https://codsen.com/os/codsen-format-diagnostic-value/}
|
|
@@ -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.1
|
|
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.3",
|
|
4
4
|
"description": "Validate options object",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compare",
|
|
@@ -68,8 +68,7 @@
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"codsen-utils": "^1.10.
|
|
72
|
-
"type-detect": "^4.1.0"
|
|
71
|
+
"codsen-utils": "^1.10.1"
|
|
73
72
|
},
|
|
74
73
|
"engines": {
|
|
75
74
|
"node": ">=18.20.8"
|