check-types-mini 8.1.3 → 8.2.0

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 CHANGED
@@ -3,11 +3,24 @@
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.1.0 (2025-10-15)
6
+ ## 8.2.0 (2026-08-19)
7
+
8
+ ### Bug Fixes
9
+
10
+ - make validation diagnostics safe ([7b01074](https://github.com/codsen/codsen/commit/7b0107476f12734aeb8e82852ba980b187280110))
11
+ - resolve review findings REV-004 through REV-007 ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
12
+ - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
13
+ - validate nested option paths correctly ([b9b83d2](https://github.com/codsen/codsen/commit/b9b83d2b537e94b35a21d8ac117c1a4057ad316d))
7
14
 
8
15
  ### Features
9
16
 
10
- - if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
17
+ - add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
18
+ - refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
19
+
20
+ ### Reverts
21
+
22
+ - Revert "Merge pull request #128 from codsen/release/npm-32198404552-1" ([5baeeaa](https://github.com/codsen/codsen/commit/5baeeaaa677b86f1eaa6396cadf3aea32b06416e)), closes [#128](https://github.com/codsen/codsen/issues/128)
23
+ - Revert "Merge pull request #127 from codsen/release/npm-32194020886-1" ([5f1e94d](https://github.com/codsen/codsen/commit/5f1e94deef910ce735266b16aeee08a76de7a862)), closes [#127](https://github.com/codsen/codsen/issues/127)
11
24
 
12
25
  ## 8.0.0 (2022-12-01)
13
26
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright © 2010-2025 Roy Revelt and other contributors
3
+ Copyright © 2010-2026 Roy Revelt and other contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/README.md CHANGED
@@ -32,7 +32,7 @@ npm i check-types-mini
32
32
  ## Quick Take
33
33
 
34
34
  ```js
35
- import { strict as assert } from "assert";
35
+ import { strict as assert } from "node:assert";
36
36
 
37
37
  import { checkTypesMini } from "check-types-mini";
38
38
 
@@ -60,9 +60,10 @@ assert.throws(
60
60
  );
61
61
  ```
62
62
 
63
+
63
64
  ## Documentation
64
65
 
65
- Please [visit codsen.com](https://codsen.com/os/check-types-mini/) for a full description of the API.
66
+ Please [visit codsen.com](https://codsen.com/os/check-types-mini/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/check-types-mini/CHANGELOG.md).
66
67
 
67
68
  ## Contributing
68
69
 
@@ -72,6 +73,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
72
73
 
73
74
  MIT License
74
75
 
75
- Copyright © 2010-2025 Roy Revelt and other contributors
76
+ Copyright © 2010-2026 Roy Revelt and other contributors
76
77
 
77
78
  <p align="center"><img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center"></p>
@@ -1,24 +1,24 @@
1
1
  /**
2
2
  * @name check-types-mini
3
3
  * @fileoverview Validate options object
4
- * @version 8.1.3
4
+ * @version 8.2.0
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 i from"type-detect";import{traverse as w}from"ast-monkey-traverse";import{arrayiffy as N}from"arrayiffy-if-string";import E from"object-path";import{isMatch as S}from"matcher";import{isPlainObject as m,pullAll as g,intersection as k}from"codsen-utils";var j="8.1.3";var R=j,v={ignoreKeys:[],ignorePaths:[],acceptArrays:!1,acceptArraysIgnore:[],enforceStrictKeyset:!0,schema:{},msg:"check-types-mini",optsVarName:"opts"};function T(a,r,p){function y(s){return s!=null}function b(s,l){return typeof l=="string"&&(l=N(l)),Array.from(s).filter(n=>!l.some(t=>S(n,t,{caseSensitive:!0})))}let V=Object.prototype.hasOwnProperty,A=["any","anything","every","everything","all","whatever","whatevs"];if(!y(a))throw new Error("check-types-mini: [THROW_ID_01] First argument is missing!");let e={...v,...p};if(typeof e.ignoreKeys=="string"&&(e.ignoreKeys=[e.ignoreKeys]),typeof e.ignorePaths=="string"&&(e.ignorePaths=[e.ignorePaths]),typeof e.acceptArraysIgnore=="string"&&(e.acceptArraysIgnore=[e.acceptArraysIgnore]),e.msg=`${e.msg}`.trim(),e.msg[e.msg.length-1]===":"&&(e.msg=e.msg.slice(0,e.msg.length-1).trim()),m(e.schema))Object.keys(e.schema).forEach(s=>{if(m(e.schema[s])){let l={};w(e.schema[s],(n,t,$)=>{let u=t!==void 0?t:n;return!Array.isArray(u)&&!m(u)&&(l[`${s}.${$.path}`]=u),u}),delete e.schema[s],e.schema={...e.schema,...l}}}),Object.keys(e.schema).forEach(s=>{Array.isArray(e.schema[s])||(e.schema[s]=[e.schema[s]]),e.schema[s]=e.schema[s].map(l=>`${l}`.toLowerCase().trim())});else if(e.schema!=null)throw new Error(`check-types-mini: opts.schema was customised to ${JSON.stringify(e.schema,null,0)} which is not object but ${typeof e.schema}`);if(y(r)||(r={}),e.enforceStrictKeyset)if(y(e.schema)&&Object.keys(e.schema).length){if(r&&b(g(Object.keys(a),Object.keys(r).concat(Object.keys(e.schema))),e.ignoreKeys).length){let s=g(Object.keys(a),Object.keys(r).concat(Object.keys(e.schema)));throw new TypeError(`${e.msg}: ${e.optsVarName}.enforceStrictKeyset is on and the following key${s.length>1?"s":""} ${s.length>1?"are":"is"} not covered by schema and/or reference objects: ${s.join(", ")}`)}}else if(m(r)&&Object.keys(r).length){if(b(g(Object.keys(a),Object.keys(r)),e.ignoreKeys).length!==0){let s=g(Object.keys(a),Object.keys(r));throw new TypeError(`${e.msg}: The input object has key${s.length>1?"s":""} which ${s.length>1?"are":"is"} not covered by the reference object: ${s.join(", ")}`)}else if(b(g(Object.keys(r),Object.keys(a)),e.ignoreKeys).length!==0){let s=g(Object.keys(r),Object.keys(a));throw new TypeError(`${e.msg}: The reference object has key${s.length>1?"s":""} which ${s.length>1?"are":"is"} not present in the input object: ${s.join(", ")}`)}}else throw new TypeError(`${e.msg}: Both ${e.optsVarName}.schema and reference objects are missing! We don't have anything to match the keys as you requested via resolvedOpts.enforceStrictKeyset!`);let h=[];w(a,(s,l,n)=>{let t=l,$=s;if(n.parentType==="array"&&($=void 0,t=s),Array.isArray(h)&&h.length&&h.some(o=>n.path.startsWith(o))||$&&e.ignoreKeys.some(o=>$&&S($,o))||e.ignorePaths.some(o=>S(n.path,o)))return t;let u=!(!m(t)&&!Array.isArray(t)&&Array.isArray(n.parent)),f=!1;m(e.schema)&&V.call(e.schema,n.path)&&(f=!0);let d=!1;if(m(r)&&E.has(r,n.path)&&(d=!0),e.enforceStrictKeyset&&u&&!f&&!d)throw new TypeError(`${e.msg}: ${e.optsVarName}.${n.path} is neither covered by reference object (second input argument), nor ${e.optsVarName}.schema! To stop this error, turn off ${e.optsVarName}.enforceStrictKeyset or provide some type reference (2nd argument or ${e.optsVarName}.schema).
10
+ import{formatDiagnosticValue as $,isPlainObject as m,match as I}from"codsen-utils";import g from"type-detect";var j="8.2.0";var U=j,_={ignoreKeys:[],ignorePaths:[],acceptArrays:!1,acceptArraysIgnore:[],enforceStrictKeyset:!0,schema:{},msg:"check-types-mini",optsVarName:"opts"},C=new Set(["any","anything","every","everything","all","whatever","whatevs"]),v=Object.prototype.hasOwnProperty,M={caseSensitiveMatch:!0};function N(t,s){return s.some(n=>t===n||I(t,n))}function k(t,s){return s.length?t.filter(n=>!s.some(e=>n===e||I(n,e,M))):t}function E(t,s){if(!s.length)return t;let n=new Set(s);return t.filter(e=>!n.has(e))}function R(t){let s={};function n(e,o){if(m(e)){for(let p of Object.keys(e))n(e[p],o?`${o}.${p}`:p);return}let u=Array.isArray(e)?e:[e];s[o]=u.map(p=>`${p}`.toLowerCase().trim())}for(let e of Object.keys(t))n(t[e],e);return s}function w(t,s,n=""){if(Array.isArray(t))for(let e=0;e<t.length;e++){if(t[e]===void 0)continue;let o=n?`${n}.${e}`:`${e}`;s(t[e],void 0,{path:o,parent:t,parentType:"array"}),w(t[e],s,o)}else if(m(t))for(let e of Object.keys(t)){let o=n?`${n}.${e}`:e;s(e,t[e],{path:o,parent:t,parentType:"object"}),w(t[e],s,o)}}function W(t,s){let n=t,e=0;for(;e<=s.length;){let o=s.indexOf(".",e),u=o===-1?s.slice(e):s.slice(e,o);if(n===null||typeof n!="object"&&typeof n!="function"||!v.call(n,u))return[!1,void 0];if(n=n[u],o===-1)return[!0,n];e=o+1}return[!1,void 0]}function L(t,s,n){if(t==null)throw new Error("check-types-mini/checkTypesMini(): [THROW_ID_01] First argument is missing!");let e={..._,...n};if(typeof e.ignoreKeys=="string"&&(e.ignoreKeys=[e.ignoreKeys]),typeof e.ignorePaths=="string"&&(e.ignorePaths=[e.ignorePaths]),typeof e.acceptArraysIgnore=="string"&&(e.acceptArraysIgnore=[e.acceptArraysIgnore]),e.msg=`${e.msg}`.trim(),e.msg[e.msg.length-1]===":"&&(e.msg=e.msg.slice(0,e.msg.length-1).trim()),m(e.schema))e.schema=R(e.schema);else if(e.schema!=null)throw new Error(`check-types-mini/checkTypesMini(): [THROW_ID_02] opts.schema was customised to ${$(e.schema)} which is not object but ${typeof e.schema}`);s==null&&(s={});let o=e.ignoreKeys,u=e.ignorePaths,p=e.acceptArraysIgnore,b=Object.keys(t),y=m(s)?Object.keys(s):[],S=m(e.schema)?Object.keys(e.schema):[];if(e.enforceStrictKeyset)if(S.length){let i=k(E(b,y.concat(S)),o);if(i.length)throw new TypeError(`check-types-mini/checkTypesMini(): [THROW_ID_03] ${e.msg}: ${e.optsVarName}.enforceStrictKeyset is on and the following key${i.length>1?"s":""} ${i.length>1?"are":"is"} not covered by schema and/or reference objects: ${i.join(", ")}`)}else if(y.length){let i=k(E(b,y),o);if(i.length)throw new TypeError(`check-types-mini/checkTypesMini(): [THROW_ID_04] ${e.msg}: The input object has key${i.length>1?"s":""} which ${i.length>1?"are":"is"} not covered by the reference object: ${i.join(", ")}`);if(i=k(E(y,b),o),i.length)throw new TypeError(`check-types-mini/checkTypesMini(): [THROW_ID_05] ${e.msg}: The reference object has key${i.length>1?"s":""} which ${i.length>1?"are":"is"} not present in the input object: ${i.join(", ")}`)}else throw new TypeError(`check-types-mini/checkTypesMini(): [THROW_ID_06] ${e.msg}: Both ${e.optsVarName}.schema and reference objects are missing! We don't have anything to match the keys as you requested via resolvedOpts.enforceStrictKeyset!`);let d=[];w(t,(i,K,c)=>{let r=K,O=i;if(c.parentType==="array"&&(O=void 0,r=i),d.length&&d.some(a=>c.path.startsWith(`${a}.`))||O&&N(O,o)||N(c.path,u))return r;let P=!(!m(r)&&!Array.isArray(r)&&Array.isArray(c.parent)),D=m(e.schema)&&v.call(e.schema,c.path),[V,H]=m(s)?W(s,c.path):[!1,void 0];if(e.enforceStrictKeyset&&P&&!D&&!V)throw new TypeError(`check-types-mini/checkTypesMini(): [THROW_ID_07] ${e.msg}: ${e.optsVarName}.${c.path} is neither covered by reference object (second input argument), nor ${e.optsVarName}.schema! To stop this error, turn off ${e.optsVarName}.enforceStrictKeyset or provide some type reference (2nd argument or ${e.optsVarName}.schema).
11
11
 
12
12
  Debug info:
13
13
 
14
- obj = ${JSON.stringify(a,null,4)}
14
+ obj = ${$(t,4)}
15
15
 
16
- ref = ${JSON.stringify(r,null,4)}
16
+ ref = ${$(s,4)}
17
17
 
18
- innerObj = ${JSON.stringify(n,null,4)}
18
+ innerObj = ${$(c,4)}
19
19
 
20
- resolvedOpts = ${JSON.stringify(e,null,4)}
20
+ resolvedOpts = ${$(e,4)}
21
21
 
22
- current = ${JSON.stringify(t,null,4)}
22
+ current = ${$(r,4)}
23
23
 
24
- `);if(f){let o=N(e.schema[n.path]).map(c=>`${c}`.toLowerCase());if(E.set(e.schema,n.path,o),k(o,A).length)h.push(n.path);else if(t!==!0&&t!==!1&&!o.includes(i(t).toLowerCase())||(t===!0||t===!1)&&!o.includes(String(t))&&!o.includes("boolean"))if(Array.isArray(t)&&e.acceptArrays){for(let c=0,O=t.length;c<O;c++)if(!o.includes(i(t[c]).toLowerCase()))throw new TypeError(`${e.msg}: ${e.optsVarName}.${n.path}.${c}, the ${c}th element (equal to ${JSON.stringify(t[c],null,0)}) is of a type ${i(t[c]).toLowerCase()}, but only the following are allowed by the ${e.optsVarName}.schema: ${o.join(", ")}`)}else throw new TypeError(`${e.msg}: ${e.optsVarName}.${n.path} was customised to ${i(t)!=="string"?'"':""}${JSON.stringify(t,null,0)}${i(t)!=="string"?'"':""} (type: ${i(t).toLowerCase()}) which is not among the allowed types in schema (which is equal to ${JSON.stringify(o,null,0)})`)}else if(r&&m(r)&&d){let o=E.get(r,n.path);if(e.acceptArrays&&Array.isArray(t)&&!e.acceptArraysIgnore.includes(s)){if(!t.every(O=>i(O).toLowerCase()===i(r[s]).toLowerCase()))throw new TypeError(`${e.msg}: ${e.optsVarName}.${n.path} was customised to be array, but not all of its elements are ${i(r[s]).toLowerCase()}-type`)}else if(i(t)!==i(o))throw new TypeError(`${e.msg}: ${e.optsVarName}.${n.path} was customised to ${i(t).toLowerCase()==="string"?"":'"'}${JSON.stringify(t,null,0)}${i(t).toLowerCase()==="string"?"":'"'} which is not ${i(o).toLowerCase()} but ${i(t).toLowerCase()}`)}return t})}function M(a,r,p){T(a,r,p)}export{M as checkTypesMini,v as defaults,R as version};
24
+ `);if(D){let a=e.schema[c.path];if(a.filter(l=>C.has(l)).length)d.push(c.path);else{let l=g(r).toLowerCase();if(r!==!0&&r!==!1&&!a.includes(l)||(r===!0||r===!1)&&!a.includes(String(r))&&!a.includes("boolean"))if(Array.isArray(r)&&e.acceptArrays)for(let h=0,T=r.length;h<T;h++){let A=g(r[h]).toLowerCase();if(!a.includes(A))throw new TypeError(`check-types-mini/checkTypesMini(): [THROW_ID_08] ${e.msg}: ${e.optsVarName}.${c.path}.${h}, the ${h}th element (equal to ${$(r[h])}) is of a type ${A}, but only the following are allowed by the ${e.optsVarName}.schema: ${a.join(", ")}`)}else throw new TypeError(`check-types-mini/checkTypesMini(): [THROW_ID_09] ${e.msg}: ${e.optsVarName}.${c.path} was customised to ${l!=="string"?'"':""}${$(r)}${l!=="string"?'"':""} (type: ${l}) which is not among the allowed types in schema (which is equal to ${$(a)})`)}}else if(s&&m(s)&&V){let a=g(r),f=g(H);if(e.acceptArrays&&Array.isArray(r)&&!p.includes(i)){let l=f.toLowerCase();if(!r.every(T=>g(T).toLowerCase()===l))throw new TypeError(`check-types-mini/checkTypesMini(): [THROW_ID_10] ${e.msg}: ${e.optsVarName}.${c.path} was customised to be array, but not all of its elements are ${l}-type`)}else if(a!==f){let l=a.toLowerCase();throw new TypeError(`check-types-mini/checkTypesMini(): [THROW_ID_11] ${e.msg}: ${e.optsVarName}.${c.path} was customised to ${l==="string"?"":'"'}${$(r)}${l==="string"?"":'"'} which is not ${f.toLowerCase()} but ${l}`)}}return r})}function Y(t,s,n){L(t,s,n)}export{Y as checkTypesMini,_ as defaults,U as version};
@@ -1,42 +1,18 @@
1
1
  /**
2
2
  * @name check-types-mini
3
3
  * @fileoverview Validate options object
4
- * @version 8.1.3
4
+ * @version 8.2.0
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 fe=Object.create,U=Object.freeze,N=Object.defineProperty,pe=Object.defineProperties,ye=Object.getOwnPropertyDescriptor,ge=Object.getOwnPropertyDescriptors,me=Object.getOwnPropertyNames,Q=Object.getOwnPropertySymbols,he=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable;var q=(e,t,c)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:c}):e[t]=c,E=(e,t)=>{for(var c in t||(t={}))Y.call(t,c)&&q(e,c,t[c]);if(Q)for(var c of Q(t))$e.call(t,c)&&q(e,c,t[c]);return e},j=(e,t)=>pe(e,ge(t));var J=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),de=(e,t)=>{for(var c in t)N(e,c,{get:t[c],enumerable:!0})},z=(e,t,c,g)=>{if(t&&typeof t=="object"||typeof t=="function")for(let y of me(t))!Y.call(e,y)&&y!==c&&N(e,y,{get:()=>t[y],enumerable:!(g=ye(t,y))||g.enumerable});return e};var T=(e,t,c)=>(c=e!=null?fe(he(e)):{},z(t||!e||!e.__esModule?N(c,"default",{value:e,enumerable:!0}):c,e)),be=e=>z(N({},"__esModule",{value:!0}),e);var x=(e,t)=>U(N(e,"raw",{value:U(t||e.slice())}));var Z=J((K,M)=>{(function(e,t){typeof K=="object"&&typeof M<"u"?M.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.typeDetect=t())})(K,(function(){"use strict";var e=typeof Promise=="function",t=(function(d){if(typeof globalThis=="object")return globalThis;Object.defineProperty(d,"typeDetectGlobalObject",{get:function(){return this},configurable:!0});var P=typeDetectGlobalObject;return delete d.typeDetectGlobalObject,P})(Object.prototype),c=typeof Symbol<"u",g=typeof Map<"u",y=typeof Set<"u",h=typeof WeakMap<"u",p=typeof WeakSet<"u",n=typeof DataView<"u",o=c&&typeof Symbol.iterator<"u",i=c&&typeof Symbol.toStringTag<"u",a=y&&typeof Set.prototype.entries=="function",r=g&&typeof Map.prototype.entries=="function",l=a&&Object.getPrototypeOf(new Set().entries()),b=r&&Object.getPrototypeOf(new Map().entries()),$=o&&typeof Array.prototype[Symbol.iterator]=="function",S=$&&Object.getPrototypeOf([][Symbol.iterator]()),f=o&&typeof String.prototype[Symbol.iterator]=="function",s=f&&Object.getPrototypeOf(""[Symbol.iterator]()),u=8,m=-1;function O(d){var P=typeof d;if(P!=="object")return P;if(d===null)return"null";if(d===t)return"global";if(Array.isArray(d)&&(i===!1||!(Symbol.toStringTag in d)))return"Array";if(typeof window=="object"&&window!==null){if(typeof window.location=="object"&&d===window.location)return"Location";if(typeof window.document=="object"&&d===window.document)return"Document";if(typeof window.navigator=="object"){if(typeof window.navigator.mimeTypes=="object"&&d===window.navigator.mimeTypes)return"MimeTypeArray";if(typeof window.navigator.plugins=="object"&&d===window.navigator.plugins)return"PluginArray"}if((typeof window.HTMLElement=="function"||typeof window.HTMLElement=="object")&&d instanceof window.HTMLElement){if(d.tagName==="BLOCKQUOTE")return"HTMLQuoteElement";if(d.tagName==="TD")return"HTMLTableDataCellElement";if(d.tagName==="TH")return"HTMLTableHeaderCellElement"}}var L=i&&d[Symbol.toStringTag];if(typeof L=="string")return L;var A=Object.getPrototypeOf(d);return A===RegExp.prototype?"RegExp":A===Date.prototype?"Date":e&&A===Promise.prototype?"Promise":y&&A===Set.prototype?"Set":g&&A===Map.prototype?"Map":p&&A===WeakSet.prototype?"WeakSet":h&&A===WeakMap.prototype?"WeakMap":n&&A===DataView.prototype?"DataView":g&&A===b?"Map Iterator":y&&A===l?"Set Iterator":$&&A===S?"Array Iterator":f&&A===s?"String Iterator":A===null?"Object":Object.prototype.toString.call(d).slice(u,m)}return O}))});var H=J((Pe,X)=>{"use strict";X.exports=Oe;function k(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function Oe(e){if(e=e||{},e.circles)return we(e);let t=new Map;if(t.set(Date,p=>new Date(p)),t.set(Map,(p,n)=>new Map(g(Array.from(p),n))),t.set(Set,(p,n)=>new Set(g(Array.from(p),n))),e.constructorHandlers)for(let p of e.constructorHandlers)t.set(p[0],p[1]);let c=null;return e.proto?h:y;function g(p,n){let o=Object.keys(p),i=new Array(o.length);for(let a=0;a<o.length;a++){let r=o[a],l=p[r];typeof l!="object"||l===null?i[r]=l:l.constructor!==Object&&(c=t.get(l.constructor))?i[r]=c(l,n):ArrayBuffer.isView(l)?i[r]=k(l):i[r]=n(l)}return i}function y(p){if(typeof p!="object"||p===null)return p;if(Array.isArray(p))return g(p,y);if(p.constructor!==Object&&(c=t.get(p.constructor)))return c(p,y);let n={};for(let o in p){if(Object.hasOwnProperty.call(p,o)===!1)continue;let i=p[o];typeof i!="object"||i===null?n[o]=i:i.constructor!==Object&&(c=t.get(i.constructor))?n[o]=c(i,y):ArrayBuffer.isView(i)?n[o]=k(i):n[o]=y(i)}return n}function h(p){if(typeof p!="object"||p===null)return p;if(Array.isArray(p))return g(p,h);if(p.constructor!==Object&&(c=t.get(p.constructor)))return c(p,h);let n={};for(let o in p){let i=p[o];typeof i!="object"||i===null?n[o]=i:i.constructor!==Object&&(c=t.get(i.constructor))?n[o]=c(i,h):ArrayBuffer.isView(i)?n[o]=k(i):n[o]=h(i)}return n}}function we(e){let t=[],c=[],g=new Map;if(g.set(Date,o=>new Date(o)),g.set(Map,(o,i)=>new Map(h(Array.from(o),i))),g.set(Set,(o,i)=>new Set(h(Array.from(o),i))),e.constructorHandlers)for(let o of e.constructorHandlers)g.set(o[0],o[1]);let y=null;return e.proto?n:p;function h(o,i){let a=Object.keys(o),r=new Array(a.length);for(let l=0;l<a.length;l++){let b=a[l],$=o[b];if(typeof $!="object"||$===null)r[b]=$;else if($.constructor!==Object&&(y=g.get($.constructor)))r[b]=y($,i);else if(ArrayBuffer.isView($))r[b]=k($);else{let S=t.indexOf($);S!==-1?r[b]=c[S]:r[b]=i($)}}return r}function p(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return h(o,p);if(o.constructor!==Object&&(y=g.get(o.constructor)))return y(o,p);let i={};t.push(o),c.push(i);for(let a in o){if(Object.hasOwnProperty.call(o,a)===!1)continue;let r=o[a];if(typeof r!="object"||r===null)i[a]=r;else if(r.constructor!==Object&&(y=g.get(r.constructor)))i[a]=y(r,p);else if(ArrayBuffer.isView(r))i[a]=k(r);else{let l=t.indexOf(r);l!==-1?i[a]=c[l]:i[a]=p(r)}}return t.pop(),c.pop(),i}function n(o){if(typeof o!="object"||o===null)return o;if(Array.isArray(o))return h(o,n);if(o.constructor!==Object&&(y=g.get(o.constructor)))return y(o,n);let i={};t.push(o),c.push(i);for(let a in o){let r=o[a];if(typeof r!="object"||r===null)i[a]=r;else if(r.constructor!==Object&&(y=g.get(r.constructor)))i[a]=y(r,n);else if(ArrayBuffer.isView(r))i[a]=k(r);else{let l=t.indexOf(r);l!==-1?i[a]=c[l]:i[a]=n(r)}}return t.pop(),c.pop(),i}}});var se=J((ne,V)=>{(function(e,t){"use strict";typeof V=="object"&&typeof V.exports=="object"?V.exports=t():typeof define=="function"&&define.amd?define([],t):e.objectPath=t()})(ne,function(){"use strict";var e=Object.prototype.toString;function t(a,r){return a==null?!1:Object.prototype.hasOwnProperty.call(a,r)}function c(a){if(!a||h(a)&&a.length===0)return!0;if(typeof a!="string"){for(var r in a)if(t(a,r))return!1;return!0}return!1}function g(a){return e.call(a)}function y(a){return typeof a=="object"&&g(a)==="[object Object]"}var h=Array.isArray||function(a){return e.call(a)==="[object Array]"};function p(a){return typeof a=="boolean"||g(a)==="[object Boolean]"}function n(a){var r=parseInt(a);return r.toString()===a?r:a}function o(a){a=a||{};var r=function(f){return Object.keys(r).reduce(function(s,u){return u==="create"||typeof r[u]=="function"&&(s[u]=r[u].bind(r,f)),s},{})},l;a.includeInheritedProps?l=function(){return!0}:l=function(f,s){return typeof s=="number"&&Array.isArray(f)||t(f,s)};function b(f,s){if(l(f,s))return f[s]}var $;a.includeInheritedProps?$=function(f,s){typeof s!="string"&&typeof s!="number"&&(s=String(s));var u=b(f,s);if(s==="__proto__"||s==="prototype"||s==="constructor"&&typeof u=="function")throw new Error("For security reasons, object's magic properties cannot be set");return u}:$=function(f,s){return b(f,s)};function S(f,s,u,m){if(typeof s=="number"&&(s=[s]),!s||s.length===0)return f;if(typeof s=="string")return S(f,s.split(".").map(n),u,m);var O=s[0],d=$(f,O);return s.length===1?((d===void 0||!m)&&(f[O]=u),d):(d===void 0&&(typeof s[1]=="number"?f[O]=[]:f[O]={}),S(f[O],s.slice(1),u,m))}return r.has=function(f,s){if(typeof s=="number"?s=[s]:typeof s=="string"&&(s=s.split(".")),!s||s.length===0)return!!f;for(var u=0;u<s.length;u++){var m=n(s[u]);if(typeof m=="number"&&h(f)&&m<f.length||(a.includeInheritedProps?m in Object(f):t(f,m)))f=f[m];else return!1}return!0},r.ensureExists=function(f,s,u){return S(f,s,u,!0)},r.set=function(f,s,u,m){return S(f,s,u,m)},r.insert=function(f,s,u,m){var O=r.get(f,s);m=~~m,h(O)||(O=[],r.set(f,s,O)),O.splice(m,0,u)},r.empty=function(f,s){if(!c(s)&&f!=null){var u,m;if(u=r.get(f,s)){if(typeof u=="string")return r.set(f,s,"");if(p(u))return r.set(f,s,!1);if(typeof u=="number")return r.set(f,s,0);if(h(u))u.length=0;else if(y(u))for(m in u)l(u,m)&&delete u[m];else return r.set(f,s,null)}}},r.push=function(f,s){var u=r.get(f,s);h(u)||(u=[],r.set(f,s,u)),u.push.apply(u,Array.prototype.slice.call(arguments,2))},r.coalesce=function(f,s,u){for(var m,O=0,d=s.length;O<d;O++)if((m=r.get(f,s[O]))!==void 0)return m;return u},r.get=function(f,s,u){if(typeof s=="number"&&(s=[s]),!s||s.length===0)return f;if(f==null)return u;if(typeof s=="string")return r.get(f,s.split("."),u);var m=n(s[0]),O=$(f,m);return O===void 0?u:s.length===1?O:r.get(f[m],s.slice(1),u)},r.del=function(s,u){if(typeof u=="number"&&(u=[u]),s==null||c(u))return s;if(typeof u=="string")return r.del(s,u.split("."));var m=n(u[0]);if($(s,m),!l(s,m))return s;if(u.length===1)h(s)?s.splice(m,1):delete s[m];else return r.del(s[m],u.slice(1));return s},r}var i=o();return i.create=o,i.withInheritedProps=o({includeInheritedProps:!0}),i})});var ke={};de(ke,{checkTypesMini:()=>Ne,defaults:()=>ue,version:()=>ve});var w=T(Z(),1);var re=T(H(),1);var ee=T(H(),1);var Te=(0,ee.default)();function v(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function D(e=[],t=[]){return!e||!Array.isArray(e)||!e.length?[]:!t||!Array.isArray(t)||!t.length?e:e.filter(c=>!t.includes(c))}function te(e=[],t=[]){return!e||!t?[]:Array.from(new Set(Array.from(e).filter(c=>new Set(t).has(c))))}function B(e){if(e.includes(".")){let t=e.lastIndexOf(".");if(!e.slice(0,t).includes("."))return e.slice(0,t);for(let c=t-1;c--;)if(e[c]===".")return e.slice(c+1,t)}return null}var _=(0,re.default)();function R(e,t){let c={now:!1};function g(y,h,p,n){let o=_(y),i,a=E({depth:-1,path:""},p);if(a.depth+=1,Array.isArray(o))for(let r=0,l=o.length;r<l&&!n.now;r++){let b=a.path?"".concat(a.path,".").concat(r):"".concat(r);o[r]!==void 0?(a.parent=_(o),a.parentType="array",a.parentKey=B(b),i=g(h(o[r],void 0,j(E({},a),{path:b}),n),h,j(E({},a),{path:b}),n),Number.isNaN(i)&&r<o.length?(o.splice(r,1),r-=1):o[r]=i):o.splice(r,1)}else if(v(o))for(let r in o){if(n.now&&r!=null)break;let l=a.path?"".concat(a.path,".").concat(r):r;a.depth===0&&r!=null&&(a.topmostKey=r),a.parent=_(o),a.parentType="object",a.parentKey=B(l),i=g(h(r,o[r],j(E({},a),{path:l}),n),h,j(E({},a),{path:l}),n),Number.isNaN(i)?delete o[r]:o[r]=i}return o}return g(e,t,{},c)}function F(e){return typeof e!="string"?e:e.length?[e]:[]}var I=T(se(),1);function W(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var G=new Map,ie=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":{e=[e];break}case"undefined":{e=[];break}default:throw new TypeError("Expected '".concat(t,"' to be a string or an array, but got a type of '").concat(typeof e,"'"))}return e.filter(c=>{if(typeof c!="string"){if(c===void 0)return!1;throw new TypeError("Expected '".concat(t,"' to be an array of strings, but found a type of '").concat(typeof c,"' in the array"))}return!0})},oe,ae,le,Se=(e,t)=>{t=E({caseSensitive:!1},t);let c="s"+(t.caseSensitive?"":"i"),g=e+"|"+c;if(G.has(g))return G.get(g);let y=e[0]==="!";y&&(e=e.slice(1)),e=e.replaceAll(String.raw(oe||(oe=x(["*"],["\\*"]))),"__ESCAPED_STAR__").replaceAll("\\\\","__ESCAPED_BACKSLASH__").replaceAll(/\\(.)/g,"$1"),e=W(e).replaceAll(String.raw(ae||(ae=x(["*"],["\\*"]))),".*"),e=e.replaceAll("__ESCAPED_STAR__",String.raw(le||(le=x(["*"],["\\*"])))).replaceAll("__ESCAPED_BACKSLASH__","\\\\");let h=new RegExp("^".concat(e,"$"),c);return h.negated=y,G.set(g,h),h},Ae=(e,t,c,g)=>{if(e=ie(e,"inputs"),t=ie(t,"patterns"),t.length===0)return[];t=t.map(o=>Se(o,c));let y=t.filter(o=>o.negated),h=t.filter(o=>!o.negated),{allPatterns:p}=c||{},n=[];if(p&&g&&y.length>1&&h.length===0){for(let o of e)for(let i of y)if(i.test(o))return[];return e.slice(0,1)}for(let o of e){let i=!1;for(let a of y)if(a.test(o)){i=!0;break}if(!i){if(h.length===0)n.push(o);else if(p){let a=Array.from({length:h.length},()=>!1);for(let[r,l]of h.entries())l.test(o)&&(a[r]=!0);a.every(Boolean)&&n.push(o)}else{let a=!1;for(let r of h)if(r.test(o)){a=!0;break}a&&n.push(o)}if(g&&n.length>0)break}}return n};function C(e,t,c){return Ae(e,t,c,!0).length>0}var ce="8.1.3";var ve=ce,ue={ignoreKeys:[],ignorePaths:[],acceptArrays:!1,acceptArraysIgnore:[],enforceStrictKeyset:!0,schema:{},msg:"check-types-mini",optsVarName:"opts"};function De(e,t,c){function g(i){return i!=null}function y(i,a){return typeof a=="string"&&(a=F(a)),Array.from(i).filter(r=>!a.some(l=>C(r,l,{caseSensitive:!0})))}let h=Object.prototype.hasOwnProperty,p=["any","anything","every","everything","all","whatever","whatevs"];if(!g(e))throw new Error("check-types-mini: [THROW_ID_01] First argument is missing!");let n=E(E({},ue),c);if(typeof n.ignoreKeys=="string"&&(n.ignoreKeys=[n.ignoreKeys]),typeof n.ignorePaths=="string"&&(n.ignorePaths=[n.ignorePaths]),typeof n.acceptArraysIgnore=="string"&&(n.acceptArraysIgnore=[n.acceptArraysIgnore]),n.msg="".concat(n.msg).trim(),n.msg[n.msg.length-1]===":"&&(n.msg=n.msg.slice(0,n.msg.length-1).trim()),v(n.schema))Object.keys(n.schema).forEach(i=>{if(v(n.schema[i])){let a={};R(n.schema[i],(r,l,b)=>{let $=l!==void 0?l:r;return!Array.isArray($)&&!v($)&&(a["".concat(i,".").concat(b.path)]=$),$}),delete n.schema[i],n.schema=E(E({},n.schema),a)}}),Object.keys(n.schema).forEach(i=>{Array.isArray(n.schema[i])||(n.schema[i]=[n.schema[i]]),n.schema[i]=n.schema[i].map(a=>"".concat(a).toLowerCase().trim())});else if(n.schema!=null)throw new Error("check-types-mini: opts.schema was customised to ".concat(JSON.stringify(n.schema,null,0)," which is not object but ").concat(typeof n.schema));if(g(t)||(t={}),n.enforceStrictKeyset)if(g(n.schema)&&Object.keys(n.schema).length){if(t&&y(D(Object.keys(e),Object.keys(t).concat(Object.keys(n.schema))),n.ignoreKeys).length){let i=D(Object.keys(e),Object.keys(t).concat(Object.keys(n.schema)));throw new TypeError("".concat(n.msg,": ").concat(n.optsVarName,".enforceStrictKeyset is on and the following key").concat(i.length>1?"s":""," ").concat(i.length>1?"are":"is"," not covered by schema and/or reference objects: ").concat(i.join(", ")))}}else if(v(t)&&Object.keys(t).length){if(y(D(Object.keys(e),Object.keys(t)),n.ignoreKeys).length!==0){let i=D(Object.keys(e),Object.keys(t));throw new TypeError("".concat(n.msg,": The input object has key").concat(i.length>1?"s":""," which ").concat(i.length>1?"are":"is"," not covered by the reference object: ").concat(i.join(", ")))}else if(y(D(Object.keys(t),Object.keys(e)),n.ignoreKeys).length!==0){let i=D(Object.keys(t),Object.keys(e));throw new TypeError("".concat(n.msg,": The reference object has key").concat(i.length>1?"s":""," which ").concat(i.length>1?"are":"is"," not present in the input object: ").concat(i.join(", ")))}}else throw new TypeError("".concat(n.msg,": Both ").concat(n.optsVarName,".schema and reference objects are missing! We don't have anything to match the keys as you requested via resolvedOpts.enforceStrictKeyset!"));let o=[];R(e,(i,a,r)=>{let l=a,b=i;if(r.parentType==="array"&&(b=void 0,l=i),Array.isArray(o)&&o.length&&o.some(s=>r.path.startsWith(s))||b&&n.ignoreKeys.some(s=>b&&C(b,s))||n.ignorePaths.some(s=>C(r.path,s)))return l;let $=!(!v(l)&&!Array.isArray(l)&&Array.isArray(r.parent)),S=!1;v(n.schema)&&h.call(n.schema,r.path)&&(S=!0);let f=!1;if(v(t)&&I.default.has(t,r.path)&&(f=!0),n.enforceStrictKeyset&&$&&!S&&!f)throw new TypeError("".concat(n.msg,": ").concat(n.optsVarName,".").concat(r.path," is neither covered by reference object (second input argument), nor ").concat(n.optsVarName,".schema! To stop this error, turn off ").concat(n.optsVarName,".enforceStrictKeyset or provide some type reference (2nd argument or ").concat(n.optsVarName,".schema).\n\nDebug info:\n\nobj = ").concat(JSON.stringify(e,null,4),"\n\nref = ").concat(JSON.stringify(t,null,4),"\n\ninnerObj = ").concat(JSON.stringify(r,null,4),"\n\nresolvedOpts = ").concat(JSON.stringify(n,null,4),"\n\ncurrent = ").concat(JSON.stringify(l,null,4),"\n\n"));if(S){let s=F(n.schema[r.path]).map(u=>"".concat(u).toLowerCase());if(I.default.set(n.schema,r.path,s),te(s,p).length)o.push(r.path);else if(l!==!0&&l!==!1&&!s.includes((0,w.default)(l).toLowerCase())||(l===!0||l===!1)&&!s.includes(String(l))&&!s.includes("boolean"))if(Array.isArray(l)&&n.acceptArrays){for(let u=0,m=l.length;u<m;u++)if(!s.includes((0,w.default)(l[u]).toLowerCase()))throw new TypeError("".concat(n.msg,": ").concat(n.optsVarName,".").concat(r.path,".").concat(u,", the ").concat(u,"th element (equal to ").concat(JSON.stringify(l[u],null,0),") is of a type ").concat((0,w.default)(l[u]).toLowerCase(),", but only the following are allowed by the ").concat(n.optsVarName,".schema: ").concat(s.join(", ")))}else throw new TypeError("".concat(n.msg,": ").concat(n.optsVarName,".").concat(r.path," was customised to ").concat((0,w.default)(l)!=="string"?'"':"").concat(JSON.stringify(l,null,0)).concat((0,w.default)(l)!=="string"?'"':""," (type: ").concat((0,w.default)(l).toLowerCase(),") which is not among the allowed types in schema (which is equal to ").concat(JSON.stringify(s,null,0),")"))}else if(t&&v(t)&&f){let s=I.default.get(t,r.path);if(n.acceptArrays&&Array.isArray(l)&&!n.acceptArraysIgnore.includes(i)){if(!l.every(m=>(0,w.default)(m).toLowerCase()===(0,w.default)(t[i]).toLowerCase()))throw new TypeError("".concat(n.msg,": ").concat(n.optsVarName,".").concat(r.path," was customised to be array, but not all of its elements are ").concat((0,w.default)(t[i]).toLowerCase(),"-type"))}else if((0,w.default)(l)!==(0,w.default)(s))throw new TypeError("".concat(n.msg,": ").concat(n.optsVarName,".").concat(r.path," was customised to ").concat((0,w.default)(l).toLowerCase()==="string"?"":'"').concat(JSON.stringify(l,null,0)).concat((0,w.default)(l).toLowerCase()==="string"?"":'"'," which is not ").concat((0,w.default)(s).toLowerCase()," but ").concat((0,w.default)(l).toLowerCase()))}return l})}function Ne(e,t,c){De(e,t,c)}return be(ke);})();
10
+ "use strict";var checkTypesMini=(()=>{var oe=Object.create;var D=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames,_=Object.getOwnPropertySymbols,ae=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable;var B=(e,n,r)=>n in e?D(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,V=(e,n)=>{for(var r in n||(n={}))J.call(n,r)&&B(e,r,n[r]);if(_)for(var r of _(n))ue.call(n,r)&&B(e,r,n[r]);return e};var ce=(e,n)=>()=>{try{return n||e((n={exports:{}}).exports,n),n.exports}catch(r){throw n=0,r}},fe=(e,n)=>{for(var r in n)D(e,r,{get:n[r],enumerable:!0})},U=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of le(n))!J.call(e,i)&&i!==r&&D(e,i,{get:()=>n[i],enumerable:!(t=se(n,i))||t.enumerable});return e};var pe=(e,n,r)=>(r=e!=null?oe(ae(e)):{},U(n||!e||!e.__esModule?D(r,"default",{value:e,enumerable:!0}):r,e)),he=e=>U(D({},"__esModule",{value:!0}),e);var ee=ce((M,W)=>{(function(e,n){typeof M=="object"&&typeof W<"u"?W.exports=n():typeof define=="function"&&define.amd?define(n):(e=typeof globalThis<"u"?globalThis:e||self,e.typeDetect=n())})(M,(function(){"use strict";var e=typeof Promise=="function",n=(function(y){if(typeof globalThis=="object")return globalThis;Object.defineProperty(y,"typeDetectGlobalObject",{get:function(){return this},configurable:!0});var S=typeDetectGlobalObject;return delete y.typeDetectGlobalObject,S})(Object.prototype),r=typeof Symbol<"u",t=typeof Map<"u",i=typeof Set<"u",l=typeof WeakMap<"u",s=typeof WeakSet<"u",a=typeof DataView<"u",u=r&&typeof Symbol.iterator<"u",f=r&&typeof Symbol.toStringTag<"u",w=i&&typeof Set.prototype.entries=="function",h=t&&typeof Map.prototype.entries=="function",d=w&&Object.getPrototypeOf(new Set().entries()),g=h&&Object.getPrototypeOf(new Map().entries()),o=u&&typeof Array.prototype[Symbol.iterator]=="function",c=o&&Object.getPrototypeOf([][Symbol.iterator]()),p=u&&typeof String.prototype[Symbol.iterator]=="function",b=p&&Object.getPrototypeOf(""[Symbol.iterator]()),O=8,m=-1;function $(y){var S=typeof y;if(S!=="object")return S;if(y===null)return"null";if(y===n)return"global";if(Array.isArray(y)&&(f===!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 A=f&&y[Symbol.toStringTag];if(typeof A=="string")return A;var v=Object.getPrototypeOf(y);return v===RegExp.prototype?"RegExp":v===Date.prototype?"Date":e&&v===Promise.prototype?"Promise":i&&v===Set.prototype?"Set":t&&v===Map.prototype?"Map":s&&v===WeakSet.prototype?"WeakSet":l&&v===WeakMap.prototype?"WeakMap":a&&v===DataView.prototype?"DataView":t&&v===g?"Map Iterator":i&&v===d?"Set Iterator":o&&v===c?"Array Iterator":p&&v===b?"String Iterator":v===null?"Object":Object.prototype.toString.call(y).slice(O,m)}return $}))});var Pe={};fe(Pe,{checkTypesMini:()=>Ne,defaults:()=>ne,version:()=>De});function ge(){let e=[],n=0,r=!1;return{append(t){return r?!1:n+t.length>1999?(e.push("\u2026"),n+=1,r=!0,!1):(e.push(t),n+=t.length,!0)},result(){return e.join("")},stopped(){return r}}}function ye(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function I(e,n){if(e.append('"')){for(let r=0;r<n.length&&!e.stopped();r+=1){let t=n.charCodeAt(r);t===34?e.append('\\"'):t===92?e.append("\\\\"):t===8?e.append("\\b"):t===9?e.append("\\t"):t===10?e.append("\\n"):t===12?e.append("\\f"):t===13?e.append("\\r"):t<32||t===8232||t===8233||t>=55296&&t<=57343?e.append(ye(t)):e.append(n[r])}e.append('"')}}function me(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function Q(e,n){e.append("Symbol(");let r=String(n);r.length>8&&I(e,r.slice(7,-1)),e.append(")")}function F(e,n){typeof n=="symbol"?Q(e,n):I(e,String(n))}function k(e,n=0){let r=ge(),t=n===4?4:0,i=new WeakSet,l=0;function s(o){t&&r.append(" ".repeat(o*t))}function a(o,c){o&&r.append(","),t&&(r.append("\n"),s(c+1))}function u(o,c,p){t&&c&&(r.append("\n"),s(p)),r.append(o)}function f(o,c){Object.prototype.hasOwnProperty.call(o,"value")?g(o.value,c):r.append(me(o))}function w(o,c){let p;try{p=Reflect.getOwnPropertyDescriptor(o,"length")}catch(m){r.append("[Uninspectable]");return}let b=p==null?void 0:p.value;if(!Number.isSafeInteger(b)||b<0){r.append("[Uninspectable]");return}r.append("[");let O=!1;for(let m=0;m<b&&!r.stopped();m+=1){if(a(O,c),O=!0,l>=50){r.append("[MaxEntries]");break}l+=1;let $;try{$=Reflect.getOwnPropertyDescriptor(o,String(m))}catch(y){r.append("[Uninspectable]");continue}$!=null&&$.enumerable?f($,c+1):r.append("[Empty]")}u("]",O,c)}function h(o,c){let p;try{p=Reflect.ownKeys(o)}catch(O){r.append("[Uninspectable]");return}r.append("{");let b=!1;for(let O of p){if(r.stopped())break;if(l>=50){a(b,c),b=!0,I(r,"\u2026"),r.append(t?": ":":"),r.append("[MaxEntries]");break}l+=1;let m;try{m=Reflect.getOwnPropertyDescriptor(o,O)}catch($){a(b,c),b=!0,F(r,O),r.append(t?": ":":"),r.append("[Uninspectable]");continue}m!=null&&m.enumerable&&(a(b,c),b=!0,F(r,O),r.append(t?": ":":"),f(m,c+1))}u("}",b,c)}function d(o,c){if(i.has(o)){r.append("[Circular]");return}if(c>=5){r.append("[MaxDepth]");return}let p;try{p=Array.isArray(o)}catch(b){r.append("[Uninspectable]");return}i.add(o);try{p?w(o,c):h(o,c)}finally{i.delete(o)}}function g(o,c){o===null?r.append("null"):typeof o=="string"?I(r,o):typeof o=="number"?r.append(Object.is(o,-0)?"-0":String(o)):typeof o=="boolean"?r.append(o?"true":"false"):typeof o>"u"?r.append("undefined"):typeof o=="bigint"?r.append("".concat(o,"n")):typeof o=="symbol"?Q(r,o):typeof o=="function"?r.append("[Function]"):d(o,c)}try{return g(e,0),r.result()}catch(o){return"[Uninspectable]"}}var Le=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"]);function T(e){if(e==null||typeof e!="object")return!1;let n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}var de=256,be=1024,$e=1,we=new Map,Se=new Map;function N(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let n=String.fromCharCode(e).toUpperCase();if(n.length!==1)return e;let r=n.charCodeAt(0);return e>127&&r<128?e:r}function x(e,n,r,t,i,l){for(let s=0;s<i;s++){let a=e.charCodeAt(n+s),u=r.charCodeAt(t+s);if(l||(a>=97&&a<=122&&(a-=32),u>=97&&u<=122&&(u-=32)),a!==u)return!1}return!0}function q(e,n,r){let t=n.indexOf("\\");if(t===-1&&e===n)return!0;let i=n.indexOf("*");if(t===-1&&i===-1){if(r)return!1;for(let w=0;w<n.length;w++)if(n.charCodeAt(w)>127)return;return e.length===n.length&&x(e,0,n,0,n.length,!1)}if(t!==-1)return;let l=0,s=!1,a=-1;for(let w=0;w<n.length;w++){let h=n.charCodeAt(w);if(h>127)return;if(h===42){if(a=w,!s){if(l++,l>1)return;s=!0}}else s=!1}let u=a+1,f=n.length-u;return e.length<i+f?!1:x(e,0,n,0,i,r)&&x(e,e.length-f,n,u,f,r)}function Oe(e){let n=new Uint32Array(e.length),r=0;for(let t=1;t<e.length;t++){for(;r>0&&e[t]!==e[r];)r=n[r-1];e[t]===e[r]&&r++,n[t]=r}return n}function ve(e,n){let r=[[]],t=!0,i=!1,l=!1,s=0;for(let d=0;d<e.length;){let g=e.codePointAt(d);if(g!==92){if(g===42)i=!0,l||(r.push([]),l=!0);else{let m=n?g:N(g);r[r.length-1].push(m),t&&(t=m<=127),s++,l=!1}d+=g>65535?2:1;continue}let o=d+1;for(;e.charCodeAt(o)===92;)o++;let c=o-d,p=e.codePointAt(o),b,O=!1;p===42?(O=c%2===0,b=O?c/2:(c-1)/2):p===void 0||p===10||p===13||p===8232||p===8233?b=Math.ceil(c/2):b=Math.floor(c/2);for(let m=0;m<b;m++)r[r.length-1].push(92),s++;if(O){l=!1,d=o;continue}if(p!==void 0){let m=n?p:N(p);r[r.length-1].push(m),t&&(t=m<=127),s++,o+=p>65535?2:1}l=!1,d=o}let a=i&&r[0].length===0,u=i&&r[r.length-1].length===0,f=[];for(let d of r)d.length&&f.push({values:d});let w=a?0:1,h=f.length-(u?0:1);for(let d=w;d<h;d++)f[d].values.length>$e&&(f[d].failure=Oe(f[d].values));return{asciiOnly:t,endsWithWildcard:u,hasWildcard:i,minimumInputLength:s,segments:f,startsWithWildcard:a}}function z(e,n){let r=n?we:Se,t=e.length<=be;if(t){let l=r.get(e);if(l)return l}let i=ve(e,n);if(t){if(r.size>=de){let l=r.keys().next().value;l!==void 0&&r.delete(l)}r.set(e,i)}return i}function Y(e,n){if(n){let i=[];for(let l=0;l<e.length;){let s=e.codePointAt(l);i.push(s),l+=s>65535?2:1}return i}let r=new Uint32Array(e.length),t=0;for(let i=0;i<e.length;){let l=e.codePointAt(i);r[t]=N(l),t++,i+=l>65535?2:1}return t===r.length?r:r.subarray(0,t)}function j(e,n,r,t){for(let i=0;i<r.values.length;i++){let l=e.charCodeAt(n+i);if(!t&&l>=97&&l<=122&&(l-=32),l!==r.values[i])return!1}return!0}function Ae(e,n,r,t,i){let l=t-n.values.length;if(l<r)return-1;if(!n.failure){for(let a=r;a<=l;a++)if(j(e,a,n,i))return a;return-1}let s=0;for(let a=r;a<t;a++){let u=e.charCodeAt(a);for(!i&&u>=97&&u<=122&&(u-=32);s>0&&u!==n.values[s];)s=n.failure[s-1];if(u===n.values[s]&&(s++,s===n.values.length))return a-s+1}return-1}function Z(e,n,r){if(e.length<n.minimumInputLength)return!1;if(!n.hasWildcard)return e.length===n.minimumInputLength&&j(e,0,n.segments[0],r);let t=0,i=n.segments.length,l=0,s=e.length;if(!n.startsWithWildcard){let a=n.segments[0];if(!j(e,0,a,r))return!1;l=a.values.length,t++}if(!n.endsWithWildcard){i--;let a=n.segments[i];if(s-=a.values.length,!j(e,s,a,r))return!1}for(let a=t;a<i;a++){let u=n.segments[a],f=Ae(e,u,l,s,r);if(f===-1)return!1;l=f+u.values.length}return!0}function C(e,n,r){for(let t=0;t<r.values.length;t++)if(e[n+t]!==r.values[t])return!1;return!0}function ke(e,n,r,t){let i=t-n.values.length;if(i<r)return-1;if(!n.failure){for(let s=r;s<=i;s++)if(C(e,s,n))return s;return-1}let l=0;for(let s=r;s<t;s++){for(;l>0&&e[s]!==n.values[l];)l=n.failure[l-1];if(e[s]===n.values[l]&&(l++,l===n.values.length))return s-l+1}return-1}function X(e,n){if(e.length<n.minimumInputLength)return!1;if(!n.hasWildcard)return e.length===n.minimumInputLength&&C(e,0,n.segments[0]);let r=0,t=n.segments.length,i=0,l=e.length;if(!n.startsWithWildcard){let s=n.segments[0];if(!C(e,0,s))return!1;i=s.values.length,r++}if(!n.endsWithWildcard){t--;let s=n.segments[t];if(l-=s.values.length,!C(e,l,s))return!1}for(let s=r;s<t;s++){let a=n.segments[s],u=ke(e,a,i,l);if(u===-1)return!1;i=u+a.values.length}return!0}function Te(e,n,r){let t=q(e,n,r);if(t!==void 0)return t;let i=z(n,r);return i.asciiOnly?Z(e,i,r):X(Y(e,r),i)}function G(e,n,r,t){var s;let i=q(e,n,r);if(i!==void 0)return i;let l=z(n,r);return l.asciiOnly?Z(e,l,r):((s=t.tokens)!=null||(t.tokens=Y(e,r)),X(t.tokens,l))}function P(e,n,r){if(typeof n!="string"&&!n.length)return!1;let t=r===void 0?!1:r.caseSensitiveMatch===!0;if(typeof n=="string"){let a=n.charCodeAt(0)===33,u=a?n.slice(1):n,f=Te(e,u,t);return a?!f:f}let i={},l=!1,s=!1;for(let a of n){let u=a.charCodeAt(0)===33,f=u?a.slice(1):a;if(u){if(G(e,f,t,i))return!1}else l=!0,!s&&G(e,f,t,i)&&(s=!0)}return l?s:!0}var E=pe(ee(),1);var te="8.2.0";var De=te,ne={ignoreKeys:[],ignorePaths:[],acceptArrays:!1,acceptArraysIgnore:[],enforceStrictKeyset:!0,schema:{},msg:"check-types-mini",optsVarName:"opts"},je=new Set(["any","anything","every","everything","all","whatever","whatevs"]),ie=Object.prototype.hasOwnProperty,Ce={caseSensitiveMatch:!0};function re(e,n){return n.some(r=>e===r||P(e,r))}function L(e,n){return n.length?e.filter(r=>!n.some(t=>r===t||P(r,t,Ce))):e}function R(e,n){if(!n.length)return e;let r=new Set(n);return e.filter(t=>!r.has(t))}function Ie(e){let n={};function r(t,i){if(T(t)){for(let s of Object.keys(t))r(t[s],i?"".concat(i,".").concat(s):s);return}let l=Array.isArray(t)?t:[t];n[i]=l.map(s=>"".concat(s).toLowerCase().trim())}for(let t of Object.keys(e))r(e[t],t);return n}function H(e,n,r=""){if(Array.isArray(e))for(let t=0;t<e.length;t++){if(e[t]===void 0)continue;let i=r?"".concat(r,".").concat(t):"".concat(t);n(e[t],void 0,{path:i,parent:e,parentType:"array"}),H(e[t],n,i)}else if(T(e))for(let t of Object.keys(e)){let i=r?"".concat(r,".").concat(t):t;n(t,e[t],{path:i,parent:e,parentType:"object"}),H(e[t],n,i)}}function Ve(e,n){let r=e,t=0;for(;t<=n.length;){let i=n.indexOf(".",t),l=i===-1?n.slice(t):n.slice(t,i);if(r===null||typeof r!="object"&&typeof r!="function"||!ie.call(r,l))return[!1,void 0];if(r=r[l],i===-1)return[!0,r];t=i+1}return[!1,void 0]}function xe(e,n,r){if(e==null)throw new Error("check-types-mini/checkTypesMini(): [THROW_ID_01] First argument is missing!");let t=V(V({},ne),r);if(typeof t.ignoreKeys=="string"&&(t.ignoreKeys=[t.ignoreKeys]),typeof t.ignorePaths=="string"&&(t.ignorePaths=[t.ignorePaths]),typeof t.acceptArraysIgnore=="string"&&(t.acceptArraysIgnore=[t.acceptArraysIgnore]),t.msg="".concat(t.msg).trim(),t.msg[t.msg.length-1]===":"&&(t.msg=t.msg.slice(0,t.msg.length-1).trim()),T(t.schema))t.schema=Ie(t.schema);else if(t.schema!=null)throw new Error("check-types-mini/checkTypesMini(): [THROW_ID_02] opts.schema was customised to ".concat(k(t.schema)," which is not object but ").concat(typeof t.schema));n==null&&(n={});let i=t.ignoreKeys,l=t.ignorePaths,s=t.acceptArraysIgnore,a=Object.keys(e),u=T(n)?Object.keys(n):[],f=T(t.schema)?Object.keys(t.schema):[];if(t.enforceStrictKeyset)if(f.length){let h=L(R(a,u.concat(f)),i);if(h.length)throw new TypeError("check-types-mini/checkTypesMini(): [THROW_ID_03] ".concat(t.msg,": ").concat(t.optsVarName,".enforceStrictKeyset is on and the following key").concat(h.length>1?"s":""," ").concat(h.length>1?"are":"is"," not covered by schema and/or reference objects: ").concat(h.join(", ")))}else if(u.length){let h=L(R(a,u),i);if(h.length)throw new TypeError("check-types-mini/checkTypesMini(): [THROW_ID_04] ".concat(t.msg,": The input object has key").concat(h.length>1?"s":""," which ").concat(h.length>1?"are":"is"," not covered by the reference object: ").concat(h.join(", ")));if(h=L(R(u,a),i),h.length)throw new TypeError("check-types-mini/checkTypesMini(): [THROW_ID_05] ".concat(t.msg,": The reference object has key").concat(h.length>1?"s":""," which ").concat(h.length>1?"are":"is"," not present in the input object: ").concat(h.join(", ")))}else throw new TypeError("check-types-mini/checkTypesMini(): [THROW_ID_06] ".concat(t.msg,": Both ").concat(t.optsVarName,".schema and reference objects are missing! We don't have anything to match the keys as you requested via resolvedOpts.enforceStrictKeyset!"));let w=[];H(e,(h,d,g)=>{let o=d,c=h;if(g.parentType==="array"&&(c=void 0,o=h),w.length&&w.some($=>g.path.startsWith("".concat($,".")))||c&&re(c,i)||re(g.path,l))return o;let p=!(!T(o)&&!Array.isArray(o)&&Array.isArray(g.parent)),b=T(t.schema)&&ie.call(t.schema,g.path),[O,m]=T(n)?Ve(n,g.path):[!1,void 0];if(t.enforceStrictKeyset&&p&&!b&&!O)throw new TypeError("check-types-mini/checkTypesMini(): [THROW_ID_07] ".concat(t.msg,": ").concat(t.optsVarName,".").concat(g.path," 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 some type reference (2nd argument or ").concat(t.optsVarName,".schema).\n\nDebug info:\n\nobj = ").concat(k(e,4),"\n\nref = ").concat(k(n,4),"\n\ninnerObj = ").concat(k(g,4),"\n\nresolvedOpts = ").concat(k(t,4),"\n\ncurrent = ").concat(k(o,4),"\n\n"));if(b){let $=t.schema[g.path];if($.filter(S=>je.has(S)).length)w.push(g.path);else{let S=(0,E.default)(o).toLowerCase();if(o!==!0&&o!==!1&&!$.includes(S)||(o===!0||o===!1)&&!$.includes(String(o))&&!$.includes("boolean"))if(Array.isArray(o)&&t.acceptArrays)for(let A=0,v=o.length;A<v;A++){let K=(0,E.default)(o[A]).toLowerCase();if(!$.includes(K))throw new TypeError("check-types-mini/checkTypesMini(): [THROW_ID_08] ".concat(t.msg,": ").concat(t.optsVarName,".").concat(g.path,".").concat(A,", the ").concat(A,"th element (equal to ").concat(k(o[A]),") is of a type ").concat(K,", but only the following are allowed by the ").concat(t.optsVarName,".schema: ").concat($.join(", ")))}else throw new TypeError("check-types-mini/checkTypesMini(): [THROW_ID_09] ".concat(t.msg,": ").concat(t.optsVarName,".").concat(g.path," was customised to ").concat(S!=="string"?'"':"").concat(k(o)).concat(S!=="string"?'"':""," (type: ").concat(S,") which is not among the allowed types in schema (which is equal to ").concat(k($),")"))}}else if(n&&T(n)&&O){let $=(0,E.default)(o),y=(0,E.default)(m);if(t.acceptArrays&&Array.isArray(o)&&!s.includes(h)){let S=y.toLowerCase();if(!o.every(v=>(0,E.default)(v).toLowerCase()===S))throw new TypeError("check-types-mini/checkTypesMini(): [THROW_ID_10] ".concat(t.msg,": ").concat(t.optsVarName,".").concat(g.path," was customised to be array, but not all of its elements are ").concat(S,"-type"))}else if($!==y){let S=$.toLowerCase();throw new TypeError("check-types-mini/checkTypesMini(): [THROW_ID_11] ".concat(t.msg,": ").concat(t.optsVarName,".").concat(g.path," was customised to ").concat(S==="string"?"":'"').concat(k(o)).concat(S==="string"?"":'"'," which is not ").concat(y.toLowerCase()," but ").concat(S))}}return o})}function Ne(e,n,r){xe(e,n,r)}return he(Pe);})();
11
11
  /**
12
12
  * @name codsen-utils
13
13
  * @fileoverview Various utility functions
14
- * @version 1.7.3
14
+ * @version 1.8.0
15
15
  * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/codsen-utils/}
18
18
  */
19
- /**
20
- * @name ast-monkey-util
21
- * @fileoverview Utility library of AST helper functions
22
- * @version 3.1.3
23
- * @author Roy Revelt
24
- * @license MIT
25
- * {@link https://codsen.com/os/ast-monkey-util/}
26
- */
27
- /**
28
- * @name ast-monkey-traverse
29
- * @fileoverview Utility library to traverse AST
30
- * @version 4.1.3
31
- * @author Roy Revelt
32
- * @license MIT
33
- * {@link https://codsen.com/os/ast-monkey-traverse/}
34
- */
35
- /**
36
- * @name arrayiffy-if-string
37
- * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
38
- * @version 5.1.3
39
- * @author Roy Revelt
40
- * @license MIT
41
- * {@link https://codsen.com/os/arrayiffy-if-string/}
42
- */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "check-types-mini",
3
- "version": "8.1.3",
3
+ "version": "8.2.0",
4
4
  "description": "Validate options object",
5
5
  "keywords": [
6
6
  "compare",
@@ -36,49 +36,44 @@
36
36
  },
37
37
  "types": "types/index.d.ts",
38
38
  "scripts": {
39
- "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
40
- "cjs-off": "exit 0",
41
- "cjs-on": "exit 0",
42
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
39
+ "build": "node ../../ops/scripts/esbuild.js && npm run dts",
40
+ "coverage": "c8 uvu test",
41
+ "dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
43
42
  "devtest": "c8 npm run unit && npm run examples && npm run lint",
44
- "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
43
+ "dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
45
44
  "examples": "node '../../ops/scripts/run-examples.js'",
46
- "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
47
- "letspublish": "npm publish --provenance || :",
48
- "lint": "eslint . --fix --concurrency=auto --cache",
45
+ "lect": "node '../../ops/lect/lect.js'",
46
+ "lect:check": "node '../../ops/lect/lect.js' --check",
47
+ "lint": "biome lint --error-on-warnings . && npm run typecheck",
48
+ "lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
49
49
  "perf": "node perf/check.js",
50
50
  "prep": "echo 'ready'",
51
- "prettier": "prettier",
52
- "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
53
- "pretest": "npm run lect && npm run build",
51
+ "prettier": "biome format",
52
+ "prettier:format": "biome format --write .",
53
+ "pretest": "npm run lect:check && npm run build",
54
54
  "test": "npm run devtest",
55
+ "typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
55
56
  "unit": "uvu test"
56
57
  },
57
- "engines": {
58
- "node": ">=14.18.0"
59
- },
60
58
  "c8": {
59
+ "all": true,
61
60
  "check-coverage": true,
62
- "exclude": [
63
- "**/test/**/*.*"
64
- ],
61
+ "exclude": ["**/test/**/*.*"],
62
+ "include": ["dist/*.esm.js"],
65
63
  "lines": 100
66
64
  },
67
65
  "lect": {
68
66
  "licence": {
69
- "extras": [
70
- ""
71
- ]
67
+ "extras": [""]
72
68
  }
73
69
  },
74
70
  "dependencies": {
75
- "arrayiffy-if-string": "^5.1.3",
76
- "ast-monkey-traverse": "^4.1.3",
77
- "codsen-utils": "^1.7.3",
78
- "matcher": "^6.0.0",
79
- "object-path": "^0.11.8",
71
+ "codsen-utils": "^1.8.0",
80
72
  "type-detect": "^4.1.0"
81
73
  },
74
+ "engines": {
75
+ "node": ">=18.20.8"
76
+ },
82
77
  "publishConfig": {
83
78
  "registry": "https://registry.npmjs.org/"
84
79
  }
package/types/index.d.ts CHANGED
@@ -23,3 +23,4 @@ declare function checkTypesMini(
23
23
  ): void;
24
24
 
25
25
  export { checkTypesMini, defaults, version };
26
+ export type { Obj, Opts };