codsen-utils 1.9.0 → 1.10.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 +19 -0
- package/README.md +3 -1
- package/dist/codsen-utils.esm.js +16 -18
- package/dist/codsen-utils.umd.js +10 -2
- package/package.json +4 -1
- package/types/index.d.ts +46 -24
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
## 1.10.0 (2026-09-01)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- align object predicate contracts ([2268d1b](https://github.com/codsen/codsen/commit/2268d1b75188c2ec9c13b14ace4360f6836fd1bd))
|
|
11
|
+
- classify Unicode letters by code point ([e166119](https://github.com/codsen/codsen/commit/e166119a72e032ff4e3faffe6d35d766f8a011d0))
|
|
12
|
+
- copy no-op pullAll results ([d09cdf0](https://github.com/codsen/codsen/commit/d09cdf0965cf175d136a8f346d88afb1055c2767))
|
|
13
|
+
- harden glob inclusion matching ([ac901db](https://github.com/codsen/codsen/commit/ac901db39ef29003493a2c76beca9ee23aa5c7ad))
|
|
14
|
+
- parse leading-dot CLI numbers ([8372959](https://github.com/codsen/codsen/commit/8372959d53f80ed9ffe66797f9607b6cf58178bc))
|
|
15
|
+
- preserve deep clone runtime shapes ([a62c091](https://github.com/codsen/codsen/commit/a62c0912158f24238e73c674d8be9c2414748966))
|
|
16
|
+
- preserve null-prototype records ([f2ea76f](https://github.com/codsen/codsen/commit/f2ea76f830bb5d9a8239ff1f0e5c6aef0a32b5c5))
|
|
17
|
+
- preserve proto data keys ([6747b19](https://github.com/codsen/codsen/commit/6747b198c8af2444b75856734422e495d28c11e1))
|
|
18
|
+
- reject unusable regular expressions ([56b79d5](https://github.com/codsen/codsen/commit/56b79d53d4b8067e267aeec3b58328387ea36528))
|
|
19
|
+
- **util-nonempty:** harden shallow value checks ([6f1eda6](https://github.com/codsen/codsen/commit/6f1eda6108ec38d15d30d4b3cb24a8880fcb4656))
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
- isolate diagnostic value formatting ([a7dc987](https://github.com/codsen/codsen/commit/a7dc987a57d3d39f175b942dd8244bdb896ada28))
|
|
24
|
+
|
|
6
25
|
## 1.9.0 (2026-08-22)
|
|
7
26
|
|
|
8
27
|
### Features
|
package/README.md
CHANGED
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
<img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT Licence">
|
|
22
22
|
</p>
|
|
23
23
|
|
|
24
|
+
**No 3rd party dependencies.** All dependencies, checked recursively, are Codsen packages.
|
|
25
|
+
|
|
24
26
|
## Install
|
|
25
27
|
|
|
26
28
|
This package is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
|
|
@@ -42,7 +44,7 @@ assert.equal(isNumberChar("0"), true);
|
|
|
42
44
|
|
|
43
45
|
## Documentation
|
|
44
46
|
|
|
45
|
-
Please [visit codsen.com](https://codsen.com/os/codsen-utils/) for a full description of the API.
|
|
47
|
+
Please [visit codsen.com](https://codsen.com/os/codsen-utils/) for a full description of the API. For **Changelog**, see [raw md on GitHub](https://github.com/codsen/codsen/blob/main/packages/codsen-utils/CHANGELOG.md) or [the website](https://codsen.com/os/codsen-utils/changelog).
|
|
46
48
|
|
|
47
49
|
## Contributing
|
|
48
50
|
|
package/dist/codsen-utils.esm.js
CHANGED
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name codsen-utils
|
|
3
3
|
* @fileoverview Various utility functions
|
|
4
|
-
* @version 1.
|
|
4
|
+
* @version 1.10.1
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/codsen-utils/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var $="1.9.0";function te(){let e=[],n=0,t=!1;return{append(r){return t?!1:n+r.length>1999?(e.push("\u2026"),n+=1,t=!0,!1):(e.push(r),n+=r.length,!0)},result(){return e.join("")},stopped(){return t}}}function re(e){return`\\u${e.toString(16).padStart(4,"0")}`}function I(e,n){if(e.append('"')){for(let t=0;t<n.length&&!e.stopped();t+=1){let r=n.charCodeAt(t);r===34?e.append('\\"'):r===92?e.append("\\\\"):r===8?e.append("\\b"):r===9?e.append("\\t"):r===10?e.append("\\n"):r===12?e.append("\\f"):r===13?e.append("\\r"):r<32||r===8232||r===8233||r>=55296&&r<=57343?e.append(re(r)):e.append(n[t])}e.append('"')}}function oe(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function J(e,n){e.append("Symbol(");let t=String(n);t.length>8&&I(e,t.slice(7,-1)),e.append(")")}function _(e,n){typeof n=="symbol"?J(e,n):I(e,String(n))}function D(e,n=0){let t=te(),r=n===4?4:0,s=new WeakSet,o=0;function i(c){r&&t.append(" ".repeat(c*r))}function l(c,p){c&&t.append(","),r&&(t.append(`
|
|
11
|
-
`),i(p+1))}function f(c,p,g){r&&p&&(t.append(`
|
|
12
|
-
`),i(g)),t.append(c)}function d(c,p){Object.prototype.hasOwnProperty.call(c,"value")?S(c.value,p):t.append(oe(c))}function m(c,p){let g;try{g=Reflect.getOwnPropertyDescriptor(c,"length")}catch{t.append("[Uninspectable]");return}let x=g?.value;if(!Number.isSafeInteger(x)||x<0){t.append("[Uninspectable]");return}t.append("[");let b=!1;for(let k=0;k<x&&!t.stopped();k+=1){if(l(b,p),b=!0,o>=50){t.append("[MaxEntries]");break}o+=1;let R;try{R=Reflect.getOwnPropertyDescriptor(c,String(k))}catch{t.append("[Uninspectable]");continue}R?.enumerable?d(R,p+1):t.append("[Empty]")}f("]",b,p)}function O(c,p){let g;try{g=Reflect.ownKeys(c)}catch{t.append("[Uninspectable]");return}t.append("{");let x=!1;for(let b of g){if(t.stopped())break;if(o>=50){l(x,p),x=!0,I(t,"\u2026"),t.append(r?": ":":"),t.append("[MaxEntries]");break}o+=1;let k;try{k=Reflect.getOwnPropertyDescriptor(c,b)}catch{l(x,p),x=!0,_(t,b),t.append(r?": ":":"),t.append("[Uninspectable]");continue}k?.enumerable&&(l(x,p),x=!0,_(t,b),t.append(r?": ":":"),d(k,p+1))}f("}",x,p)}function h(c,p){if(s.has(c)){t.append("[Circular]");return}if(p>=5){t.append("[MaxDepth]");return}let g;try{g=Array.isArray(c)}catch{t.append("[Uninspectable]");return}s.add(c);try{g?m(c,p):O(c,p)}finally{s.delete(c)}}function S(c,p){c===null?t.append("null"):typeof c=="string"?I(t,c):typeof c=="number"?t.append(Object.is(c,-0)?"-0":String(c)):typeof c=="boolean"?t.append(c?"true":"false"):typeof c>"u"?t.append("undefined"):typeof c=="bigint"?t.append(`${c}n`):typeof c=="symbol"?J(t,c):typeof c=="function"?t.append("[Function]"):h(c,p)}try{return S(e,0),t.result()}catch{return"[Uninspectable]"}}var De=$,se="\u2018",ie="\u2019",le="\u201C",ce="\u201D",Ue="\u2013",Le="\u2014",Be="\xA0",Fe="\u2026",Ve="\u200A",$e="\u2009",_e="\u2032",Je="\u2033",Ke="\\",He="\uFFFD",Ge="`",Qe="\xD7",Xe=[".",",",";","!","?"],G=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"]),j=Object.prototype.hasOwnProperty,P=class{hasRepeatedReferences=!1;clones=[];index;sources=[];get(n){if(this.index){let r=this.index.get(n);return r!==void 0&&(this.hasRepeatedReferences=!0),r}let t=this.sources.indexOf(n);if(t!==-1)return this.hasRepeatedReferences=!0,this.clones[t]}set(n,t){if(this.index){this.index.set(n,t);return}if(this.sources.push(n),this.clones.push(t),this.sources.length===32){this.index=new WeakMap;for(let r=0;r<this.sources.length;r++)this.index.set(this.sources[r],this.clones[r]);this.sources=[],this.clones=[]}}};function Q(e,n){let t=n.get(e);if(t!==void 0)return t;let r=e.slice(0);return n.set(e,r),r}function fe(e,n){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let o=Buffer.from(e);return n.set(e,o),o}let t=Q(e.buffer,n);if(e instanceof DataView){let o=new DataView(t,e.byteOffset,e.byteLength);return n.set(e,o),o}let r=e.constructor,s=new r(t,e.byteOffset,e.length);return n.set(e,s),s}function U(e,n,t,r){for(let s of t){let o=n[s];e[s]=typeof o!="object"||o===null?o:M(o,r)}}function M(e,n){if(typeof e!="object"||e===null)return e;let t=n.get(e);if(t!==void 0)return t;if(Array.isArray(e)){let o=e.length,i=new Array(o);n.set(e,i);let l=e,f=Object.keys(e);if(f.length===o&&(o===0||f[o-1]===`${o-1}`))for(let d=0;d<o;d++){let m=l[d];i[d]=typeof m!="object"||m===null?m:M(m,n)}else U(i,l,f,n);return i}let r=Object.getPrototypeOf(e);if(r===Object.prototype||r===null){let o={};return n.set(e,o),U(o,e,Object.keys(e),n),o}if(e instanceof Date){let o=new Date(e.getTime());return n.set(e,o),o}if(ArrayBuffer.isView(e))return fe(e,n);if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return Q(e,n);if(e instanceof Map){let o=new Map;n.set(e,o);for(let[i,l]of e)o.set(M(i,n),M(l,n));return o}if(e instanceof Set){let o=new Set;n.set(e,o);for(let i of e)o.add(M(i,n));return o}let s={};return n.set(e,s),U(s,e,Object.keys(e),n),s}function qe(e){return M(e,new P)}function ze(e){let n=new P,t=M(e,n);return{hasRepeatedReferences:n.hasRepeatedReferences,value:t}}function Ze(e){if(!w(e))return!1;let n=e.charCodeAt(0);return n>=48&&n<=57}function Ye(e){return w(e)&&e.length===1&&G.has(e)}function ve(e){return w(e)&&G.has(e)}function en(e){if(!w(e)||e.length!==1)return!1;let n=e.charCodeAt(0);return n<128?n>64&&n<91||n>96&&n<123:e.toUpperCase()!==e.toLowerCase()}function nn(e){if(!e||!w(e))return!1;let n=e.charCodeAt(0);return n>64&&n<91||n>96&&n<123}function tn(e){return w(e)&&(e==='"'||e==="'"||e===se||e===ie||e===le||e===ce)}function rn(e){if(!w(e)||e.length!==1)return!1;let n=e.charCodeAt(0);return n<128?n>96&&n<123:e===e.toLowerCase()&&e!==e.toUpperCase()}function on(e){if(!w(e)||e.length!==1)return!1;let n=e.charCodeAt(0);return n<128?n>64&&n<91:e===e.toUpperCase()&&e!==e.toLowerCase()}function sn(e){if(!w(e)||!e)return!1;let n=e.charCodeAt(0);return n<128?n===32||n>8&&n<14:!e[0].trim()}var ln=e=>w(e)&&e.length&&e.endsWith("/")?e.slice(0,-1).trim():e;function X(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)}function cn(e="",n=0,t=0,r=""){return n<0&&(n+=e.length,n<0&&(n=0)),e.slice(0,n)+(r||"")+e.slice(n+t)}function w(e){return typeof e=="string"}function ae(e){return Number.isFinite(e)}function fn(e){return Number.isSafeInteger(e)&&e>=0}function an(e){return typeof e=="boolean"}function un(e){return e===null}var ue=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")?.get,q=Object.prototype.toString;function de(e){if(e instanceof RegExp)return!0;if(e===null||typeof e!="object")return!1;if(q.call(e)!=="[object RegExp]")return e===RegExp.prototype;try{return ue.call(e),!0}catch{return!1}}var pe=Date.prototype.getTime;function dn(e){if(e instanceof Date)return!0;if(e===null||typeof e!="object"||q.call(e)!=="[object Date]")return!1;try{return pe.call(e),!0}catch{return!1}}function pn(e,n){if(!e||!n)return e;let t=!0;for(let l=n.length;l--;)if(n.charCodeAt(l)>127){t=!1;break}if(t){let l=0,f=e.length;if(n.length===1){let d=n.charCodeAt(0);for(;l<f&&e.charCodeAt(l)===d;)l++;for(;f>l&&e.charCodeAt(f-1)===d;)f--}else{for(;l<f&&n.includes(e[l]);)l++;for(;f>l&&n.includes(e[f-1]);)f--}return l===0&&f===e.length?e:e.slice(l,f)}let r=Array.from(e),s=new Set(n),o=0,i=r.length;for(;o<i&&s.has(r[o]);)o++;for(;i>o&&s.has(r[i-1]);)i--;return o===0&&i===r.length?e:r.slice(o,i).join("")}function gn(e,n){if(!w(e)||!w(n)||n.length===0)return[];let t=[],r=e.indexOf(n);for(;r!==-1;)t.push(r),r=e.indexOf(n,r+1);return t}function hn(e=[],n=[]){if(!e||!Array.isArray(e)||!e.length)return[];if(!n||!Array.isArray(n)||!n.length)return e;if(e.length*n.length<400)return e.filter(r=>!n.includes(r));let t=new Set(n);return e.filter(r=>!t.has(r))}function bn(e){return e!=null}function yn(e){return[...new Set(e)]}function ge(e){if(!(typeof e!="string"||!e)){if(e.includes(`\r
|
|
10
|
+
var Z="1.10.1";import{formatDiagnosticValue as B}from"codsen-format-diagnostic-value";var ue=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_9_1_4_0_5_l_4_0_9_0_3_0_n_o_7_","a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4_c_c_0_h_11_1_0_5_","0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_11_f_g_2d_2_5_3_h7_2_g_1_","p_5_22_6_7_7_h_d_i_e_h_e_c_1_2_f_1f_z_0_4_0_1v_2g_7_4_2_x_1_0_5_1x_a_u_1d_t_2_4_b_17_4_p_1i_m_9_1g_2","a_0_2l_1a_h_7_1i_t_d_1_a_17_q_z_15_2_a_z_2_a_5_16_2_2_15_3_1_5_1_1_3_0_5_5b_1s_7p_2_5_2_11_2_5_2_7_1","_0_1_0_1_0_1_u_2_1g_1_6_1_0_3_2_1_6_3_3_2_5_4_c_5_2_1_6_38_0_d_0_g_c_2t_0_4_0_2_9_1_0_3_4_6_0_1_0_1_","0_1_3_1_a_2_3_5_4_4_0_1g_1_22j_6c_6_3_3_1_c_11_1_0_5_0_2_1j_7_0_g_m_9_6_1_6_1_6_1_6_1_6_1_6_1_6_1_6_","28_0_d1_1_16_4_5_1_4_2d_6_2_1_2h_1_3_5_16_1_2l_h_v_1c_f_e8_533_1s_h3g_1v_19_2_7g_3_f_a_1_k_1a_g_u_2_","1x_1d_8_2_2u_2_29_k_g_1_2_1_3_1_m_t_1f_e_1d_1q_5_3_0_1_1_b_r_a_m_p_s_7_1a_s_0_g_4_1_9_a_4_1_14_n_2_1","_7_k_m_3_0_3_1d_1_0_3_1_2_4_2_0_1_0_o_2_2_a_7_2_c_5_2_5_2_5_9_6_1_6_1_16_1_d_6_36_t_8mb_c_m_4_1c_6is","_a5_2_2x_12_6_c_4_5_0_1_9_1_c_1_4_1_0_1_1_1_1_1_2z_x_a2_i_1r_2_1h_14_b_38_4_1_3q_10_p_6_p_b_2g_3_5_2","_5_2_5_2_2_z_b_1_p_1_i_1_1_1_e_2_d_y_3e_at_s_3_1c_1b_v_d_j_1_7_6_11_a_t_2_z_4_7_1c_4d_i_z_4_z_4_13_8","_1f_c_a_1_e_1_6_1_1_1_a_1_e_1_6_1_1_3_1f_c_8m_9_l_a_7_o_5_1_15_1_8_1x_5_2_0_1_17_1_1_3_0_2_m_a_m_9_u","_1t_i_1_1_a_l_a_p_6_p_12_1j_6_1_1s_0_f_3_1_2_1_s_16_s_3_s_z_7_1_r_r_1h_a_l_a_i_d_h_32_20_1j_1e_d_1e_","d_z_12_r_9_m_6y_15_6_1_g_5_1k_s_a_0_8_l_16_h_1a_k_r_m_c_1g_1l_1_2_0_d_18_w_o_q_z_t_0_2_0_8_y_3_0_c_1","b_e_3_l_0_1_0_z_h_1_o_j_1_1r_6_1_0_1_3_1_e_1_9_7_1a_12_7_2_1_2_l_1_6_1_1_1_4_3_0_i_0_c_4_u_9_1_0_2_0","_1_11_1_0_p_0_1_0_18_1g_i_3_k_2_u_1b_k_1_1_0_54_1a_15_3_10_1b_k_0_1n_16_d_0_1z_q_11_6_55_17_38_1r_v_","7_2_0_2_7_1_1_1_n_f_0_1_0_2m_7_2_12_g_0_1_0_s_0_a_13_7_0_l_0_b_19_j_0_i_20_5j_w_v_8_1_10_h_0_1d_t_34","_6_1_1_1_11_l_0_p_5_1_1_1_v_e_0_n_17_78_i_f_0_1_c_1_x_3g_0_27_pl_6e_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a","1_t_1cy_fs_7_u_h_26_h_t_i_1b_g_3_v_k_5_i_c0_18_5v_1r_w_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_1_c_5p1_15_v_","2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_4me_2c_1_1y_1_1_2_0_2_1_2_3_1_b_1_0","_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_7_1f8_u_6_5","_79_1p_42_18_a_6_g_0_8x_t_i_17_dg_r_6c_t_2_0_5r_u_1_2_1_1_1_6_2_4_9_1_68_6_1_3_1_1_1_e_1_5g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),L=ue.slice(1).split("_"),W=[],Y=127;for(let e=0;e<L.length;e+=2){let t=Y+1+Number.parseInt(L[e],36),n=t+Number.parseInt(L[e+1],36);W.push([t,n]),Y=n}function X(e){if(Number.isNaN(e)||e<128||e>1114111)return!1;let t=0,n=W.length-1;for(;t<=n;){let r=t+n>>1,o=W[r];if(e<o[0])n=r-1;else if(e>o[1])t=r+1;else return!0}return!1}var nt=Z,ae="\u2018",de="\u2019",ge="\u201C",pe="\u201D",rt="\u2013",_t="\u2014",ot="\xA0",st="\u2026",it="\u200A",ct="\u2009",lt="\u2032",ft="\u2033",ut="\\",at="\uFFFD",dt="`",gt="\xD7",pt=[".",",",";","!","?"],te=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"]),T=Object.prototype.hasOwnProperty,ne=Function.prototype.toString,he=ne.call(Object),P=class{hasRepeatedReferences=!1;clones=[];index;sources=[];get(t){if(this.index){let r=this.index.get(t);return r!==void 0&&(this.hasRepeatedReferences=!0),r}let n=this.sources.indexOf(t);if(n!==-1)return this.hasRepeatedReferences=!0,this.clones[n]}set(t,n){if(this.index){this.index.set(t,n);return}if(this.sources.push(t),this.clones.push(n),this.sources.length===32){this.index=new WeakMap;for(let r=0;r<this.sources.length;r++)this.index.set(this.sources[r],this.clones[r]);this.sources=[],this.clones=[]}}};function re(e,t){let n=t.get(e);if(n!==void 0)return n;let r=e.slice(0);return t.set(e,r),r}function be(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let _=Buffer.from(e);return t.set(e,_),_}let n=re(e.buffer,t);if(e instanceof DataView||Object.prototype.toString.call(e)==="[object DataView]"){let _=new DataView(n,e.byteOffset,e.byteLength);return t.set(e,_),_}let r=e.constructor,o=new r(n,e.byteOffset,e.length);return t.set(e,o),o}function _e(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function M(e,t,n,r){for(let o of n){let _=t[o],s=typeof _!="object"||_===null?_:j(_,r);o==="__proto__"?_e(e,o,s):e[o]=s}}function R(e,t,n,r){for(let o of n){let _=Object.getOwnPropertyDescriptor(t,o);if(_){if("value"in _){let s=_.value;_.value=typeof s!="object"||s===null?s:j(s,r)}Object.defineProperty(e,o,_)}}}var ye=Map.prototype.entries,me=Set.prototype.values,z=Object.prototype.toString,xe=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength")?.get,we=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags")?.get,ke=Object.getOwnPropertyDescriptor(RegExp.prototype,"global")?.get,oe=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")?.get,Ce=RegExp.prototype.test,N;function Oe(e){if(e instanceof ArrayBuffer)return!0;try{return xe.call(e),!0}catch{return!1}}function Ae(e){try{return ye.call(e)}catch{return null}}function je(e){try{return me.call(e)}catch{return null}}function Se(e){try{return N||(N=Object.getOwnPropertyDescriptor(URL.prototype,"href")?.get),N.call(e)}catch{return null}}function j(e,t){if(typeof e!="object"||e===null)return e;let n=t.get(e);if(n!==void 0)return n;if(Array.isArray(e)){let i=e.length,l=new Array(i);t.set(e,l);let p=e,k=Object.keys(e);if(k.length===i&&(i===0||k[i-1]===`${i-1}`))for(let a=0;a<i;a++){let y=p[a];l[a]=typeof y!="object"||y===null?y:j(y,t)}else M(l,p,k,t);return l}let r=Object.getPrototypeOf(e);if(r===Object.prototype){let i={};return t.set(e,i),M(i,e,Object.keys(e),t),i}if(r===null){let i=Object.create(null);return t.set(e,i),M(i,e,Object.keys(e),t),i}if(Me(e)){let i=new Date(ie.call(e));return t.set(e,i),R(i,e,Object.keys(e),t),i}if(ArrayBuffer.isView(e))return be(e,t);if(Oe(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return re(e,t);let o=Ae(e);if(o){let i=new Map;t.set(e,i);for(let[l,p]of o)i.set(j(l,t),j(p,t));return R(i,e,Object.keys(e),t),i}let _=je(e);if(_){let i=new Set;t.set(e,i);for(let l of _)i.add(j(l,t));return R(i,e,Object.keys(e),t),i}if(se(e)&&e!==RegExp.prototype){let i=new RegExp(oe.call(e),we.call(e));return i.lastIndex=e.lastIndex,t.set(e,i),R(i,e,Object.keys(e),t),i}let s=Se(e);if(s!==null){let i=new URL(s);return t.set(e,i),R(i,e,Object.keys(e),t),i}if(e instanceof Error||z.call(e)==="[object Error]"){let i=Object.create(Object.getPrototypeOf(e));return t.set(e,i),R(i,e,Reflect.ownKeys(e),t),i}let c=Object.create(r);return t.set(e,c),M(c,e,Object.keys(e),t),c}function ht(e){return j(e,new P)}function bt(e){let t=new P,n=j(e,t);return{hasRepeatedReferences:t.hasRepeatedReferences,value:n}}function yt(e){if(!b(e))return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function mt(e){return b(e)&&e.length===1&&te.has(e)}function xt(e){return b(e)&&te.has(e)}function J(e){if(e.length===1){let t=e.charCodeAt(0);return t<55296||t>57343?t:-1}if(e.length===2){let t=e.charCodeAt(0),n=e.charCodeAt(1);if(t>=55296&&t<=56319&&n>=56320&&n<=57343)return(t-55296)*1024+n-56320+65536}return-1}function wt(e){if(!b(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91||t>96&&t<123:X(J(e))}function kt(e){if(!e||!b(e))return!1;let t=e.charCodeAt(0);return t>64&&t<91||t>96&&t<123}function Ct(e){return b(e)&&(e==='"'||e==="'"||e===ae||e===de||e===ge||e===pe)}function Ot(e){if(!b(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>96&&t<123:J(e)<0?!1:e===e.toLowerCase()&&e!==e.toUpperCase()}function At(e){if(!b(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91:J(e)<0?!1:e===e.toUpperCase()&&e!==e.toLowerCase()}function jt(e){if(!b(e)||!e)return!1;let t=e.charCodeAt(0);return t<128?t===32||t>8&&t<14:!e[0].trim()}var St=e=>b(e)&&e.length&&e.endsWith("/")?e.slice(0,-1).trim():e;function Re(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.getOwnPropertyDescriptor(t,"constructor");return!n||!("value"in n)||typeof n.value!="function"?!1:Object.getOwnPropertyDescriptor(n.value,"prototype")?.value===t&&ne.call(n.value)===he}function Rt(e="",t=0,n=0,r=""){return t<0&&(t+=e.length,t<0&&(t=0)),e.slice(0,t)+(r||"")+e.slice(t+n)}function b(e){return typeof e=="string"}function Pe(e){return Number.isFinite(e)}function Pt(e){return Number.isSafeInteger(e)&&e>=0}function Mt(e){return typeof e=="boolean"}function Tt(e){return e===null}function se(e){if(e===null||typeof e!="object")return!1;try{return e instanceof RegExp?(e.source,!0):z.call(e)!=="[object RegExp]"?!1:(oe.call(e),!0)}catch{return!1}}var ie=Date.prototype.getTime;function Me(e){if(e instanceof Date)return!0;if(e===null||typeof e!="object"||z.call(e)!=="[object Date]")return!1;try{return ie.call(e),!0}catch{return!1}}function It(e,t){if(!e||!t)return e;let n=!0;for(let c=t.length;c--;)if(t.charCodeAt(c)>127){n=!1;break}if(n){let c=0,i=e.length;if(t.length===1){let l=t.charCodeAt(0);for(;c<i&&e.charCodeAt(c)===l;)c++;for(;i>c&&e.charCodeAt(i-1)===l;)i--}else{for(;c<i&&t.includes(e[c]);)c++;for(;i>c&&t.includes(e[i-1]);)i--}return c===0&&i===e.length?e:e.slice(c,i)}let r=Array.from(e),o=new Set(t),_=0,s=r.length;for(;_<s&&o.has(r[_]);)_++;for(;s>_&&o.has(r[s-1]);)s--;return _===0&&s===r.length?e:r.slice(_,s).join("")}function Dt(e,t){if(!b(e)||!b(t)||t.length===0)return[];let n=[],r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function Et(e=[],t=[]){if(!e||!Array.isArray(e)||!e.length)return[];if(!t||!Array.isArray(t)||!t.length)return e.slice();if(e.length*t.length<400)return e.filter(r=>!t.includes(r));let n=new Set(t);return e.filter(r=>!n.has(r))}function Bt(e){return e!=null}function Lt(e){return[...new Set(e)]}function Te(e){if(!(typeof e!="string"||!e)){if(e.includes(`\r
|
|
13
11
|
`))return`\r
|
|
14
12
|
`;if(e.includes(`
|
|
15
13
|
`))return`
|
|
16
|
-
`;if(e.includes("\r"))return"\r"}}function
|
|
17
|
-
`){if(
|
|
18
|
-
`&&
|
|
19
|
-
`&&
|
|
20
|
-
`:
|
|
21
|
-
`:
|
|
22
|
-
`);for(let
|
|
23
|
-
`)}function
|
|
24
|
-
`)&&(r=
|
|
25
|
-
${r}`),
|
|
26
|
-
${
|
|
27
|
-
`,
|
|
28
|
-
${
|
|
29
|
-
`}function
|
|
14
|
+
`;if(e.includes("\r"))return"\r"}}function Wt(e,t,n=`
|
|
15
|
+
`){if(n!==`
|
|
16
|
+
`&&n!==`\r
|
|
17
|
+
`&&n!=="\r")throw new Error(`codsen-utils/resolveEolSetting(): [THROW_ID_01] the input argument defaultEolChar should be one of EOL values: "\\n", "\\r", or "\\r\\n", but it was given as ${B(n)}`);return t==="crlf"?`\r
|
|
18
|
+
`:t==="cr"?"\r":t==="lf"?`
|
|
19
|
+
`:Te(e)||n}function Nt(e,t){return e!=null&&T.call(e,t)}function Vt(e,t){return e.localeCompare(t)}var Ft=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],$t=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]);function Ut(e,t){if(!Array.isArray(e)||!e.length||!b(t))return!1;for(let n of e){if(typeof n=="string"){if(t===n)return!0;continue}if(se(n)){let r=ke.call(n);r&&(n.lastIndex=0);let o=Ce.call(n,t);if(r&&(n.lastIndex=0),o)return!0}}return!1}function zt(e=[],t=[]){if(!Array.isArray(e)||!Array.isArray(t)||!e.length||!t.length)return[];let n=[];if(e.length*t.length<64){for(let _ of e)t.includes(_)&&!n.includes(_)&&n.push(_);return n}let r=new Set(t),o=new Set;for(let _ of e)r.has(_)&&!o.has(_)&&(o.add(_),n.push(_));return n}var V=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;function Ie(e){return e.replace(/-+([^-])/g,(t,n)=>n.toUpperCase())}function De(e){return e.replace(/([\da-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ee(e){return e.replace(/^[\r\n]+/,"").replace(/[\r\n]+$/,"")}function v(e,t){let n=Number.POSITIVE_INFINITY,r=e.split(`
|
|
20
|
+
`);for(let _ of r){let s=/^[ \t]*(?=\S)/.exec(_);s&&(n=Math.min(n,s[0].length))}let o=" ".repeat(t);return r.map(_=>_.trim()?o+_.slice(n):_).join(`
|
|
21
|
+
`)}function Be(e,t,n){let r="";return e&&(r=Ee(e.replace(/\t+\n*$/,"")),r.includes(`
|
|
22
|
+
`)&&(r=v(r,n)),r=`
|
|
23
|
+
${r}`),t&&(r=r?`${v(`
|
|
24
|
+
${t}
|
|
25
|
+
`,n)}${r}`:`
|
|
26
|
+
${t}`),`${r}
|
|
27
|
+
`}function Le(e){let t=b(e.name)?e.name:"",{bin:n}=e;return b(n)?t.slice(t.startsWith("@")?t.indexOf("/")+1:0):n&&typeof n=="object"?Object.keys(n)[0]??t:t}function We(e,t){let n=e?e.type:void 0;return t===void 0?n==="string"?"":n==="number"?void 0:!0:n==="boolean"?t==="true":n==="number"?Number(t):t}function Jt(e="",t={}){let n=typeof process>"u"?void 0:process,r=t.pkg??{},o=t.argv??n?.argv.slice(2)??[],_=t.helpIndent??2,s=t.autoHelp??!0,c=t.autoVersion??!0,i=t.version??r.version??"No version found",l=T.call(t,"booleanDefault")?t.booleanDefault:!1,p=Be(e,t.description??r.description,_);function k(f){console.log(p),n?.exit(Pe(f)?f:2)}function a(){console.log(i),n?.exit(0)}let y=[],h=new Map;for(let[f,u]of Object.entries(t.flags??{})){let g={key:f,type:u.type,isMultiple:!!u.isMultiple,source:u};y.push(g),h.set(f,g),h.set(De(f),g),u.shortFlag&&h.set(u.shortFlag,g)}let O=[],d={};function S(f,u){let g=h.get(f),x=g?g.key:Ie(f);if(g?.isMultiple){let w=d[x];Array.isArray(w)?w.push(u):d[x]=[u];return}d[x]=u}function m(f,u){S(f,We(h.get(f),u))}function C(f,u){return u===void 0?!1:f?.type==="boolean"?u==="true"||u==="false":!(u.startsWith("-")&&u.length>1&&!V.test(u))}function le(f,u){let g=f.slice(1);for(let x=0;x<g.length;x++){let w=g[x],A=g.slice(x+1);if(A.startsWith("="))return m(w,A.slice(1)),u;if(V.test(A)||A&&/\W/.test(A[0]))return m(w,A),u;let E=h.get(w);if(A&&E?.type&&E.type!=="boolean")return m(w,A),u;if(A){m(w,void 0);continue}if(C(E,o[u+1]))return m(w,o[u+1]),u+1;m(w,void 0)}return u}for(let f=0;f<o.length;f++){let u=o[f];if(u==="--"){O.push(...o.slice(f+1));break}if(u.startsWith("--")){let g=u.slice(2),x=g.indexOf("=");if(x!==-1){m(g.slice(0,x),g.slice(x+1));continue}if(g.startsWith("no-")){S(g.slice(3),!1);continue}let w=h.get(g);if(C(w,o[f+1])){m(g,o[f+1]),f++;continue}m(g,void 0);continue}if(u.startsWith("-")&&u.length>1&&!V.test(u)){f=le(u,f);continue}O.push(u)}for(let f of y)T.call(d,f.key)||(T.call(f.source,"default")?d[f.key]=f.source.default:f.isMultiple?d[f.key]=[]:f.type==="boolean"&&l!==void 0&&(d[f.key]=l));!O.length&&o.length===1&&(c&&d.version===!0?a():s&&d.help===!0&&k(0));let Q=Le(r);return Q&&n&&(n.title=Q),{input:O,flags:d,pkg:r,help:p,showHelp:k,showVersion:a}}function qt(e,t=[]){if(!e)return e;if(!Re(e))throw new Error(`codsen-utils/omit(): [THROW_ID_02] Input must be a plain object! It was given as ${B(e,4)} (typeof is "${typeof e}")`);let n=Object.getPrototypeOf(e)===null?Object.create(null):{},r=new P;r.set(e,n);let o=Object.keys(e),_=o.length*t.length<400?void 0:new Set(t);for(let s of o){if(_?_.has(s):t.includes(s))continue;let c=j(e[s],r);s==="__proto__"?_e(n,s,c):n[s]=c}return n}var Ne=256,Ve=1024,Fe=1,$e=new Map,Ue=new Map;function U(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let t=String.fromCharCode(e).toUpperCase();if(t.length!==1)return e;let n=t.charCodeAt(0);return e>127&&n<128?e:n}function F(e,t,n,r,o,_){for(let s=0;s<o;s++){let c=e.charCodeAt(t+s),i=n.charCodeAt(r+s);if(_||(c>=97&&c<=122&&(c-=32),i>=97&&i<=122&&(i-=32)),c!==i)return!1}return!0}function ce(e,t,n){let r=t.indexOf("\\");if(r===-1&&e===t)return!0;let o=t.indexOf("*");if(r===-1&&o===-1){if(n)return!1;for(let p=0;p<t.length;p++)if(t.charCodeAt(p)>127)return;return e.length===t.length&&F(e,0,t,0,t.length,!1)}if(r!==-1)return;let _=0,s=!1,c=-1;for(let p=0;p<t.length;p++){let k=t.charCodeAt(p);if(k>127)return;if(k===42){if(c=p,!s){if(_++,_>1)return;s=!0}}else s=!1}let i=c+1,l=t.length-i;return e.length<o+l?!1:F(e,0,t,0,o,n)&&F(e,e.length-l,t,i,l,n)}function ze(e){let t=new Uint32Array(e.length),n=0;for(let r=1;r<e.length;r++){for(;n>0&&e[r]!==e[n];)n=t[n-1];e[r]===e[n]&&n++,t[r]=n}return t}function Je(e,t){let n=[[]],r=!0,o=!1,_=!1,s=0;for(let a=0;a<e.length;){let y=e.codePointAt(a);if(y!==92){if(y===42)o=!0,_||(n.push([]),_=!0);else{let C=t?y:U(y);n[n.length-1].push(C),r&&=C<=127,s++,_=!1}a+=y>65535?2:1;continue}let h=a+1;for(;e.charCodeAt(h)===92;)h++;let O=h-a,d=e.codePointAt(h),S,m=!1;d===42?(m=O%2===0,S=m?O/2:(O-1)/2):d===void 0||d===10||d===13||d===8232||d===8233?S=Math.ceil(O/2):S=Math.floor(O/2);for(let C=0;C<S;C++)n[n.length-1].push(92),s++;if(m){_=!1,a=h;continue}if(d!==void 0){let C=t?d:U(d);n[n.length-1].push(C),r&&=C<=127,s++,h+=d>65535?2:1}_=!1,a=h}let c=o&&n[0].length===0,i=o&&n[n.length-1].length===0,l=[];for(let a of n)a.length&&l.push({values:a});let p=c?0:1,k=l.length-(i?0:1);for(let a=p;a<k;a++)l[a].values.length>Fe&&(l[a].failure=ze(l[a].values));return{asciiOnly:r,endsWithWildcard:i,hasWildcard:o,minimumInputLength:s,segments:l,startsWithWildcard:c}}function q(e,t){let n=t?$e:Ue,r=e.length<=Ve;if(r){let _=n.get(e);if(_)return _}let o=Je(e,t);if(r){if(n.size>=Ne){let _=n.keys().next().value;_!==void 0&&n.delete(_)}n.set(e,o)}return o}function H(e,t){if(t){let o=[];for(let _=0;_<e.length;){let s=e.codePointAt(_);o.push(s),_+=s>65535?2:1}return o}let n=new Uint32Array(e.length),r=0;for(let o=0;o<e.length;){let _=e.codePointAt(o);n[r]=U(_),r++,o+=_>65535?2:1}return r===n.length?n:n.subarray(0,r)}function I(e,t,n,r){for(let o=0;o<n.values.length;o++){let _=e.charCodeAt(t+o);if(!r&&_>=97&&_<=122&&(_-=32),_!==n.values[o])return!1}return!0}function qe(e,t,n,r,o){let _=r-t.values.length;if(_<n)return-1;if(!t.failure){for(let c=n;c<=_;c++)if(I(e,c,t,o))return c;return-1}let s=0;for(let c=n;c<r;c++){let i=e.charCodeAt(c);for(!o&&i>=97&&i<=122&&(i-=32);s>0&&i!==t.values[s];)s=t.failure[s-1];if(i===t.values[s]&&(s++,s===t.values.length))return c-s+1}return-1}function K(e,t,n){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&I(e,0,t.segments[0],n);let r=0,o=t.segments.length,_=0,s=e.length;if(!t.startsWithWildcard){let c=t.segments[0];if(!I(e,0,c,n))return!1;_=c.values.length,r++}if(!t.endsWithWildcard){o--;let c=t.segments[o];if(s-=c.values.length,!I(e,s,c,n))return!1}for(let c=r;c<o;c++){let i=t.segments[c],l=qe(e,i,_,s,n);if(l===-1)return!1;_=l+i.values.length}return!0}function D(e,t,n){for(let r=0;r<n.values.length;r++)if(e[t+r]!==n.values[r])return!1;return!0}function He(e,t,n,r){let o=r-t.values.length;if(o<n)return-1;if(!t.failure){for(let s=n;s<=o;s++)if(D(e,s,t))return s;return-1}let _=0;for(let s=n;s<r;s++){for(;_>0&&e[s]!==t.values[_];)_=t.failure[_-1];if(e[s]===t.values[_]&&(_++,_===t.values.length))return s-_+1}return-1}function G(e,t){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&D(e,0,t.segments[0]);let n=0,r=t.segments.length,o=0,_=e.length;if(!t.startsWithWildcard){let s=t.segments[0];if(!D(e,0,s))return!1;o=s.values.length,n++}if(!t.endsWithWildcard){r--;let s=t.segments[r];if(_-=s.values.length,!D(e,_,s))return!1}for(let s=n;s<r;s++){let c=t.segments[s],i=He(e,c,o,_);if(i===-1)return!1;o=i+c.values.length}return!0}function Ke(e,t,n){let r=ce(e,t,n);if(r!==void 0)return r;let o=q(t,n);return o.asciiOnly?K(e,o,n):G(H(e,n),o)}function ee(e,t,n,r){let o=ce(e,t,n);if(o!==void 0)return o;let _=q(t,n);return _.asciiOnly?K(e,_,n):(r.tokens??=H(e,n),G(r.tokens,_))}function Ge(e,t){let n=e.charCodeAt(0)===33,r=n?e.slice(1):e;return{compiled:r.length===0?void 0:q(r,t),negative:n}}function $(e,t,n,r){let o;return t.compiled?t.compiled.asciiOnly?o=K(e,t.compiled,n):(r.tokens??=H(e,n),o=G(r.tokens,t.compiled)):o=e.length===0,t.negative?!o:o}function Ht(e,t){let n=t?.caseSensitiveMatch===!0,r=typeof e=="string"?[e]:Array.from(new Set(e));if(r.length===0)return()=>!1;let o=r.map(_=>Ge(_,n));if(typeof e=="string"){let _=o[0];return s=>$(s,_,n,{})}return _=>{let s={},c=!1,i=!1;for(let l of o)if(l.negative){if(!$(_,l,n,s))return!1}else c=!0,!i&&$(_,l,n,s)&&(i=!0);return c?i:!0}}function Kt(e,t,n){if(typeof t!="string"&&!t.length)return!1;let r=n===void 0?!1:n.caseSensitiveMatch===!0;if(typeof t=="string"){let c=t.charCodeAt(0)===33,i=c?t.slice(1):t,l=Ke(e,i,r);return c?!l:l}let o={},_=!1,s=!1;for(let c of t){let i=c.charCodeAt(0)===33,l=i?c.slice(1):c;if(i){if(ee(e,l,r,o))return!1}else _=!0,!s&&ee(e,l,r,o)&&(s=!0)}return _?s:!0}export{ut as backslash,dt as backtick,Jt as codsenCLI,Vt as compareFn,Ht as createMatcher,ht as deepClone,bt as deepCloneWithMetadata,Te as detectEol,ft as doublePrime,st as ellipsis,Bt as existy,Dt as findAllIdx,B as formatDiagnosticValue,it as hairspace,Nt as hasOwnProp,Ut as includes,$t as inlineTags,zt as intersection,Mt as isBool,mt as isCurrencyChar,xt as isCurrencySymbol,Me as isDate,Pt as isInt,kt as isLatinLetter,wt as isLetter,Ot as isLowercaseLetter,Tt as isNull,Pe as isNum,yt as isNumberChar,Re as isPlainObject,Ct as isQuote,se as isRegExp,b as isStr,At as isUppercaseLetter,jt as isWhitespaceChar,ge as leftDoubleQuote,ae as leftSingleQuote,Kt as match,gt as multiplicationSign,qt as omit,Et as pullAll,pt as punctuationChars,_t as rawMDash,rt as rawNDash,ot as rawNbsp,at as rawReplacementMark,St as removeTrailingSlash,Wt as resolveEolSetting,pe as rightDoubleQuote,de as rightSingleQuote,lt as singlePrime,Rt as stringSplice,ct as thinSpace,It as trimChars,Lt as uniq,nt as version,Ft as voidTags};
|
package/dist/codsen-utils.umd.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name codsen-utils
|
|
3
3
|
* @fileoverview Various utility functions
|
|
4
|
-
* @version 1.
|
|
4
|
+
* @version 1.10.1
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/codsen-utils/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var codsenUtils=(()=>{var W=Object.defineProperty;var we=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var Ae=Object.prototype.hasOwnProperty;var Se=(e,n,t)=>n in e?W(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var Oe=(e,n)=>{for(var t in n)W(e,t,{get:n[t],enumerable:!0})},Te=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of Ce(n))!Ae.call(e,s)&&s!==t&&W(e,s,{get:()=>n[s],enumerable:!(r=we(n,s))||r.enumerable});return e};var Me=e=>Te(W({},"__esModule",{value:!0}),e);var I=(e,n,t)=>Se(e,typeof n!="symbol"?n+"":n,t);var Kn={};Oe(Kn,{backslash:()=>$e,backtick:()=>Je,codsenCLI:()=>jn,compareFn:()=>kn,deepClone:()=>Qe,deepCloneWithMetadata:()=>Xe,detectEol:()=>he,doublePrime:()=>Ve,ellipsis:()=>Ue,existy:()=>bn,findAllIdx:()=>gn,formatDiagnosticValue:()=>N,hairspace:()=>Le,hasOwnProp:()=>xn,includes:()=>An,inlineTags:()=>Cn,intersection:()=>Sn,isBool:()=>cn,isCurrencyChar:()=>ze,isCurrencySymbol:()=>Ze,isDate:()=>dn,isInt:()=>ln,isLatinLetter:()=>ve,isLetter:()=>Ye,isLowercaseLetter:()=>nn,isNull:()=>fn,isNum:()=>de,isNumberChar:()=>qe,isPlainObject:()=>J,isQuote:()=>en,isRegExp:()=>ge,isStr:()=>w,isUppercaseLetter:()=>tn,isWhitespaceChar:()=>rn,leftDoubleQuote:()=>ce,leftSingleQuote:()=>ie,match:()=>Jn,multiplicationSign:()=>Ke,omit:()=>Wn,pullAll:()=>hn,punctuationChars:()=>He,rawMDash:()=>Ne,rawNDash:()=>Ee,rawNbsp:()=>De,rawReplacementMark:()=>_e,removeTrailingSlash:()=>on,resolveEolSetting:()=>mn,rightDoubleQuote:()=>fe,rightSingleQuote:()=>le,singlePrime:()=>Fe,stringSplice:()=>sn,thinSpace:()=>Be,trimChars:()=>pn,uniq:()=>yn,version:()=>We,voidTags:()=>wn});var ee="1.9.0";function Pe(){let e=[],n=0,t=!1;return{append(r){return t?!1:n+r.length>1999?(e.push("\u2026"),n+=1,t=!0,!1):(e.push(r),n+=r.length,!0)},result(){return e.join("")},stopped(){return t}}}function Ie(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function E(e,n){if(e.append('"')){for(let t=0;t<n.length&&!e.stopped();t+=1){let r=n.charCodeAt(t);r===34?e.append('\\"'):r===92?e.append("\\\\"):r===8?e.append("\\b"):r===9?e.append("\\t"):r===10?e.append("\\n"):r===12?e.append("\\f"):r===13?e.append("\\r"):r<32||r===8232||r===8233||r>=55296&&r<=57343?e.append(Ie(r)):e.append(n[t])}e.append('"')}}function je(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function te(e,n){e.append("Symbol(");let t=String(n);t.length>8&&E(e,t.slice(7,-1)),e.append(")")}function ne(e,n){typeof n=="symbol"?te(e,n):E(e,String(n))}function N(e,n=0){let t=Pe(),r=n===4?4:0,s=new WeakSet,o=0;function i(c){r&&t.append(" ".repeat(c*r))}function l(c,g){c&&t.append(","),r&&(t.append("\n"),i(g+1))}function f(c,g,d){r&&g&&(t.append("\n"),i(d)),t.append(c)}function p(c,g){Object.prototype.hasOwnProperty.call(c,"value")?S(c.value,g):t.append(je(c))}function x(c,g){let d;try{d=Reflect.getOwnPropertyDescriptor(c,"length")}catch(y){t.append("[Uninspectable]");return}let k=d==null?void 0:d.value;if(!Number.isSafeInteger(k)||k<0){t.append("[Uninspectable]");return}t.append("[");let b=!1;for(let y=0;y<k&&!t.stopped();y+=1){if(l(b,g),b=!0,o>=50){t.append("[MaxEntries]");break}o+=1;let M;try{M=Reflect.getOwnPropertyDescriptor(c,String(y))}catch(B){t.append("[Uninspectable]");continue}M!=null&&M.enumerable?p(M,g+1):t.append("[Empty]")}f("]",b,g)}function O(c,g){let d;try{d=Reflect.ownKeys(c)}catch(b){t.append("[Uninspectable]");return}t.append("{");let k=!1;for(let b of d){if(t.stopped())break;if(o>=50){l(k,g),k=!0,E(t,"\u2026"),t.append(r?": ":":"),t.append("[MaxEntries]");break}o+=1;let y;try{y=Reflect.getOwnPropertyDescriptor(c,b)}catch(M){l(k,g),k=!0,ne(t,b),t.append(r?": ":":"),t.append("[Uninspectable]");continue}y!=null&&y.enumerable&&(l(k,g),k=!0,ne(t,b),t.append(r?": ":":"),p(y,g+1))}f("}",k,g)}function m(c,g){if(s.has(c)){t.append("[Circular]");return}if(g>=5){t.append("[MaxDepth]");return}let d;try{d=Array.isArray(c)}catch(k){t.append("[Uninspectable]");return}s.add(c);try{d?x(c,g):O(c,g)}finally{s.delete(c)}}function S(c,g){c===null?t.append("null"):typeof c=="string"?E(t,c):typeof c=="number"?t.append(Object.is(c,-0)?"-0":String(c)):typeof c=="boolean"?t.append(c?"true":"false"):typeof c>"u"?t.append("undefined"):typeof c=="bigint"?t.append("".concat(c,"n")):typeof c=="symbol"?te(t,c):typeof c=="function"?t.append("[Function]"):m(c,g)}try{return S(e,0),t.result()}catch(c){return"[Uninspectable]"}}var We=ee,ie="\u2018",le="\u2019",ce="\u201C",fe="\u201D",Ee="\u2013",Ne="\u2014",De="\xA0",Ue="\u2026",Le="\u200A",Be="\u2009",Fe="\u2032",Ve="\u2033",$e="\\",_e="\uFFFD",Je="`",Ke="\xD7",He=[".",",",";","!","?"],ae=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"]),D=Object.prototype.hasOwnProperty,j=class{constructor(){I(this,"hasRepeatedReferences",!1);I(this,"clones",[]);I(this,"index");I(this,"sources",[])}get(n){if(this.index){let r=this.index.get(n);return r!==void 0&&(this.hasRepeatedReferences=!0),r}let t=this.sources.indexOf(n);if(t!==-1)return this.hasRepeatedReferences=!0,this.clones[t]}set(n,t){if(this.index){this.index.set(n,t);return}if(this.sources.push(n),this.clones.push(t),this.sources.length===32){this.index=new WeakMap;for(let r=0;r<this.sources.length;r++)this.index.set(this.sources[r],this.clones[r]);this.sources=[],this.clones=[]}}};function ue(e,n){let t=n.get(e);if(t!==void 0)return t;let r=e.slice(0);return n.set(e,r),r}function Ge(e,n){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let o=Buffer.from(e);return n.set(e,o),o}let t=ue(e.buffer,n);if(e instanceof DataView){let o=new DataView(t,e.byteOffset,e.byteLength);return n.set(e,o),o}let r=e.constructor,s=new r(t,e.byteOffset,e.length);return n.set(e,s),s}function F(e,n,t,r){for(let s of t){let o=n[s];e[s]=typeof o!="object"||o===null?o:R(o,r)}}function R(e,n){if(typeof e!="object"||e===null)return e;let t=n.get(e);if(t!==void 0)return t;if(Array.isArray(e)){let o=e.length,i=new Array(o);n.set(e,i);let l=e,f=Object.keys(e);if(f.length===o&&(o===0||f[o-1]==="".concat(o-1)))for(let p=0;p<o;p++){let x=l[p];i[p]=typeof x!="object"||x===null?x:R(x,n)}else F(i,l,f,n);return i}let r=Object.getPrototypeOf(e);if(r===Object.prototype||r===null){let o={};return n.set(e,o),F(o,e,Object.keys(e),n),o}if(e instanceof Date){let o=new Date(e.getTime());return n.set(e,o),o}if(ArrayBuffer.isView(e))return Ge(e,n);if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return ue(e,n);if(e instanceof Map){let o=new Map;n.set(e,o);for(let[i,l]of e)o.set(R(i,n),R(l,n));return o}if(e instanceof Set){let o=new Set;n.set(e,o);for(let i of e)o.add(R(i,n));return o}let s={};return n.set(e,s),F(s,e,Object.keys(e),n),s}function Qe(e){return R(e,new j)}function Xe(e){let n=new j,t=R(e,n);return{hasRepeatedReferences:n.hasRepeatedReferences,value:t}}function qe(e){if(!w(e))return!1;let n=e.charCodeAt(0);return n>=48&&n<=57}function ze(e){return w(e)&&e.length===1&&ae.has(e)}function Ze(e){return w(e)&&ae.has(e)}function Ye(e){if(!w(e)||e.length!==1)return!1;let n=e.charCodeAt(0);return n<128?n>64&&n<91||n>96&&n<123:e.toUpperCase()!==e.toLowerCase()}function ve(e){if(!e||!w(e))return!1;let n=e.charCodeAt(0);return n>64&&n<91||n>96&&n<123}function en(e){return w(e)&&(e==='"'||e==="'"||e===ie||e===le||e===ce||e===fe)}function nn(e){if(!w(e)||e.length!==1)return!1;let n=e.charCodeAt(0);return n<128?n>96&&n<123:e===e.toLowerCase()&&e!==e.toUpperCase()}function tn(e){if(!w(e)||e.length!==1)return!1;let n=e.charCodeAt(0);return n<128?n>64&&n<91:e===e.toUpperCase()&&e!==e.toLowerCase()}function rn(e){if(!w(e)||!e)return!1;let n=e.charCodeAt(0);return n<128?n===32||n>8&&n<14:!e[0].trim()}var on=e=>w(e)&&e.length&&e.endsWith("/")?e.slice(0,-1).trim():e;function J(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)}function sn(e="",n=0,t=0,r=""){return n<0&&(n+=e.length,n<0&&(n=0)),e.slice(0,n)+(r||"")+e.slice(n+t)}function w(e){return typeof e=="string"}function de(e){return Number.isFinite(e)}function ln(e){return Number.isSafeInteger(e)&&e>=0}function cn(e){return typeof e=="boolean"}function fn(e){return e===null}var se,an=(se=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:se.get,pe=Object.prototype.toString;function ge(e){if(e instanceof RegExp)return!0;if(e===null||typeof e!="object")return!1;if(pe.call(e)!=="[object RegExp]")return e===RegExp.prototype;try{return an.call(e),!0}catch(n){return!1}}var un=Date.prototype.getTime;function dn(e){if(e instanceof Date)return!0;if(e===null||typeof e!="object"||pe.call(e)!=="[object Date]")return!1;try{return un.call(e),!0}catch(n){return!1}}function pn(e,n){if(!e||!n)return e;let t=!0;for(let l=n.length;l--;)if(n.charCodeAt(l)>127){t=!1;break}if(t){let l=0,f=e.length;if(n.length===1){let p=n.charCodeAt(0);for(;l<f&&e.charCodeAt(l)===p;)l++;for(;f>l&&e.charCodeAt(f-1)===p;)f--}else{for(;l<f&&n.includes(e[l]);)l++;for(;f>l&&n.includes(e[f-1]);)f--}return l===0&&f===e.length?e:e.slice(l,f)}let r=Array.from(e),s=new Set(n),o=0,i=r.length;for(;o<i&&s.has(r[o]);)o++;for(;i>o&&s.has(r[i-1]);)i--;return o===0&&i===r.length?e:r.slice(o,i).join("")}function gn(e,n){if(!w(e)||!w(n)||n.length===0)return[];let t=[],r=e.indexOf(n);for(;r!==-1;)t.push(r),r=e.indexOf(n,r+1);return t}function hn(e=[],n=[]){if(!e||!Array.isArray(e)||!e.length)return[];if(!n||!Array.isArray(n)||!n.length)return e;if(e.length*n.length<400)return e.filter(r=>!n.includes(r));let t=new Set(n);return e.filter(r=>!t.has(r))}function bn(e){return e!=null}function yn(e){return[...new Set(e)]}function he(e){if(!(typeof e!="string"||!e)){if(e.includes("\r\n"))return"\r\n";if(e.includes("\n"))return"\n";if(e.includes("\r"))return"\r"}}function mn(e,n,t="\n"){if(t!=="\n"&&t!=="\r\n"&&t!=="\r")throw new Error('codsen-utils/resolveEolSetting(): [THROW_ID_01] the input argument defaultEolChar should be one of EOL values: "\\n", "\\r", or "\\r\\n", but it was given as '.concat(N(t)));return n==="crlf"?"\r\n":n==="cr"?"\r":n==="lf"?"\n":he(e)||t}function xn(e,n){return J(e)&&w(n)&&D.call(e,n)}function kn(e,n){return e.localeCompare(n)}var wn=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Cn=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]);function An(e,n){if(!Array.isArray(e)||!e.length||!w(n))return!1;for(let t of e){if(typeof t=="string"){if(n===t)return!0;continue}if(ge(t)){t.global&&(t.lastIndex=0);let r=t.test(n);if(t.global&&(t.lastIndex=0),r)return!0}}return!1}function Sn(e=[],n=[]){if(!Array.isArray(e)||!Array.isArray(n)||!e.length||!n.length)return[];let t=[];if(e.length*n.length<64){for(let o of e)n.includes(o)&&!t.includes(o)&&t.push(o);return t}let r=new Set(n),s=new Set;for(let o of e)r.has(o)&&!s.has(o)&&(s.add(o),t.push(o));return t}var V=/^-?\d+(?:\.\d*)?(?:e[+-]?\d+)?$/i;function On(e){return e.replace(/-+([^-])/g,(n,t)=>t.toUpperCase())}function Tn(e){return e.replace(/([\da-z])([A-Z])/g,"$1-$2").toLowerCase()}function Mn(e){return e.replace(/^[\r\n]+/,"").replace(/[\r\n]+$/,"")}function re(e,n){let t=Number.POSITIVE_INFINITY,r=e.split("\n");for(let o of r){let i=/^[ \t]*(?=\S)/.exec(o);i&&(t=Math.min(t,i[0].length))}let s=" ".repeat(n);return r.map(o=>o.trim()?s+o.slice(t):o).join("\n")}function Rn(e,n,t){let r="";return e&&(r=Mn(e.replace(/\t+\n*$/,"")),r.includes("\n")&&(r=re(r,t)),r="\n".concat(r)),n&&(r=r?"".concat(re("\n".concat(n,"\n"),t)).concat(r):"\n".concat(n)),"".concat(r,"\n")}function Pn(e){var r;let n=w(e.name)?e.name:"",{bin:t}=e;return w(t)?n.slice(n.startsWith("@")?n.indexOf("/")+1:0):t&&typeof t=="object"&&(r=Object.keys(t)[0])!=null?r:n}function In(e,n){let t=e?e.type:void 0;return n===void 0?t==="string"?"":t==="number"?void 0:!0:t==="boolean"?n==="true":t==="number"?Number(n):n}function jn(e="",n={}){var K,H,G,Q,X,q,z,Z,Y,v;let t=typeof process>"u"?void 0:process,r=(K=n.pkg)!=null?K:{},s=(G=(H=n.argv)!=null?H:t==null?void 0:t.argv.slice(2))!=null?G:[],o=(Q=n.helpIndent)!=null?Q:2,i=(X=n.autoHelp)!=null?X:!0,l=(q=n.autoVersion)!=null?q:!0,f=(Z=(z=n.version)!=null?z:r.version)!=null?Z:"No version found",p=D.call(n,"booleanDefault")?n.booleanDefault:!1,x=Rn(e,(Y=n.description)!=null?Y:r.description,o);function O(a){console.log(x),t==null||t.exit(de(a)?a:2)}function m(){console.log(f),t==null||t.exit(0)}let S=[],c=new Map;for(let[a,u]of Object.entries((v=n.flags)!=null?v:{})){let h={key:a,type:u.type,isMultiple:!!u.isMultiple,source:u};S.push(h),c.set(a,h),c.set(Tn(a),h),u.shortFlag&&c.set(u.shortFlag,h)}let g=[],d={};function k(a,u){let h=c.get(a),C=h?h.key:On(a);if(h!=null&&h.isMultiple){let A=d[C];Array.isArray(A)?A.push(u):d[C]=[u];return}d[C]=u}function b(a,u){k(a,In(c.get(a),u))}function y(a,u){return u===void 0?!1:(a==null?void 0:a.type)==="boolean"?u==="true"||u==="false":!(u.startsWith("-")&&u.length>1&&!V.test(u))}function M(a,u){let h=a.slice(1);for(let C=0;C<h.length;C++){let A=h[C],T=h.slice(C+1);if(T.startsWith("="))return b(A,T.slice(1)),u;if(V.test(T)||T&&/\W/.test(T[0]))return b(A,T),u;let P=c.get(A);if(T&&(P!=null&&P.type)&&P.type!=="boolean")return b(A,T),u;if(T){b(A,void 0);continue}if(y(P,s[u+1]))return b(A,s[u+1]),u+1;b(A,void 0)}return u}for(let a=0;a<s.length;a++){let u=s[a];if(u==="--"){g.push(...s.slice(a+1));break}if(u.startsWith("--")){let h=u.slice(2),C=h.indexOf("=");if(C!==-1){b(h.slice(0,C),h.slice(C+1));continue}if(h.startsWith("no-")){k(h.slice(3),!1);continue}let A=c.get(h);if(y(A,s[a+1])){b(h,s[a+1]),a++;continue}b(h,void 0);continue}if(u.startsWith("-")&&u.length>1&&!V.test(u)){a=M(u,a);continue}g.push(u)}for(let a of S)D.call(d,a.key)||(D.call(a.source,"default")?d[a.key]=a.source.default:a.isMultiple?d[a.key]=[]:a.type==="boolean"&&p!==void 0&&(d[a.key]=p));!g.length&&s.length===1&&(l&&d.version===!0?m():i&&d.help===!0&&O(0));let B=Pn(r);return B&&t&&(t.title=B),{input:g,flags:d,pkg:r,help:x,showHelp:O,showVersion:m}}function Wn(e,n=[]){if(!e)return e;if(!J(e))throw new Error("codsen-utils/omit(): [THROW_ID_02] Input must be a plain object! It was given as ".concat(N(e,4),' (typeof is "').concat(typeof e,'")'));let t={},r=new j;r.set(e,t);let s=Object.keys(e),o=s.length*n.length<400?void 0:new Set(n);for(let i of s)(o?o.has(i):n.includes(i))||(t[i]=R(e[i],r));return t}var En=256,Nn=1024,Dn=1,Un=new Map,Ln=new Map;function _(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 t=n.charCodeAt(0);return e>127&&t<128?e:t}function $(e,n,t,r,s,o){for(let i=0;i<s;i++){let l=e.charCodeAt(n+i),f=t.charCodeAt(r+i);if(o||(l>=97&&l<=122&&(l-=32),f>=97&&f<=122&&(f-=32)),l!==f)return!1}return!0}function be(e,n,t){let r=n.indexOf("\\");if(r===-1&&e===n)return!0;let s=n.indexOf("*");if(r===-1&&s===-1){if(t)return!1;for(let x=0;x<n.length;x++)if(n.charCodeAt(x)>127)return;return e.length===n.length&&$(e,0,n,0,n.length,!1)}if(r!==-1)return;let o=0,i=!1,l=-1;for(let x=0;x<n.length;x++){let O=n.charCodeAt(x);if(O>127)return;if(O===42){if(l=x,!i){if(o++,o>1)return;i=!0}}else i=!1}let f=l+1,p=n.length-f;return e.length<s+p?!1:$(e,0,n,0,s,t)&&$(e,e.length-p,n,f,p,t)}function Bn(e){let n=new Uint32Array(e.length),t=0;for(let r=1;r<e.length;r++){for(;t>0&&e[r]!==e[t];)t=n[t-1];e[r]===e[t]&&t++,n[r]=t}return n}function Fn(e,n){let t=[[]],r=!0,s=!1,o=!1,i=0;for(let m=0;m<e.length;){let S=e.codePointAt(m);if(S!==92){if(S===42)s=!0,o||(t.push([]),o=!0);else{let y=n?S:_(S);t[t.length-1].push(y),r&&(r=y<=127),i++,o=!1}m+=S>65535?2:1;continue}let c=m+1;for(;e.charCodeAt(c)===92;)c++;let g=c-m,d=e.codePointAt(c),k,b=!1;d===42?(b=g%2===0,k=b?g/2:(g-1)/2):d===void 0||d===10||d===13||d===8232||d===8233?k=Math.ceil(g/2):k=Math.floor(g/2);for(let y=0;y<k;y++)t[t.length-1].push(92),i++;if(b){o=!1,m=c;continue}if(d!==void 0){let y=n?d:_(d);t[t.length-1].push(y),r&&(r=y<=127),i++,c+=d>65535?2:1}o=!1,m=c}let l=s&&t[0].length===0,f=s&&t[t.length-1].length===0,p=[];for(let m of t)m.length&&p.push({values:m});let x=l?0:1,O=p.length-(f?0:1);for(let m=x;m<O;m++)p[m].values.length>Dn&&(p[m].failure=Bn(p[m].values));return{asciiOnly:r,endsWithWildcard:f,hasWildcard:s,minimumInputLength:i,segments:p,startsWithWildcard:l}}function ye(e,n){let t=n?Un:Ln,r=e.length<=Nn;if(r){let o=t.get(e);if(o)return o}let s=Fn(e,n);if(r){if(t.size>=En){let o=t.keys().next().value;o!==void 0&&t.delete(o)}t.set(e,s)}return s}function me(e,n){if(n){let s=[];for(let o=0;o<e.length;){let i=e.codePointAt(o);s.push(i),o+=i>65535?2:1}return s}let t=new Uint32Array(e.length),r=0;for(let s=0;s<e.length;){let o=e.codePointAt(s);t[r]=_(o),r++,s+=o>65535?2:1}return r===t.length?t:t.subarray(0,r)}function U(e,n,t,r){for(let s=0;s<t.values.length;s++){let o=e.charCodeAt(n+s);if(!r&&o>=97&&o<=122&&(o-=32),o!==t.values[s])return!1}return!0}function Vn(e,n,t,r,s){let o=r-n.values.length;if(o<t)return-1;if(!n.failure){for(let l=t;l<=o;l++)if(U(e,l,n,s))return l;return-1}let i=0;for(let l=t;l<r;l++){let f=e.charCodeAt(l);for(!s&&f>=97&&f<=122&&(f-=32);i>0&&f!==n.values[i];)i=n.failure[i-1];if(f===n.values[i]&&(i++,i===n.values.length))return l-i+1}return-1}function xe(e,n,t){if(e.length<n.minimumInputLength)return!1;if(!n.hasWildcard)return e.length===n.minimumInputLength&&U(e,0,n.segments[0],t);let r=0,s=n.segments.length,o=0,i=e.length;if(!n.startsWithWildcard){let l=n.segments[0];if(!U(e,0,l,t))return!1;o=l.values.length,r++}if(!n.endsWithWildcard){s--;let l=n.segments[s];if(i-=l.values.length,!U(e,i,l,t))return!1}for(let l=r;l<s;l++){let f=n.segments[l],p=Vn(e,f,o,i,t);if(p===-1)return!1;o=p+f.values.length}return!0}function L(e,n,t){for(let r=0;r<t.values.length;r++)if(e[n+r]!==t.values[r])return!1;return!0}function $n(e,n,t,r){let s=r-n.values.length;if(s<t)return-1;if(!n.failure){for(let i=t;i<=s;i++)if(L(e,i,n))return i;return-1}let o=0;for(let i=t;i<r;i++){for(;o>0&&e[i]!==n.values[o];)o=n.failure[o-1];if(e[i]===n.values[o]&&(o++,o===n.values.length))return i-o+1}return-1}function ke(e,n){if(e.length<n.minimumInputLength)return!1;if(!n.hasWildcard)return e.length===n.minimumInputLength&&L(e,0,n.segments[0]);let t=0,r=n.segments.length,s=0,o=e.length;if(!n.startsWithWildcard){let i=n.segments[0];if(!L(e,0,i))return!1;s=i.values.length,t++}if(!n.endsWithWildcard){r--;let i=n.segments[r];if(o-=i.values.length,!L(e,o,i))return!1}for(let i=t;i<r;i++){let l=n.segments[i],f=$n(e,l,s,o);if(f===-1)return!1;s=f+l.values.length}return!0}function _n(e,n,t){let r=be(e,n,t);if(r!==void 0)return r;let s=ye(n,t);return s.asciiOnly?xe(e,s,t):ke(me(e,t),s)}function oe(e,n,t,r){var i;let s=be(e,n,t);if(s!==void 0)return s;let o=ye(n,t);return o.asciiOnly?xe(e,o,t):((i=r.tokens)!=null||(r.tokens=me(e,t)),ke(r.tokens,o))}function Jn(e,n,t){if(typeof n!="string"&&!n.length)return!1;let r=t===void 0?!1:t.caseSensitiveMatch===!0;if(typeof n=="string"){let l=n.charCodeAt(0)===33,f=l?n.slice(1):n,p=_n(e,f,r);return l?!p:p}let s={},o=!1,i=!1;for(let l of n){let f=l.charCodeAt(0)===33,p=f?l.slice(1):l;if(f){if(oe(e,p,r,s))return!1}else o=!0,!i&&oe(e,p,r,s)&&(i=!0)}return o?i:!0}return Me(Kn);})();
|
|
10
|
+
"use strict";var codsenUtils=(()=>{var D=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Ve=Object.prototype.hasOwnProperty;var Fe=(e,t,n)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ue=(e,t)=>{for(var n in t)D(e,n,{get:t[n],enumerable:!0})},$e=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ne(t))!Ve.call(e,o)&&o!==n&&D(e,o,{get:()=>t[o],enumerable:!(r=Le(t,o))||r.enumerable});return e};var ze=e=>$e(D({},"__esModule",{value:!0}),e);var T=(e,t,n)=>Fe(e,typeof t!="symbol"?t+"":t,n);var bn={};Ue(bn,{backslash:()=>_t,backtick:()=>st,codsenCLI:()=>tn,compareFn:()=>Jt,createMatcher:()=>gn,deepClone:()=>wt,deepCloneWithMetadata:()=>kt,detectEol:()=>We,doublePrime:()=>rt,ellipsis:()=>ve,existy:()=>Ft,findAllIdx:()=>Nt,formatDiagnosticValue:()=>I,hairspace:()=>et,hasOwnProp:()=>zt,includes:()=>Ht,inlineTags:()=>Gt,intersection:()=>Kt,isBool:()=>Wt,isCurrencyChar:()=>Ot,isCurrencySymbol:()=>At,isDate:()=>De,isInt:()=>Dt,isLatinLetter:()=>St,isLetter:()=>jt,isLowercaseLetter:()=>Pt,isNull:()=>Bt,isNum:()=>Ie,isNumberChar:()=>Ct,isPlainObject:()=>Te,isQuote:()=>Rt,isRegExp:()=>Z,isStr:()=>k,isUppercaseLetter:()=>Mt,isWhitespaceChar:()=>Tt,leftDoubleQuote:()=>Oe,leftSingleQuote:()=>ke,match:()=>hn,multiplicationSign:()=>it,omit:()=>nn,pullAll:()=>Vt,punctuationChars:()=>ct,rawMDash:()=>Ye,rawNDash:()=>Ze,rawNbsp:()=>Xe,rawReplacementMark:()=>ot,removeTrailingSlash:()=>It,resolveEolSetting:()=>$t,rightDoubleQuote:()=>Ae,rightSingleQuote:()=>Ce,singlePrime:()=>nt,stringSplice:()=>Et,thinSpace:()=>tt,trimChars:()=>Lt,uniq:()=>Ut,version:()=>Qe,voidTags:()=>qt});var fe="1.10.1";function qe(){let e=[],t=0,n=!1;return{append(r){return n?!1:t+r.length>1999?(e.push("\u2026"),t+=1,n=!0,!1):(e.push(r),t+=r.length,!0)},result(){return e.join("")},stopped(){return n}}}function Ge(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function W(e,t){if(e.append('"')){for(let n=0;n<t.length&&!e.stopped();n+=1){let r=t.charCodeAt(n);r===34?e.append('\\"'):r===92?e.append("\\\\"):r===8?e.append("\\b"):r===9?e.append("\\t"):r===10?e.append("\\n"):r===12?e.append("\\f"):r===13?e.append("\\r"):r<32||r===8232||r===8233||r>=55296&&r<=57343?e.append(Ge(r)):e.append(t[n])}e.append('"')}}function He(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function de(e,t){e.append("Symbol(");let n=String(t);n.length>8&&W(e,n.slice(7,-1)),e.append(")")}function ue(e,t){typeof t=="symbol"?de(e,t):W(e,String(t))}function I(e,t=0){let n=qe(),r=t===4?4:0,o=new WeakSet,_=0;function s(l){r&&n.append(" ".repeat(l*r))}function c(l,p){l&&n.append(","),r&&(n.append("\n"),s(p+1))}function i(l,p,d){r&&p&&(n.append("\n"),s(d)),n.append(l)}function a(l,p){Object.prototype.hasOwnProperty.call(l,"value")?w(l.value,p):n.append(He(l))}function m(l,p){let d;try{d=Reflect.getOwnPropertyDescriptor(l,"length")}catch(y){n.append("[Uninspectable]");return}let x=d==null?void 0:d.value;if(!Number.isSafeInteger(x)||x<0){n.append("[Uninspectable]");return}n.append("[");let b=!1;for(let y=0;y<x&&!n.stopped();y+=1){if(c(b,p),b=!0,_>=50){n.append("[MaxEntries]");break}_+=1;let R;try{R=Reflect.getOwnPropertyDescriptor(l,String(y))}catch(F){n.append("[Uninspectable]");continue}R!=null&&R.enumerable?a(R,p+1):n.append("[Empty]")}i("]",b,p)}function C(l,p){let d;try{d=Reflect.ownKeys(l)}catch(b){n.append("[Uninspectable]");return}n.append("{");let x=!1;for(let b of d){if(n.stopped())break;if(_>=50){c(x,p),x=!0,W(n,"\u2026"),n.append(r?": ":":"),n.append("[MaxEntries]");break}_+=1;let y;try{y=Reflect.getOwnPropertyDescriptor(l,b)}catch(R){c(x,p),x=!0,ue(n,b),n.append(r?": ":":"),n.append("[Uninspectable]");continue}y!=null&&y.enumerable&&(c(x,p),x=!0,ue(n,b),n.append(r?": ":":"),a(y,p+1))}i("}",x,p)}function g(l,p){if(o.has(l)){n.append("[Circular]");return}if(p>=5){n.append("[MaxDepth]");return}let d;try{d=Array.isArray(l)}catch(x){n.append("[Uninspectable]");return}o.add(l);try{d?m(l,p):C(l,p)}finally{o.delete(l)}}function w(l,p){l===null?n.append("null"):typeof l=="string"?W(n,l):typeof l=="number"?n.append(Object.is(l,-0)?"-0":String(l)):typeof l=="boolean"?n.append(l?"true":"false"):typeof l>"u"?n.append("undefined"):typeof l=="bigint"?n.append("".concat(l,"n")):typeof l=="symbol"?de(n,l):typeof l=="function"?n.append("[Function]"):g(l,p)}try{return w(e,0),n.result()}catch(l){return"[Uninspectable]"}}var Ke=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_9_1_4_0_5_l_4_0_9_0_3_0_n_o_7_","a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4_c_c_0_h_11_1_0_5_","0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_11_f_g_2d_2_5_3_h7_2_g_1_","p_5_22_6_7_7_h_d_i_e_h_e_c_1_2_f_1f_z_0_4_0_1v_2g_7_4_2_x_1_0_5_1x_a_u_1d_t_2_4_b_17_4_p_1i_m_9_1g_2","a_0_2l_1a_h_7_1i_t_d_1_a_17_q_z_15_2_a_z_2_a_5_16_2_2_15_3_1_5_1_1_3_0_5_5b_1s_7p_2_5_2_11_2_5_2_7_1","_0_1_0_1_0_1_u_2_1g_1_6_1_0_3_2_1_6_3_3_2_5_4_c_5_2_1_6_38_0_d_0_g_c_2t_0_4_0_2_9_1_0_3_4_6_0_1_0_1_","0_1_3_1_a_2_3_5_4_4_0_1g_1_22j_6c_6_3_3_1_c_11_1_0_5_0_2_1j_7_0_g_m_9_6_1_6_1_6_1_6_1_6_1_6_1_6_1_6_","28_0_d1_1_16_4_5_1_4_2d_6_2_1_2h_1_3_5_16_1_2l_h_v_1c_f_e8_533_1s_h3g_1v_19_2_7g_3_f_a_1_k_1a_g_u_2_","1x_1d_8_2_2u_2_29_k_g_1_2_1_3_1_m_t_1f_e_1d_1q_5_3_0_1_1_b_r_a_m_p_s_7_1a_s_0_g_4_1_9_a_4_1_14_n_2_1","_7_k_m_3_0_3_1d_1_0_3_1_2_4_2_0_1_0_o_2_2_a_7_2_c_5_2_5_2_5_9_6_1_6_1_16_1_d_6_36_t_8mb_c_m_4_1c_6is","_a5_2_2x_12_6_c_4_5_0_1_9_1_c_1_4_1_0_1_1_1_1_1_2z_x_a2_i_1r_2_1h_14_b_38_4_1_3q_10_p_6_p_b_2g_3_5_2","_5_2_5_2_2_z_b_1_p_1_i_1_1_1_e_2_d_y_3e_at_s_3_1c_1b_v_d_j_1_7_6_11_a_t_2_z_4_7_1c_4d_i_z_4_z_4_13_8","_1f_c_a_1_e_1_6_1_1_1_a_1_e_1_6_1_1_3_1f_c_8m_9_l_a_7_o_5_1_15_1_8_1x_5_2_0_1_17_1_1_3_0_2_m_a_m_9_u","_1t_i_1_1_a_l_a_p_6_p_12_1j_6_1_1s_0_f_3_1_2_1_s_16_s_3_s_z_7_1_r_r_1h_a_l_a_i_d_h_32_20_1j_1e_d_1e_","d_z_12_r_9_m_6y_15_6_1_g_5_1k_s_a_0_8_l_16_h_1a_k_r_m_c_1g_1l_1_2_0_d_18_w_o_q_z_t_0_2_0_8_y_3_0_c_1","b_e_3_l_0_1_0_z_h_1_o_j_1_1r_6_1_0_1_3_1_e_1_9_7_1a_12_7_2_1_2_l_1_6_1_1_1_4_3_0_i_0_c_4_u_9_1_0_2_0","_1_11_1_0_p_0_1_0_18_1g_i_3_k_2_u_1b_k_1_1_0_54_1a_15_3_10_1b_k_0_1n_16_d_0_1z_q_11_6_55_17_38_1r_v_","7_2_0_2_7_1_1_1_n_f_0_1_0_2m_7_2_12_g_0_1_0_s_0_a_13_7_0_l_0_b_19_j_0_i_20_5j_w_v_8_1_10_h_0_1d_t_34","_6_1_1_1_11_l_0_p_5_1_1_1_v_e_0_n_17_78_i_f_0_1_c_1_x_3g_0_27_pl_6e_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a","1_t_1cy_fs_7_u_h_26_h_t_i_1b_g_3_v_k_5_i_c0_18_5v_1r_w_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_1_c_5p1_15_v_","2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_4me_2c_1_1y_1_1_2_0_2_1_2_3_1_b_1_0","_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_7_1f8_u_6_5","_79_1p_42_18_a_6_g_0_8x_t_i_17_dg_r_6c_t_2_0_5r_u_1_2_1_1_1_6_2_4_9_1_68_6_1_3_1_1_1_e_1_5g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),U=Ke.slice(1).split("_"),$=[],pe=127;for(let e=0;e<U.length;e+=2){let t=pe+1+Number.parseInt(U[e],36),n=t+Number.parseInt(U[e+1],36);$.push([t,n]),pe=n}function ge(e){if(Number.isNaN(e)||e<128||e>1114111)return!1;let t=0,n=$.length-1;for(;t<=n;){let r=t+n>>1,o=$[r];if(e<o[0])n=r-1;else if(e>o[1])t=r+1;else return!0}return!1}var Qe=fe,ke="\u2018",Ce="\u2019",Oe="\u201C",Ae="\u201D",Ze="\u2013",Ye="\u2014",Xe="\xA0",ve="\u2026",et="\u200A",tt="\u2009",nt="\u2032",rt="\u2033",_t="\\",ot="\uFFFD",st="`",it="\xD7",ct=[".",",",";","!","?"],je=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"]),L=Object.prototype.hasOwnProperty,Se=Function.prototype.toString,lt=Se.call(Object),E=class{constructor(){T(this,"hasRepeatedReferences",!1);T(this,"clones",[]);T(this,"index");T(this,"sources",[])}get(t){if(this.index){let r=this.index.get(t);return r!==void 0&&(this.hasRepeatedReferences=!0),r}let n=this.sources.indexOf(t);if(n!==-1)return this.hasRepeatedReferences=!0,this.clones[n]}set(t,n){if(this.index){this.index.set(t,n);return}if(this.sources.push(t),this.clones.push(n),this.sources.length===32){this.index=new WeakMap;for(let r=0;r<this.sources.length;r++)this.index.set(this.sources[r],this.clones[r]);this.sources=[],this.clones=[]}}};function Re(e,t){let n=t.get(e);if(n!==void 0)return n;let r=e.slice(0);return t.set(e,r),r}function at(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let _=Buffer.from(e);return t.set(e,_),_}let n=Re(e.buffer,t);if(e instanceof DataView||Object.prototype.toString.call(e)==="[object DataView]"){let _=new DataView(n,e.byteOffset,e.byteLength);return t.set(e,_),_}let r=e.constructor,o=new r(n,e.byteOffset,e.length);return t.set(e,o),o}function Pe(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0})}function B(e,t,n,r){for(let o of n){let _=t[o],s=typeof _!="object"||_===null?_:S(_,r);o==="__proto__"?Pe(e,o,s):e[o]=s}}function P(e,t,n,r){for(let o of n){let _=Object.getOwnPropertyDescriptor(t,o);if(_){if("value"in _){let s=_.value;_.value=typeof s!="object"||s===null?s:S(s,r)}Object.defineProperty(e,o,_)}}}var ft=Map.prototype.entries,ut=Set.prototype.values,K=Object.prototype.toString,ye,dt=(ye=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:ye.get,me,pt=(me=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:me.get,xe,gt=(xe=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:xe.get,we,Me=(we=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:we.get,ht=RegExp.prototype.test,z;function bt(e){if(e instanceof ArrayBuffer)return!0;try{return dt.call(e),!0}catch(t){return!1}}function yt(e){try{return ft.call(e)}catch(t){return null}}function mt(e){try{return ut.call(e)}catch(t){return null}}function xt(e){var t;try{return z||(z=(t=Object.getOwnPropertyDescriptor(URL.prototype,"href"))==null?void 0:t.get),z.call(e)}catch(n){return null}}function S(e,t){if(typeof e!="object"||e===null)return e;let n=t.get(e);if(n!==void 0)return n;if(Array.isArray(e)){let i=e.length,a=new Array(i);t.set(e,a);let m=e,C=Object.keys(e);if(C.length===i&&(i===0||C[i-1]==="".concat(i-1)))for(let g=0;g<i;g++){let w=m[g];a[g]=typeof w!="object"||w===null?w:S(w,t)}else B(a,m,C,t);return a}let r=Object.getPrototypeOf(e);if(r===Object.prototype){let i={};return t.set(e,i),B(i,e,Object.keys(e),t),i}if(r===null){let i=Object.create(null);return t.set(e,i),B(i,e,Object.keys(e),t),i}if(De(e)){let i=new Date(Ee.call(e));return t.set(e,i),P(i,e,Object.keys(e),t),i}if(ArrayBuffer.isView(e))return at(e,t);if(bt(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return Re(e,t);let o=yt(e);if(o){let i=new Map;t.set(e,i);for(let[a,m]of o)i.set(S(a,t),S(m,t));return P(i,e,Object.keys(e),t),i}let _=mt(e);if(_){let i=new Set;t.set(e,i);for(let a of _)i.add(S(a,t));return P(i,e,Object.keys(e),t),i}if(Z(e)&&e!==RegExp.prototype){let i=new RegExp(Me.call(e),pt.call(e));return i.lastIndex=e.lastIndex,t.set(e,i),P(i,e,Object.keys(e),t),i}let s=xt(e);if(s!==null){let i=new URL(s);return t.set(e,i),P(i,e,Object.keys(e),t),i}if(e instanceof Error||K.call(e)==="[object Error]"){let i=Object.create(Object.getPrototypeOf(e));return t.set(e,i),P(i,e,Reflect.ownKeys(e),t),i}let c=Object.create(r);return t.set(e,c),B(c,e,Object.keys(e),t),c}function wt(e){return S(e,new E)}function kt(e){let t=new E,n=S(e,t);return{hasRepeatedReferences:t.hasRepeatedReferences,value:n}}function Ct(e){if(!k(e))return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function Ot(e){return k(e)&&e.length===1&&je.has(e)}function At(e){return k(e)&&je.has(e)}function Q(e){if(e.length===1){let t=e.charCodeAt(0);return t<55296||t>57343?t:-1}if(e.length===2){let t=e.charCodeAt(0),n=e.charCodeAt(1);if(t>=55296&&t<=56319&&n>=56320&&n<=57343)return(t-55296)*1024+n-56320+65536}return-1}function jt(e){if(!k(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91||t>96&&t<123:ge(Q(e))}function St(e){if(!e||!k(e))return!1;let t=e.charCodeAt(0);return t>64&&t<91||t>96&&t<123}function Rt(e){return k(e)&&(e==='"'||e==="'"||e===ke||e===Ce||e===Oe||e===Ae)}function Pt(e){if(!k(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>96&&t<123:Q(e)<0?!1:e===e.toLowerCase()&&e!==e.toUpperCase()}function Mt(e){if(!k(e)||e.length===0||e.length>2)return!1;let t=e.charCodeAt(0);return e.length===1&&t<128?t>64&&t<91:Q(e)<0?!1:e===e.toUpperCase()&&e!==e.toLowerCase()}function Tt(e){if(!k(e)||!e)return!1;let t=e.charCodeAt(0);return t<128?t===32||t>8&&t<14:!e[0].trim()}var It=e=>k(e)&&e.length&&e.endsWith("/")?e.slice(0,-1).trim():e;function Te(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.getOwnPropertyDescriptor(t,"constructor");if(!n||!("value"in n)||typeof n.value!="function")return!1;let r=Object.getOwnPropertyDescriptor(n.value,"prototype");return(r==null?void 0:r.value)===t&&Se.call(n.value)===lt}function Et(e="",t=0,n=0,r=""){return t<0&&(t+=e.length,t<0&&(t=0)),e.slice(0,t)+(r||"")+e.slice(t+n)}function k(e){return typeof e=="string"}function Ie(e){return Number.isFinite(e)}function Dt(e){return Number.isSafeInteger(e)&&e>=0}function Wt(e){return typeof e=="boolean"}function Bt(e){return e===null}function Z(e){if(e===null||typeof e!="object")return!1;try{return e instanceof RegExp?(e.source,!0):K.call(e)!=="[object RegExp]"?!1:(Me.call(e),!0)}catch(t){return!1}}var Ee=Date.prototype.getTime;function De(e){if(e instanceof Date)return!0;if(e===null||typeof e!="object"||K.call(e)!=="[object Date]")return!1;try{return Ee.call(e),!0}catch(t){return!1}}function Lt(e,t){if(!e||!t)return e;let n=!0;for(let c=t.length;c--;)if(t.charCodeAt(c)>127){n=!1;break}if(n){let c=0,i=e.length;if(t.length===1){let a=t.charCodeAt(0);for(;c<i&&e.charCodeAt(c)===a;)c++;for(;i>c&&e.charCodeAt(i-1)===a;)i--}else{for(;c<i&&t.includes(e[c]);)c++;for(;i>c&&t.includes(e[i-1]);)i--}return c===0&&i===e.length?e:e.slice(c,i)}let r=Array.from(e),o=new Set(t),_=0,s=r.length;for(;_<s&&o.has(r[_]);)_++;for(;s>_&&o.has(r[s-1]);)s--;return _===0&&s===r.length?e:r.slice(_,s).join("")}function Nt(e,t){if(!k(e)||!k(t)||t.length===0)return[];let n=[],r=e.indexOf(t);for(;r!==-1;)n.push(r),r=e.indexOf(t,r+1);return n}function Vt(e=[],t=[]){if(!e||!Array.isArray(e)||!e.length)return[];if(!t||!Array.isArray(t)||!t.length)return e.slice();if(e.length*t.length<400)return e.filter(r=>!t.includes(r));let n=new Set(t);return e.filter(r=>!n.has(r))}function Ft(e){return e!=null}function Ut(e){return[...new Set(e)]}function We(e){if(!(typeof e!="string"||!e)){if(e.includes("\r\n"))return"\r\n";if(e.includes("\n"))return"\n";if(e.includes("\r"))return"\r"}}function $t(e,t,n="\n"){if(n!=="\n"&&n!=="\r\n"&&n!=="\r")throw new Error('codsen-utils/resolveEolSetting(): [THROW_ID_01] the input argument defaultEolChar should be one of EOL values: "\\n", "\\r", or "\\r\\n", but it was given as '.concat(I(n)));return t==="crlf"?"\r\n":t==="cr"?"\r":t==="lf"?"\n":We(e)||n}function zt(e,t){return e!=null&&L.call(e,t)}function Jt(e,t){return e.localeCompare(t)}var qt=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Gt=new Set(["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]);function Ht(e,t){if(!Array.isArray(e)||!e.length||!k(t))return!1;for(let n of e){if(typeof n=="string"){if(t===n)return!0;continue}if(Z(n)){let r=gt.call(n);r&&(n.lastIndex=0);let o=ht.call(n,t);if(r&&(n.lastIndex=0),o)return!0}}return!1}function Kt(e=[],t=[]){if(!Array.isArray(e)||!Array.isArray(t)||!e.length||!t.length)return[];let n=[];if(e.length*t.length<64){for(let _ of e)t.includes(_)&&!n.includes(_)&&n.push(_);return n}let r=new Set(t),o=new Set;for(let _ of e)r.has(_)&&!o.has(_)&&(o.add(_),n.push(_));return n}var J=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;function Qt(e){return e.replace(/-+([^-])/g,(t,n)=>n.toUpperCase())}function Zt(e){return e.replace(/([\da-z])([A-Z])/g,"$1-$2").toLowerCase()}function Yt(e){return e.replace(/^[\r\n]+/,"").replace(/[\r\n]+$/,"")}function he(e,t){let n=Number.POSITIVE_INFINITY,r=e.split("\n");for(let _ of r){let s=/^[ \t]*(?=\S)/.exec(_);s&&(n=Math.min(n,s[0].length))}let o=" ".repeat(t);return r.map(_=>_.trim()?o+_.slice(n):_).join("\n")}function Xt(e,t,n){let r="";return e&&(r=Yt(e.replace(/\t+\n*$/,"")),r.includes("\n")&&(r=he(r,n)),r="\n".concat(r)),t&&(r=r?"".concat(he("\n".concat(t,"\n"),n)).concat(r):"\n".concat(t)),"".concat(r,"\n")}function vt(e){var r;let t=k(e.name)?e.name:"",{bin:n}=e;return k(n)?t.slice(t.startsWith("@")?t.indexOf("/")+1:0):n&&typeof n=="object"&&(r=Object.keys(n)[0])!=null?r:t}function en(e,t){let n=e?e.type:void 0;return t===void 0?n==="string"?"":n==="number"?void 0:!0:n==="boolean"?t==="true":n==="number"?Number(t):t}function tn(e="",t={}){var te,ne,re,_e,oe,se,ie,ce,le,ae;let n=typeof process>"u"?void 0:process,r=(te=t.pkg)!=null?te:{},o=(re=(ne=t.argv)!=null?ne:n==null?void 0:n.argv.slice(2))!=null?re:[],_=(_e=t.helpIndent)!=null?_e:2,s=(oe=t.autoHelp)!=null?oe:!0,c=(se=t.autoVersion)!=null?se:!0,i=(ce=(ie=t.version)!=null?ie:r.version)!=null?ce:"No version found",a=L.call(t,"booleanDefault")?t.booleanDefault:!1,m=Xt(e,(le=t.description)!=null?le:r.description,_);function C(f){console.log(m),n==null||n.exit(Ie(f)?f:2)}function g(){console.log(i),n==null||n.exit(0)}let w=[],l=new Map;for(let[f,u]of Object.entries((ae=t.flags)!=null?ae:{})){let h={key:f,type:u.type,isMultiple:!!u.isMultiple,source:u};w.push(h),l.set(f,h),l.set(Zt(f),h),u.shortFlag&&l.set(u.shortFlag,h)}let p=[],d={};function x(f,u){let h=l.get(f),O=h?h.key:Qt(f);if(h!=null&&h.isMultiple){let A=d[O];Array.isArray(A)?A.push(u):d[O]=[u];return}d[O]=u}function b(f,u){x(f,en(l.get(f),u))}function y(f,u){return u===void 0?!1:(f==null?void 0:f.type)==="boolean"?u==="true"||u==="false":!(u.startsWith("-")&&u.length>1&&!J.test(u))}function R(f,u){let h=f.slice(1);for(let O=0;O<h.length;O++){let A=h[O],j=h.slice(O+1);if(j.startsWith("="))return b(A,j.slice(1)),u;if(J.test(j)||j&&/\W/.test(j[0]))return b(A,j),u;let M=l.get(A);if(j&&(M!=null&&M.type)&&M.type!=="boolean")return b(A,j),u;if(j){b(A,void 0);continue}if(y(M,o[u+1]))return b(A,o[u+1]),u+1;b(A,void 0)}return u}for(let f=0;f<o.length;f++){let u=o[f];if(u==="--"){p.push(...o.slice(f+1));break}if(u.startsWith("--")){let h=u.slice(2),O=h.indexOf("=");if(O!==-1){b(h.slice(0,O),h.slice(O+1));continue}if(h.startsWith("no-")){x(h.slice(3),!1);continue}let A=l.get(h);if(y(A,o[f+1])){b(h,o[f+1]),f++;continue}b(h,void 0);continue}if(u.startsWith("-")&&u.length>1&&!J.test(u)){f=R(u,f);continue}p.push(u)}for(let f of w)L.call(d,f.key)||(L.call(f.source,"default")?d[f.key]=f.source.default:f.isMultiple?d[f.key]=[]:f.type==="boolean"&&a!==void 0&&(d[f.key]=a));!p.length&&o.length===1&&(c&&d.version===!0?g():s&&d.help===!0&&C(0));let F=vt(r);return F&&n&&(n.title=F),{input:p,flags:d,pkg:r,help:m,showHelp:C,showVersion:g}}function nn(e,t=[]){if(!e)return e;if(!Te(e))throw new Error("codsen-utils/omit(): [THROW_ID_02] Input must be a plain object! It was given as ".concat(I(e,4),' (typeof is "').concat(typeof e,'")'));let n=Object.getPrototypeOf(e)===null?Object.create(null):{},r=new E;r.set(e,n);let o=Object.keys(e),_=o.length*t.length<400?void 0:new Set(t);for(let s of o){if(_?_.has(s):t.includes(s))continue;let c=S(e[s],r);s==="__proto__"?Pe(n,s,c):n[s]=c}return n}var rn=256,_n=1024,on=1,sn=new Map,cn=new Map;function H(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let t=String.fromCharCode(e).toUpperCase();if(t.length!==1)return e;let n=t.charCodeAt(0);return e>127&&n<128?e:n}function q(e,t,n,r,o,_){for(let s=0;s<o;s++){let c=e.charCodeAt(t+s),i=n.charCodeAt(r+s);if(_||(c>=97&&c<=122&&(c-=32),i>=97&&i<=122&&(i-=32)),c!==i)return!1}return!0}function Be(e,t,n){let r=t.indexOf("\\");if(r===-1&&e===t)return!0;let o=t.indexOf("*");if(r===-1&&o===-1){if(n)return!1;for(let m=0;m<t.length;m++)if(t.charCodeAt(m)>127)return;return e.length===t.length&&q(e,0,t,0,t.length,!1)}if(r!==-1)return;let _=0,s=!1,c=-1;for(let m=0;m<t.length;m++){let C=t.charCodeAt(m);if(C>127)return;if(C===42){if(c=m,!s){if(_++,_>1)return;s=!0}}else s=!1}let i=c+1,a=t.length-i;return e.length<o+a?!1:q(e,0,t,0,o,n)&&q(e,e.length-a,t,i,a,n)}function ln(e){let t=new Uint32Array(e.length),n=0;for(let r=1;r<e.length;r++){for(;n>0&&e[r]!==e[n];)n=t[n-1];e[r]===e[n]&&n++,t[r]=n}return t}function an(e,t){let n=[[]],r=!0,o=!1,_=!1,s=0;for(let g=0;g<e.length;){let w=e.codePointAt(g);if(w!==92){if(w===42)o=!0,_||(n.push([]),_=!0);else{let y=t?w:H(w);n[n.length-1].push(y),r&&(r=y<=127),s++,_=!1}g+=w>65535?2:1;continue}let l=g+1;for(;e.charCodeAt(l)===92;)l++;let p=l-g,d=e.codePointAt(l),x,b=!1;d===42?(b=p%2===0,x=b?p/2:(p-1)/2):d===void 0||d===10||d===13||d===8232||d===8233?x=Math.ceil(p/2):x=Math.floor(p/2);for(let y=0;y<x;y++)n[n.length-1].push(92),s++;if(b){_=!1,g=l;continue}if(d!==void 0){let y=t?d:H(d);n[n.length-1].push(y),r&&(r=y<=127),s++,l+=d>65535?2:1}_=!1,g=l}let c=o&&n[0].length===0,i=o&&n[n.length-1].length===0,a=[];for(let g of n)g.length&&a.push({values:g});let m=c?0:1,C=a.length-(i?0:1);for(let g=m;g<C;g++)a[g].values.length>on&&(a[g].failure=ln(a[g].values));return{asciiOnly:r,endsWithWildcard:i,hasWildcard:o,minimumInputLength:s,segments:a,startsWithWildcard:c}}function Y(e,t){let n=t?sn:cn,r=e.length<=_n;if(r){let _=n.get(e);if(_)return _}let o=an(e,t);if(r){if(n.size>=rn){let _=n.keys().next().value;_!==void 0&&n.delete(_)}n.set(e,o)}return o}function X(e,t){if(t){let o=[];for(let _=0;_<e.length;){let s=e.codePointAt(_);o.push(s),_+=s>65535?2:1}return o}let n=new Uint32Array(e.length),r=0;for(let o=0;o<e.length;){let _=e.codePointAt(o);n[r]=H(_),r++,o+=_>65535?2:1}return r===n.length?n:n.subarray(0,r)}function N(e,t,n,r){for(let o=0;o<n.values.length;o++){let _=e.charCodeAt(t+o);if(!r&&_>=97&&_<=122&&(_-=32),_!==n.values[o])return!1}return!0}function fn(e,t,n,r,o){let _=r-t.values.length;if(_<n)return-1;if(!t.failure){for(let c=n;c<=_;c++)if(N(e,c,t,o))return c;return-1}let s=0;for(let c=n;c<r;c++){let i=e.charCodeAt(c);for(!o&&i>=97&&i<=122&&(i-=32);s>0&&i!==t.values[s];)s=t.failure[s-1];if(i===t.values[s]&&(s++,s===t.values.length))return c-s+1}return-1}function v(e,t,n){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&N(e,0,t.segments[0],n);let r=0,o=t.segments.length,_=0,s=e.length;if(!t.startsWithWildcard){let c=t.segments[0];if(!N(e,0,c,n))return!1;_=c.values.length,r++}if(!t.endsWithWildcard){o--;let c=t.segments[o];if(s-=c.values.length,!N(e,s,c,n))return!1}for(let c=r;c<o;c++){let i=t.segments[c],a=fn(e,i,_,s,n);if(a===-1)return!1;_=a+i.values.length}return!0}function V(e,t,n){for(let r=0;r<n.values.length;r++)if(e[t+r]!==n.values[r])return!1;return!0}function un(e,t,n,r){let o=r-t.values.length;if(o<n)return-1;if(!t.failure){for(let s=n;s<=o;s++)if(V(e,s,t))return s;return-1}let _=0;for(let s=n;s<r;s++){for(;_>0&&e[s]!==t.values[_];)_=t.failure[_-1];if(e[s]===t.values[_]&&(_++,_===t.values.length))return s-_+1}return-1}function ee(e,t){if(e.length<t.minimumInputLength)return!1;if(!t.hasWildcard)return e.length===t.minimumInputLength&&V(e,0,t.segments[0]);let n=0,r=t.segments.length,o=0,_=e.length;if(!t.startsWithWildcard){let s=t.segments[0];if(!V(e,0,s))return!1;o=s.values.length,n++}if(!t.endsWithWildcard){r--;let s=t.segments[r];if(_-=s.values.length,!V(e,_,s))return!1}for(let s=n;s<r;s++){let c=t.segments[s],i=un(e,c,o,_);if(i===-1)return!1;o=i+c.values.length}return!0}function dn(e,t,n){let r=Be(e,t,n);if(r!==void 0)return r;let o=Y(t,n);return o.asciiOnly?v(e,o,n):ee(X(e,n),o)}function be(e,t,n,r){var s;let o=Be(e,t,n);if(o!==void 0)return o;let _=Y(t,n);return _.asciiOnly?v(e,_,n):((s=r.tokens)!=null||(r.tokens=X(e,n)),ee(r.tokens,_))}function pn(e,t){let n=e.charCodeAt(0)===33,r=n?e.slice(1):e;return{compiled:r.length===0?void 0:Y(r,t),negative:n}}function G(e,t,n,r){var _;let o;return t.compiled?t.compiled.asciiOnly?o=v(e,t.compiled,n):((_=r.tokens)!=null||(r.tokens=X(e,n)),o=ee(r.tokens,t.compiled)):o=e.length===0,t.negative?!o:o}function gn(e,t){let n=(t==null?void 0:t.caseSensitiveMatch)===!0,r=typeof e=="string"?[e]:Array.from(new Set(e));if(r.length===0)return()=>!1;let o=r.map(_=>pn(_,n));if(typeof e=="string"){let _=o[0];return s=>G(s,_,n,{})}return _=>{let s={},c=!1,i=!1;for(let a of o)if(a.negative){if(!G(_,a,n,s))return!1}else c=!0,!i&&G(_,a,n,s)&&(i=!0);return c?i:!0}}function hn(e,t,n){if(typeof t!="string"&&!t.length)return!1;let r=n===void 0?!1:n.caseSensitiveMatch===!0;if(typeof t=="string"){let c=t.charCodeAt(0)===33,i=c?t.slice(1):t,a=dn(e,i,r);return c?!a:a}let o={},_=!1,s=!1;for(let c of t){let i=c.charCodeAt(0)===33,a=i?c.slice(1):c;if(i){if(be(e,a,r,o))return!1}else _=!0,!s&&be(e,a,r,o)&&(s=!0)}return _?s:!0}return ze(bn);})();
|
|
11
|
+
/**
|
|
12
|
+
* @name codsen-format-diagnostic-value
|
|
13
|
+
* @fileoverview Safely format untrusted JavaScript values for diagnostics
|
|
14
|
+
* @version 1.1.1
|
|
15
|
+
* @author Roy Revelt
|
|
16
|
+
* @license MIT
|
|
17
|
+
* {@link https://codsen.com/os/codsen-format-diagnostic-value/}
|
|
18
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codsen-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "Various utility functions",
|
|
5
5
|
"keywords": ["codsen", "utility", "helpers"],
|
|
6
6
|
"homepage": "https://codsen.com/os/codsen-utils",
|
|
@@ -57,6 +57,9 @@
|
|
|
57
57
|
"extras": [""]
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"codsen-format-diagnostic-value": "^1.1.1"
|
|
62
|
+
},
|
|
60
63
|
"engines": {
|
|
61
64
|
"node": ">=18.20.8"
|
|
62
65
|
},
|
package/types/index.d.ts
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Safely formats untrusted input for an error message.
|
|
3
|
-
*
|
|
4
|
-
* The result is JSON-like rather than JSON: values which JSON cannot express
|
|
5
|
-
* use explicit diagnostic tokens. Object accessors are described without
|
|
6
|
-
* running them, circular references are marked, and reflection failures are
|
|
7
|
-
* contained. Output is capped at 2,000 UTF-16 code units, five object levels,
|
|
8
|
-
* and 50 array items or object properties across the whole value.
|
|
9
|
-
*/
|
|
10
|
-
declare function formatDiagnosticValue(
|
|
11
|
-
value: unknown,
|
|
12
|
-
indentation?: 0 | 4,
|
|
13
|
-
): string;
|
|
1
|
+
export { formatDiagnosticValue } from "codsen-format-diagnostic-value";
|
|
14
2
|
|
|
15
3
|
declare const version: string;
|
|
16
4
|
declare const leftSingleQuote = "\u2018";
|
|
@@ -39,33 +27,49 @@ interface JSONObject {
|
|
|
39
27
|
[key: string]: JSONValue;
|
|
40
28
|
}
|
|
41
29
|
type Obj = JSONObject;
|
|
30
|
+
type PlainObject = Record<PropertyKey, unknown>;
|
|
42
31
|
type EolChar = "\n" | "\r" | "\r\n";
|
|
43
32
|
type EolSetting = "lf" | "crlf" | "cr";
|
|
44
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Clone nested data without retaining object or collection references.
|
|
35
|
+
*
|
|
36
|
+
* Functions and primitive values, including symbols, retain their identities.
|
|
37
|
+
* Arrays, plain and null-prototype records, dates, maps, sets, binary buffers
|
|
38
|
+
* and views, regular expressions, errors, URLs, and ordinary class instances
|
|
39
|
+
* retain their usable runtime shape. The built-in cases also accept
|
|
40
|
+
* cross-realm values; SharedArrayBuffer support depends on the current realm
|
|
41
|
+
* exposing its constructor. Enumerable accessors on records and arrays are
|
|
42
|
+
* read once and become data properties on the clone. Class behavior must rely
|
|
43
|
+
* on cloneable own state rather than private or other hidden internal slots.
|
|
44
|
+
* Cycles and repeated references remain cycles and repeated references within
|
|
45
|
+
* the cloned graph.
|
|
46
|
+
*/
|
|
45
47
|
declare function deepClone<T>(value: T): T;
|
|
46
48
|
interface DeepCloneResult<T> {
|
|
47
49
|
hasRepeatedReferences: boolean;
|
|
48
50
|
value: T;
|
|
49
51
|
}
|
|
50
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Clone nested data under {@link deepClone}'s value contract and report whether
|
|
54
|
+
* its source graph reused an object.
|
|
55
|
+
*/
|
|
51
56
|
declare function deepCloneWithMetadata<T>(value: T): DeepCloneResult<T>;
|
|
52
57
|
declare function isNumberChar(value: unknown): boolean;
|
|
53
58
|
declare function isCurrencyChar(value: unknown): boolean;
|
|
54
59
|
declare function isCurrencySymbol(value: unknown): boolean;
|
|
60
|
+
/** Return whether the input is exactly one Unicode Letter code point. */
|
|
55
61
|
declare function isLetter(value: unknown): boolean;
|
|
56
62
|
declare function isLatinLetter(value: unknown): boolean;
|
|
57
63
|
declare function isQuote(value: unknown): boolean;
|
|
64
|
+
/** Return whether the input is exactly one lowercase Unicode code point. */
|
|
58
65
|
declare function isLowercaseLetter(value: unknown): boolean;
|
|
66
|
+
/** Return whether the input is exactly one uppercase Unicode code point. */
|
|
59
67
|
declare function isUppercaseLetter(value: unknown): boolean;
|
|
60
68
|
declare function isWhitespaceChar(value: unknown): boolean;
|
|
61
69
|
declare const removeTrailingSlash: <T>(value: T) => string | T;
|
|
62
|
-
/**
|
|
63
|
-
*
|
|
64
|
-
|
|
65
|
-
* @param value unknown
|
|
66
|
-
* @returns boolean
|
|
67
|
-
*/
|
|
68
|
-
declare function isPlainObject(value: unknown): value is JSONObject;
|
|
70
|
+
/** Return whether a value is an object literal, a value created by
|
|
71
|
+
* `new Object()`, or a direct null-prototype record, including across realms. */
|
|
72
|
+
declare function isPlainObject(value: unknown): value is PlainObject;
|
|
69
73
|
/**
|
|
70
74
|
* @param str input string
|
|
71
75
|
* @param index starting index
|
|
@@ -120,7 +124,8 @@ declare function resolveEolSetting(
|
|
|
120
124
|
eolSetting: EolSetting | unknown,
|
|
121
125
|
defaultEolChar?: EolChar,
|
|
122
126
|
): EolChar;
|
|
123
|
-
|
|
127
|
+
/** Safely check an own string, number, or symbol property. */
|
|
128
|
+
declare function hasOwnProp(obj: unknown, prop: PropertyKey): boolean;
|
|
124
129
|
/**
|
|
125
130
|
* Related to @typescript-eslint/require-array-sort-compare lint error
|
|
126
131
|
*/
|
|
@@ -212,6 +217,22 @@ interface MatchOptions {
|
|
|
212
217
|
/** Match letter case exactly. Off by default. */
|
|
213
218
|
caseSensitiveMatch?: boolean;
|
|
214
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Prepare one or more wildcard patterns once and return a reusable matcher.
|
|
222
|
+
*
|
|
223
|
+
* The returned function has the same whole-string, wildcard, escaping,
|
|
224
|
+
* negation, and case-folding behavior as {@link match}. The returned closure
|
|
225
|
+
* retains its prepared state even when the bounded process-wide cache evicts a
|
|
226
|
+
* pattern or declines to cache a long one.
|
|
227
|
+
*
|
|
228
|
+
* @param patterns one pattern or an array of cohesive allow/deny patterns
|
|
229
|
+
* @param options matching options
|
|
230
|
+
* @returns a function that tests one input string against the prepared patterns
|
|
231
|
+
*/
|
|
232
|
+
declare function createMatcher(
|
|
233
|
+
patterns: string | readonly string[],
|
|
234
|
+
options?: MatchOptions,
|
|
235
|
+
): (input: string) => boolean;
|
|
215
236
|
/**
|
|
216
237
|
* Match a whole string against one or more wildcard patterns.
|
|
217
238
|
*
|
|
@@ -244,6 +265,7 @@ export {
|
|
|
244
265
|
backtick,
|
|
245
266
|
codsenCLI,
|
|
246
267
|
compareFn,
|
|
268
|
+
createMatcher,
|
|
247
269
|
deepClone,
|
|
248
270
|
deepCloneWithMetadata,
|
|
249
271
|
detectEol,
|
|
@@ -251,7 +273,6 @@ export {
|
|
|
251
273
|
ellipsis,
|
|
252
274
|
existy,
|
|
253
275
|
findAllIdx,
|
|
254
|
-
formatDiagnosticValue,
|
|
255
276
|
hairspace,
|
|
256
277
|
hasOwnProp,
|
|
257
278
|
includes,
|
|
@@ -312,4 +333,5 @@ export type {
|
|
|
312
333
|
JsonObject,
|
|
313
334
|
MatchOptions,
|
|
314
335
|
Obj,
|
|
336
|
+
PlainObject,
|
|
315
337
|
};
|