check-types-mini 8.2.0 → 8.2.1

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,12 +3,18 @@
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.1 (2026-08-22)
7
+
8
+ ### Performance Improvements
9
+
10
+ - optimise package hot paths and JSON editing ([f3112bd](https://github.com/codsen/codsen/commit/f3112bd7fc0d7c9bc09312d3744c950691d72ca5))
11
+
6
12
  ## 8.2.0 (2026-08-19)
7
13
 
8
14
  ### Bug Fixes
9
15
 
10
16
  - 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))
17
+ - resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
12
18
  - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
13
19
  - validate nested option paths correctly ([b9b83d2](https://github.com/codsen/codsen/commit/b9b83d2b537e94b35a21d8ac117c1a4057ad316d))
14
20
 
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @name check-types-mini
3
3
  * @fileoverview Validate options object
4
- * @version 8.2.0
4
+ * @version 8.2.1
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{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).
10
+ import{formatDiagnosticValue as $,isPlainObject as m,match as I}from"codsen-utils";import g from"type-detect";var j="8.2.1";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
 
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @name check-types-mini
3
3
  * @fileoverview Validate options object
4
- * @version 8.2.0
4
+ * @version 8.2.1
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 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);})();
10
+ "use strict";var checkTypesMini=(()=>{var se=Object.create;var D=Object.defineProperty;var le=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames,_=Object.getOwnPropertySymbols,ue=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty,ce=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,x=(e,n)=>{for(var r in n||(n={}))J.call(n,r)&&B(e,r,n[r]);if(_)for(var r of _(n))ce.call(n,r)&&B(e,r,n[r]);return e};var fe=(e,n)=>()=>{try{return n||e((n={exports:{}}).exports,n),n.exports}catch(r){throw n=0,r}},pe=(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 ae(n))!J.call(e,i)&&i!==r&&D(e,i,{get:()=>n[i],enumerable:!(t=le(n,i))||t.enumerable});return e};var he=(e,n,r)=>(r=e!=null?se(ue(e)):{},U(n||!e||!e.__esModule?D(r,"default",{value:e,enumerable:!0}):r,e)),ge=e=>U(D({},"__esModule",{value:!0}),e);var te=fe((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 O=typeDetectGlobalObject;return delete y.typeDetectGlobalObject,O})(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",m=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]()),S=8,d=-1;function $(y){var O=typeof y;if(O!=="object")return O;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===m?"Set Iterator":o&&v===c?"Array Iterator":p&&v===b?"String Iterator":v===null?"Object":Object.prototype.toString.call(y).slice(S,d)}return $}))});var Me={};pe(Me,{checkTypesMini:()=>Ne,defaults:()=>ie,version:()=>je});function ye(){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 de(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(de(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=ye(),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(d){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 S=!1;for(let d=0;d<b&&!r.stopped();d+=1){if(a(S,c),S=!0,l>=50){r.append("[MaxEntries]");break}l+=1;let $;try{$=Reflect.getOwnPropertyDescriptor(o,String(d))}catch(y){r.append("[Uninspectable]");continue}$!=null&&$.enumerable?f($,c+1):r.append("[Empty]")}u("]",S,c)}function h(o,c){let p;try{p=Reflect.ownKeys(o)}catch(S){r.append("[Uninspectable]");return}r.append("{");let b=!1;for(let S 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 d;try{d=Reflect.getOwnPropertyDescriptor(o,S)}catch($){a(b,c),b=!0,F(r,S),r.append(t?": ":":"),r.append("[Uninspectable]");continue}d!=null&&d.enumerable&&(a(b,c),b=!0,F(r,S),r.append(t?": ":":"),f(d,c+1))}u("}",b,c)}function m(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]"):m(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 Q,He=(Q=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:Q.get;var Ke=Date.prototype.getTime;var be=256,$e=1024,we=1,Oe=new Map,Se=new Map;function P(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 V(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 z(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&&V(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:V(e,0,n,0,i,r)&&V(e,e.length-f,n,u,f,r)}function ve(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 Ae(e,n){let r=[[]],t=!0,i=!1,l=!1,s=0;for(let m=0;m<e.length;){let g=e.codePointAt(m);if(g!==92){if(g===42)i=!0,l||(r.push([]),l=!0);else{let d=n?g:P(g);r[r.length-1].push(d),t&&(t=d<=127),s++,l=!1}m+=g>65535?2:1;continue}let o=m+1;for(;e.charCodeAt(o)===92;)o++;let c=o-m,p=e.codePointAt(o),b,S=!1;p===42?(S=c%2===0,b=S?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 d=0;d<b;d++)r[r.length-1].push(92),s++;if(S){l=!1,m=o;continue}if(p!==void 0){let d=n?p:P(p);r[r.length-1].push(d),t&&(t=d<=127),s++,o+=p>65535?2:1}l=!1,m=o}let a=i&&r[0].length===0,u=i&&r[r.length-1].length===0,f=[];for(let m of r)m.length&&f.push({values:m});let w=a?0:1,h=f.length-(u?0:1);for(let m=w;m<h;m++)f[m].values.length>we&&(f[m].failure=ve(f[m].values));return{asciiOnly:t,endsWithWildcard:u,hasWildcard:i,minimumInputLength:s,segments:f,startsWithWildcard:a}}function Y(e,n){let r=n?Oe:Se,t=e.length<=$e;if(t){let l=r.get(e);if(l)return l}let i=Ae(e,n);if(t){if(r.size>=be){let l=r.keys().next().value;l!==void 0&&r.delete(l)}r.set(e,i)}return i}function Z(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]=P(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 ke(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 X(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=ke(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 Te(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 ee(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=Te(e,a,i,l);if(u===-1)return!1;i=u+a.values.length}return!0}function Ee(e,n,r){let t=z(e,n,r);if(t!==void 0)return t;let i=Y(n,r);return i.asciiOnly?X(e,i,r):ee(Z(e,r),i)}function G(e,n,r,t){var s;let i=z(e,n,r);if(i!==void 0)return i;let l=Y(n,r);return l.asciiOnly?X(e,l,r):((s=t.tokens)!=null||(t.tokens=Z(e,r)),ee(t.tokens,l))}function N(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=Ee(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=he(te(),1);var re="8.2.1";var je=re,ie={ignoreKeys:[],ignorePaths:[],acceptArrays:!1,acceptArraysIgnore:[],enforceStrictKeyset:!0,schema:{},msg:"check-types-mini",optsVarName:"opts"},Ce=new Set(["any","anything","every","everything","all","whatever","whatevs"]),oe=Object.prototype.hasOwnProperty,Ie={caseSensitiveMatch:!0};function ne(e,n){return n.some(r=>e===r||N(e,r))}function R(e,n){return n.length?e.filter(r=>!n.some(t=>r===t||N(r,t,Ie))):e}function L(e,n){if(!n.length)return e;let r=new Set(n);return e.filter(t=>!r.has(t))}function xe(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"||!oe.call(r,l))return[!1,void 0];if(r=r[l],i===-1)return[!0,r];t=i+1}return[!1,void 0]}function Pe(e,n,r){if(e==null)throw new Error("check-types-mini/checkTypesMini(): [THROW_ID_01] First argument is missing!");let t=x(x({},ie),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=xe(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=R(L(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=R(L(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=R(L(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,m,g)=>{let o=m,c=h;if(g.parentType==="array"&&(c=void 0,o=h),w.length&&w.some($=>g.path.startsWith("".concat($,".")))||c&&ne(c,i)||ne(g.path,l))return o;let p=!(!T(o)&&!Array.isArray(o)&&Array.isArray(g.parent)),b=T(t.schema)&&oe.call(t.schema,g.path),[S,d]=T(n)?Ve(n,g.path):[!1,void 0];if(t.enforceStrictKeyset&&p&&!b&&!S)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(O=>Ce.has(O)).length)w.push(g.path);else{let O=(0,E.default)(o).toLowerCase();if(o!==!0&&o!==!1&&!$.includes(O)||(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(O!=="string"?'"':"").concat(k(o)).concat(O!=="string"?'"':""," (type: ").concat(O,") which is not among the allowed types in schema (which is equal to ").concat(k($),")"))}}else if(n&&T(n)&&S){let $=(0,E.default)(o),y=(0,E.default)(d);if(t.acceptArrays&&Array.isArray(o)&&!s.includes(h)){let O=y.toLowerCase();if(!o.every(v=>(0,E.default)(v).toLowerCase()===O))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(O,"-type"))}else if($!==y){let O=$.toLowerCase();throw new TypeError("check-types-mini/checkTypesMini(): [THROW_ID_11] ".concat(t.msg,": ").concat(t.optsVarName,".").concat(g.path," was customised to ").concat(O==="string"?"":'"').concat(k(o)).concat(O==="string"?"":'"'," which is not ").concat(y.toLowerCase()," but ").concat(O))}}return o})}function Ne(e,n,r){Pe(e,n,r)}return ge(Me);})();
11
11
  /**
12
12
  * @name codsen-utils
13
13
  * @fileoverview Various utility functions
14
- * @version 1.8.0
14
+ * @version 1.9.0
15
15
  * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@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.0",
3
+ "version": "8.2.1",
4
4
  "description": "Validate options object",
5
5
  "keywords": [
6
6
  "compare",
@@ -68,7 +68,7 @@
68
68
  }
69
69
  },
70
70
  "dependencies": {
71
- "codsen-utils": "^1.8.0",
71
+ "codsen-utils": "^1.9.0",
72
72
  "type-detect": "^4.1.0"
73
73
  },
74
74
  "engines": {