string-convert-indexes 6.2.1 → 6.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.2.3 (2026-09-01)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **ast-monkey:** preserve traversal data semantics ([861b9fc](https://github.com/codsen/codsen/commit/861b9fc242abb9e6a06c665a80e884970276b22d))
|
|
11
|
+
|
|
12
|
+
## 6.2.2 (2026-08-22)
|
|
13
|
+
|
|
14
|
+
### Performance Improvements
|
|
15
|
+
|
|
16
|
+
- optimise package hot paths and JSON editing ([f3112bd](https://github.com/codsen/codsen/commit/f3112bd7fc0d7c9bc09312d3744c950691d72ca5))
|
|
17
|
+
|
|
6
18
|
## 6.2.0 (2026-08-19)
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
|
9
21
|
|
|
10
22
|
- make validation diagnostics safe ([7b01074](https://github.com/codsen/codsen/commit/7b0107476f12734aeb8e82852ba980b187280110))
|
|
11
|
-
- resolve review findings
|
|
23
|
+
- resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
|
|
12
24
|
- retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
|
|
13
25
|
- standardise index conversion errs ([182dee5](https://github.com/codsen/codsen/commit/182dee517593c0705bd43e97fbdbd473be7aa7db))
|
|
14
26
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-convert-indexes
|
|
3
3
|
* @fileoverview Convert between native JS string character indexes and grapheme-count-based indexes
|
|
4
|
-
* @version 6.2.
|
|
4
|
+
* @version 6.2.3
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-convert-indexes/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{formatDiagnosticValue as m}from"codsen-utils";import{collectGraphemes as $}from"unicode-segmenter/grapheme";import{traverse as
|
|
11
|
-
${r}`);if(n===0)return 0;if(n==="0")return"0";let s=
|
|
10
|
+
import{formatDiagnosticValue as m}from"codsen-utils";import{collectGraphemes as $}from"unicode-segmenter/grapheme";import{traverse as v}from"ast-monkey-traverse";var f="6.2.3";var k=f,h=typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function g(i){let r=typeof i;return r==="string"||r==="number"}function y(i,r,n){let u=i==="n"?"nativeToUnicode":"unicodeToNative";function d(e){return!(!g(e)||typeof e=="string"&&!/^\d*$/.test(e)||typeof e=="number"&&(!Number.isInteger(e)||e<0))}function a(e,o){let c=0,t=0;for(let p=0,b=e.length;p<b;p++){if(t+=e[p].length,o>=c&&o<t)return p;c+=e[p].length}throw new Error(`string-convert-indexes/${u}(): [THROW_ID_01] the "indexes" value, ${n}, is not covered by graphemes length!`)}function l(e,o){if(o>=e.length)throw new Error(`string-convert-indexes/${u}(): [THROW_ID_02] the index to convert, ${o}, is not covered by graphemes length!`);return e.slice(0,o).join("").length}if(typeof r!="string"||!r)throw new TypeError(`string-convert-indexes/${u}(): [THROW_ID_03] the first input argument, input string, must be a non-zero-length string! Currently it's: ${typeof r}, equal to:
|
|
11
|
+
${r}`);if(n===0)return 0;if(n==="0")return"0";let s=h?Array.from(h.segment(r),({segment:e})=>e):$(r);if(g(n)){if(d(n))return i==="u"?typeof n=="string"?String(l(s,+n)):l(s,+n):typeof n=="string"?String(a(s,+n)):a(s,+n);throw new Error(`string-convert-indexes/${u}(): [THROW_ID_04] the second input argument, "indexes" is not suitable to describe string index - it was given as ${m(n,4)} (${typeof n})`)}else{if(n&&typeof n=="object")return i==="u"?v(n,(e,o,c)=>{let t=c.parentType==="object"?o:e;if(g(t)){if(d(t))return typeof t=="string"?String(l(s,+t)):l(s,+t);throw new Error(`string-convert-indexes/${u}(): [THROW_ID_05] bad value was encountered, ${m(t,4)}, its path is ${c.path}`)}return t}):v(n,(e,o,c)=>{let t=c.parentType==="object"?o:e;if(g(t)){if(d(t))return typeof t=="string"?String(a(s,+t)):a(s,+t);throw new Error(`string-convert-indexes/${u}(): [THROW_ID_06] bad value was encountered, ${m(t,4)}, its path is ${c.path}`)}return t});throw new Error(`string-convert-indexes/${u}(): [THROW_ID_07] the first input argument, a source string should be a string but it was given as ${r}, type ${typeof r}`)}}function D(i,r){return y("n",i,r)}function E(i,r){return y("u",i,r)}export{D as nativeToUnicode,E as unicodeToNative,k as version};
|
|
12
12
|
/*!
|
|
13
13
|
* unicode-segmenter
|
|
14
14
|
* MIT License
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name string-convert-indexes
|
|
3
3
|
* @fileoverview Convert between native JS string character indexes and grapheme-count-based indexes
|
|
4
|
-
* @version 6.2.
|
|
4
|
+
* @version 6.2.3
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-convert-indexes/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var stringConvertIndexes=(()=>{var j=Object.defineProperty,te=Object.defineProperties,re=Object.getOwnPropertyDescriptor,ne=Object.getOwnPropertyDescriptors,ie=Object.getOwnPropertyNames,T=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var O=(e,t,r)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,A=(e,t)=>{for(var r in t||(t={}))B.call(t,r)&&O(e,r,t[r]);if(T)for(var r of T(t))oe.call(t,r)&&O(e,r,t[r]);return e},C=(e,t)=>te(e,ne(t));var le=(e,t)=>{for(var r in t)j(e,r,{get:t[r],enumerable:!0})},se=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of ie(t))!B.call(e,l)&&l!==r&&j(e,l,{get:()=>t[l],enumerable:!(i=re(t,l))||i.enumerable});return e};var ue=e=>se(j({},"__esModule",{value:!0}),e);var F=(e,t,r)=>O(e,typeof t!="symbol"?t+"":t,r);var we={};le(we,{nativeToUnicode:()=>ve,unicodeToNative:()=>Ae,version:()=>xe});function ae(){let e=[],t=0,r=!1;return{append(i){return r?!1:t+i.length>1999?(e.push("\u2026"),t+=1,r=!0,!1):(e.push(i),t+=i.length,!0)},result(){return e.join("")},stopped(){return r}}}function fe(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function D(e,t){if(e.append('"')){for(let r=0;r<t.length&&!e.stopped();r+=1){let i=t.charCodeAt(r);i===34?e.append('\\"'):i===92?e.append("\\\\"):i===8?e.append("\\b"):i===9?e.append("\\t"):i===10?e.append("\\n"):i===12?e.append("\\f"):i===13?e.append("\\r"):i<32||i===8232||i===8233||i>=55296&&i<=57343?e.append(fe(i)):e.append(t[r])}e.append('"')}}function ce(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function W(e,t){e.append("Symbol(");let r=String(t);r.length>8&&D(e,r.slice(7,-1)),e.append(")")}function R(e,t){typeof t=="symbol"?W(e,t):D(e,String(t))}function S(e,t=0){let r=ae(),i=t===4?4:0,l=new WeakSet,n=0;function f(s){i&&r.append(" ".repeat(s*i))}function p(s,h){s&&r.append(","),i&&(r.append("\n"),f(h+1))}function o(s,h,g){i&&h&&(r.append("\n"),f(g)),r.append(s)}function c(s,h){Object.prototype.hasOwnProperty.call(s,"value")?m(s.value,h):r.append(ce(s))}function u(s,h){let g;try{g=Reflect.getOwnPropertyDescriptor(s,"length")}catch(y){r.append("[Uninspectable]");return}let b=g==null?void 0:g.value;if(!Number.isSafeInteger(b)||b<0){r.append("[Uninspectable]");return}r.append("[");let x=!1;for(let y=0;y<b&&!r.stopped();y+=1){if(p(x,h),x=!0,n>=50){r.append("[MaxEntries]");break}n+=1;let v;try{v=Reflect.getOwnPropertyDescriptor(s,String(y))}catch(ke){r.append("[Uninspectable]");continue}v!=null&&v.enumerable?c(v,h+1):r.append("[Empty]")}o("]",x,h)}function a(s,h){let g;try{g=Reflect.ownKeys(s)}catch(x){r.append("[Uninspectable]");return}r.append("{");let b=!1;for(let x of g){if(r.stopped())break;if(n>=50){p(b,h),b=!0,D(r,"\u2026"),r.append(i?": ":":"),r.append("[MaxEntries]");break}n+=1;let y;try{y=Reflect.getOwnPropertyDescriptor(s,x)}catch(v){p(b,h),b=!0,R(r,x),r.append(i?": ":":"),r.append("[Uninspectable]");continue}y!=null&&y.enumerable&&(p(b,h),b=!0,R(r,x),r.append(i?": ":":"),c(y,h+1))}o("}",b,h)}function d(s,h){if(l.has(s)){r.append("[Circular]");return}if(h>=5){r.append("[MaxDepth]");return}let g;try{g=Array.isArray(s)}catch(b){r.append("[Uninspectable]");return}l.add(s);try{g?u(s,h):a(s,h)}finally{l.delete(s)}}function m(s,h){s===null?r.append("null"):typeof s=="string"?D(r,s):typeof s=="number"?r.append(Object.is(s,-0)?"-0":String(s)):typeof s=="boolean"?r.append(s?"true":"false"):typeof s>"u"?r.append("undefined"):typeof s=="bigint"?r.append("".concat(s,"n")):typeof s=="symbol"?W(r,s):typeof s=="function"?r.append("[Function]"):d(s,h)}try{return m(e,0),r.result()}catch(s){return"[Uninspectable]"}}var Fe=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"]);var pe=class{constructor(){F(this,"hasRepeatedReferences",!1);F(this,"clones",[]);F(this,"index");F(this,"sources",[])}get(e){if(this.index){let r=this.index.get(e);return r!==void 0&&(this.hasRepeatedReferences=!0),r}let t=this.sources.indexOf(e);if(t!==-1)return this.hasRepeatedReferences=!0,this.clones[t]}set(e,t){if(this.index){this.index.set(e,t);return}if(this.sources.push(e),this.clones.push(t),this.sources.length===32){this.index=new WeakMap;for(let r=0;r<this.sources.length;r++)this.index.set(this.sources[r],this.clones[r]);this.sources=[],this.clones=[]}}};function _(e,t){let r=t.get(e);if(r!==void 0)return r;let i=e.slice(0);return t.set(e,i),i}function he(e,t){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let n=Buffer.from(e);return t.set(e,n),n}let r=_(e.buffer,t);if(e instanceof DataView){let n=new DataView(r,e.byteOffset,e.byteLength);return t.set(e,n),n}let i=e.constructor,l=new i(r,e.byteOffset,e.length);return t.set(e,l),l}function I(e,t,r,i){for(let l of r){let n=t[l];e[l]=typeof n!="object"||n===null?n:w(n,i)}}function w(e,t){if(typeof e!="object"||e===null)return e;let r=t.get(e);if(r!==void 0)return r;if(Array.isArray(e)){let n=e.length,f=new Array(n);t.set(e,f);let p=e,o=Object.keys(e);if(o.length===n&&(n===0||o[n-1]==="".concat(n-1)))for(let c=0;c<n;c++){let u=p[c];f[c]=typeof u!="object"||u===null?u:w(u,t)}else I(f,p,o,t);return f}let i=Object.getPrototypeOf(e);if(i===Object.prototype||i===null){let n={};return t.set(e,n),I(n,e,Object.keys(e),t),n}if(e instanceof Date){let n=new Date(e.getTime());return t.set(e,n),n}if(ArrayBuffer.isView(e))return he(e,t);if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return _(e,t);if(e instanceof Map){let n=new Map;t.set(e,n);for(let[f,p]of e)n.set(w(f,t),w(p,t));return n}if(e instanceof Set){let n=new Set;t.set(e,n);for(let f of e)n.add(w(f,t));return n}let l={};return t.set(e,l),I(l,e,Object.keys(e),t),l}function k(e){return w(e,new pe)}function U(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function L(e,t,r){let i=e.length,l=0,n=0,f=-1,p=()=>{let o=0,c=0,u;do u=parseInt(e[l++],36),o+=(u&15)<<c,c+=4;while(u&16);return o};for(;l<i;){let o=f+1+p();r(o,f=o+p(),t?parseInt(t[n++],36):0)}}function P(e,t,r){let i=0,l=t.length-1;for(;i<=l;){let n=i+l>>>1,f=r[n];if(e<t[n])l=n-1;else if(e>f>>>5)i=n+1;else return f&31}return 0}var M="090001000h1v5g2903000hl2v6jh16ng1s210111110o35aa10u2k1g10l6600152113h2010u1q1r5aq3890o13181214r22k3158q2n1000v100h1k20000001207030001160721k171001h1j11610332010010321210090411021c1c02100o301201412230u1130b100h1j116111420120411001100k11l10051001h1j11611142011000321210072411021d0g10r3000000132120090o200200g1j11f2012031213711271t1001o301001000001121371b1f0c101h1l2011001031212000080a1t1001m40400102101600i11t301006c7i601008b6p41r10101041h3d0004115a1j290p3q223000511010100g1501010302003172030c0010016000e0i6v50n40n5tl12ir33s12t11u11cj30100060700010a90t220000l71i20m7203010241000502rd101004k300000006101027050920g3t22bk1300616g209030207u18c1000t10003010501b2o20000102000004g37070101o921c000640602001mcv3rg20000001o16d0c0m1fg6g2h30m10q55f1vm11c0ma0p1a42nc0ne1a090q3314902021204020112030318250105bb1201110i1021i15101131502141b15120511011k1155132040202510201010603060a1f02040104210b1g3290e0e0kn11vs12j11j3040pp12t80g6v1qi2500c0r51ktl7319g21g51gh103040n11010040j51i3f01q1h1d0m27p1a0000cs13200523j200010301010100v140018a4q2501010101c08000i1f12601011g3012215110u1a0001015000pcq181000100011000iji5fvc0u91g5bhg20ie0l94lo6002115303121s12240la1tj23h44tj11t45m4ah33q700000l3ep2021a200t220301012040a0i320j2040007f00100r20c100g3208000011531000s520201036020t900207l1101n311000000321210090a12634b910201l22001051020120011020000e1i520701020000n10h5001050000010000010001re0010323010001r11i520701000001q6000000107l600000230004gg12080001lc62027111n1000411230000000000t820321030030r10090n205001380800501020n2050c0001mc00002000000nc006150000i5l1100600010001q753011160000i441111000000rl11019100000c1h201043102n10ltk1f006eoss2b0202gs94r36si2033ku101m373h50b1rqs4113sli1t22m1uh2435070726u13k92rr7m34h380e0m141egl561g1261114k60ga6nn10t33sv13uf1jf0207150qt16t66pr60n23k6bf1f0e1l29g71c1e029j1n30p11ea0k1028139m16rb2v621122i52213040tf1u3b51n17127c0232041d120819052c28220104060306l5g3l4572g130152cqdl2c3o37a5o27u11c32d9m2cu2191obo57eh9gg1tv3",N="262122424333333393233393339333333333393393bf3b3b3b3b3f3f3bffff33b3bb33ff3f33b3b3333333bffff3b33bb33f33bffff33b3bb33ff3f33b3bbb333b3ff33b333f33b3b3b3b3333b3bf33b3bb39333b33b33b3b3b333b333333b3b33333f3b33b3ffb3f3fff3f3b33f35dc33333f3b3b3b33323333b3bb3b33b3fb3b3333b33333bff3b3f33bfb3b3ff3b3b3b3b3b333b333b3323e224423444444444444444444444444444444444444444444444444444444444444444444444444444444433334433333333b3b3bb33333b353bff3b3b3b3f3ff3b3b333bfff3f33333fb3bb3fb3b3bb33232333f333fff333333333b3b3333bb3b39393f3b3fbf33bb3b393b3b3b3333b33b33b3bbb33b33ffff3b3333bb3933b3b3b333b3b3b3b3b33b3b3b33b3b3b33b3b33b33b3b3b3fffff3bb39b9b3b33b3bf3f3b33f3b3f93b33b3b3bb33b33b3b3b3333393b3b3b33b39bffb3b332333b333dd3b3333233332333333333333333333333333333444444444444a4444444444444344444444444444444444444444444444444444444444",q="0001000000010010000000100000000000000000000000000001000000010018000100000001001000010101100101100000000000000000000100000001111000010000000110101001110111111111000100000021001000010000000100100001000000011010000100000001111000014000000100180001000000010010";var G=new Uint8Array(12448),K=new Uint8Array(1440),Q=new Uint8Array(2816),z,Z;{let e=(l,n,f,p,o)=>{let c=p-n+1,u=l.length;c>0&&f-n<u&&l.fill(o,f>n?f-n:0,c>u?u:c)},t=new Uint32Array(320),r=new Uint32Array(320),i=0;L(M,N,(l,n,f)=>{e(G,0,l,n,f),e(K,42592,l,n,f),e(Q,126976,l,n,f),n>=65040&&!(l>=126976&&n<=129791)&&(t[i]=l,r[i++]=n<<5|f)}),z=t.slice(0,i),Z=r.slice(0,i)}function V(e){return e<12448?G[e]:e<42592?e===12951||e===12953?4:0:e<44032?K[e-42592]:e<55204?(e-44032)%28?8:7:e>=126976&&e<129792?Q[e-126976]:e>>>4===4064?3:de(e)}function de(e){return e<57344?e<=55238?e>=55216?13:0:e>=55243&&e<=55291?12:0:e<65024?e===64286?3:0:e>=917504?e>921599?0:e>=917536&&e<917632||e>=917760&&e<918e3?3:2:P(e,z,Z)}var ge=Uint8Array.from(q);function be(e){return e===2381||e===2509||e===2765||e===2893||e===3149||e===3405||e===4153||e===6098||e===6752||e===6980||e===7083||e===43456||e===43766||e===68159||e===69939||e===70608||e===71998||e===72263||e===72345||e===73538}function me(e,t){return t===8204?e&21:e&8||be(t)?e&21|40:e&21|32}function H(e,t,r){return t===3?e&32?me(e,r):e&21:t===4?17:t===10?e&2^3:t===14?(e&16)>>2|e&41:t===15?33:1}function J(e){let t=[],r=e.length;if(r===0)return t;let i=e.codePointAt(0),l=i>65535?2:1,n=V(i),f=H(1,n,i),p=0;for(;l<r;){i=e.codePointAt(l);let o=V(i),c=!(f&ge[n<<4|o]);f=H(f,o,i),c&&(t.push(e.slice(p,l)),p=l),l+=i>65535?2:1,n=o}return t.push(e.slice(p)),t}function E(e,t){if(typeof t!="function")throw new TypeError("ast-monkey-traverse/traverse(): [THROW_ID_01] The second argument must be a callback function. It was ".concat(typeof t,"."));let r={now:!1};function i(l,n,f,p){let o=l,c,u=A({depth:-1,path:""},f);if(u.depth+=1,Array.isArray(o))for(let a=0,d=o.length;a<d&&!p.now;a++){let m=u.path?"".concat(u.path,".").concat(a):"".concat(a);if(o[a]!==void 0){u.parent=k(o),u.parentType="array",u.parentKey=u.path?u.path.slice(u.path.lastIndexOf(".")+1):null;let s=o[a],h=n(s,void 0,C(A({},u),{path:m}),p);c=i(h===s?h:k(h),n,C(A({},u),{path:m}),p),Number.isNaN(c)&&a<o.length?(o.splice(a,1),a-=1):o[a]=c}else o.splice(a,1)}else if(U(o))for(let a in o){if(p.now&&a!=null)break;let d=u.path?"".concat(u.path,".").concat(a):a;u.depth===0&&a!=null&&(u.topmostKey=a),u.parent=k(o),u.parentType="object",u.parentKey=u.path?u.path.slice(u.path.lastIndexOf(".")+1):null;let m=o[a],s=n(a,m,C(A({},u),{path:d}),p);c=i(s===m?s:k(s),n,C(A({},u),{path:d}),p),Number.isNaN(c)?delete o[a]:o[a]=c}return o}return i(k(e),t,{},r)}var Y="6.2.1";var xe=Y,X=typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function $(e){let t=typeof e;return t==="string"||t==="number"}function ee(e,t,r){let i=e==="n"?"nativeToUnicode":"unicodeToNative";function l(o){return!(!$(o)||typeof o=="string"&&!/^\d*$/.test(o)||typeof o=="number"&&(!Number.isInteger(o)||o<0))}function n(o,c){let u=0,a=0;for(let d=0,m=o.length;d<m;d++){if(a+=o[d].length,c>=u&&c<a)return d;u+=o[d].length}throw new Error("string-convert-indexes/".concat(i,'(): [THROW_ID_01] the "indexes" value, ').concat(r,", is not covered by graphemes length!"))}function f(o,c){if(c>=o.length)throw new Error("string-convert-indexes/".concat(i,"(): [THROW_ID_02] the index to convert, ").concat(c,", is not covered by graphemes length!"));return o.slice(0,c).join("").length}if(typeof t!="string"||!t)throw new TypeError("string-convert-indexes/".concat(i,"(): [THROW_ID_03] the first input argument, input string, must be a non-zero-length string! Currently it's: ").concat(typeof t,", equal to:\n").concat(t));if(r===0)return 0;if(r==="0")return"0";let p=X?Array.from(X.segment(t),({segment:o})=>o):J(t);if($(r)){if(l(r))return e==="u"?typeof r=="string"?String(f(p,+r)):f(p,+r):typeof r=="string"?String(n(p,+r)):n(p,+r);throw new Error("string-convert-indexes/".concat(i,'(): [THROW_ID_04] the second input argument, "indexes" is not suitable to describe string index - it was given as ').concat(S(r,4)," (").concat(typeof r,")"))}else{if(r&&typeof r=="object")return e==="u"?E(r,(o,c,u)=>{let a=c!==void 0?c:o;if($(a)){if(l(a))return typeof a=="string"?String(f(p,+a)):f(p,+a);throw new Error("string-convert-indexes/".concat(i,"(): [THROW_ID_05] bad value was encountered, ").concat(S(a,4),", its path is ").concat(u.path))}return a}):E(r,(o,c,u)=>{let a=c!==void 0?c:o;if($(a)){if(l(a))return typeof a=="string"?String(n(p,+a)):n(p,+a);throw new Error("string-convert-indexes/".concat(i,"(): [THROW_ID_06] bad value was encountered, ").concat(S(a,4),", its path is ").concat(u.path))}return a});throw new Error("string-convert-indexes/".concat(i,"(): [THROW_ID_07] the first input argument, a source string should be a string but it was given as ").concat(t,", type ").concat(typeof t))}}function ve(e,t){return ee("n",e,t)}function Ae(e,t){return ee("u",e,t)}return ue(we);})();
|
|
10
|
+
"use strict";var stringConvertIndexes=(()=>{var $=Object.defineProperty,ve=Object.defineProperties,xe=Object.getOwnPropertyDescriptor,we=Object.getOwnPropertyDescriptors,Ae=Object.getOwnPropertyNames,N=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable;var L=(e,r,t)=>r in e?$(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,w=(e,r)=>{for(var t in r||(r={}))q.call(r,t)&&L(e,t,r[t]);if(N)for(var t of N(r))je.call(r,t)&&L(e,t,r[t]);return e},z=(e,r)=>ve(e,we(r));var ke=(e,r)=>{for(var t in r)$(e,t,{get:r[t],enumerable:!0})},Oe=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Ae(r))!q.call(e,i)&&i!==t&&$(e,i,{get:()=>r[i],enumerable:!(n=xe(r,i))||n.enumerable});return e};var De=e=>Oe($({},"__esModule",{value:!0}),e);var Ke={};ke(Ke,{nativeToUnicode:()=>ze,unicodeToNative:()=>Ve,version:()=>qe});function Ce(){let e=[],r=0,t=!1;return{append(n){return t?!1:r+n.length>1999?(e.push("\u2026"),r+=1,t=!0,!1):(e.push(n),r+=n.length,!0)},result(){return e.join("")},stopped(){return t}}}function Se(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function F(e,r){if(e.append('"')){for(let t=0;t<r.length&&!e.stopped();t+=1){let n=r.charCodeAt(t);n===34?e.append('\\"'):n===92?e.append("\\\\"):n===8?e.append("\\b"):n===9?e.append("\\t"):n===10?e.append("\\n"):n===12?e.append("\\f"):n===13?e.append("\\r"):n<32||n===8232||n===8233||n>=55296&&n<=57343?e.append(Se(n)):e.append(r[t])}e.append('"')}}function $e(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function K(e,r){e.append("Symbol(");let t=String(r);t.length>8&&F(e,t.slice(7,-1)),e.append(")")}function V(e,r){typeof r=="symbol"?K(e,r):F(e,String(r))}function C(e,r=0){let t=Ce(),n=r===4?4:0,i=new WeakSet,s=0;function _(c){n&&t.append(" ".repeat(c*n))}function u(c,g){c&&t.append(","),n&&(t.append("\n"),_(g+1))}function a(c,g,d){n&&g&&(t.append("\n"),_(d)),t.append(c)}function l(c,g){Object.prototype.hasOwnProperty.call(c,"value")?y(c.value,g):t.append($e(c))}function o(c,g){let d;try{d=Reflect.getOwnPropertyDescriptor(c,"length")}catch(m){t.append("[Uninspectable]");return}let b=d==null?void 0:d.value;if(!Number.isSafeInteger(b)||b<0){t.append("[Uninspectable]");return}t.append("[");let h=!1;for(let m=0;m<b&&!t.stopped();m+=1){if(u(h,g),h=!0,s>=50){t.append("[MaxEntries]");break}s+=1;let v;try{v=Reflect.getOwnPropertyDescriptor(c,String(m))}catch(I){t.append("[Uninspectable]");continue}v!=null&&v.enumerable?l(v,g+1):t.append("[Empty]")}a("]",h,g)}function f(c,g){let d;try{d=Reflect.ownKeys(c)}catch(h){t.append("[Uninspectable]");return}t.append("{");let b=!1;for(let h of d){if(t.stopped())break;if(s>=50){u(b,g),b=!0,F(t,"\u2026"),t.append(n?": ":":"),t.append("[MaxEntries]");break}s+=1;let m;try{m=Reflect.getOwnPropertyDescriptor(c,h)}catch(v){u(b,g),b=!0,V(t,h),t.append(n?": ":":"),t.append("[Uninspectable]");continue}m!=null&&m.enumerable&&(u(b,g),b=!0,V(t,h),t.append(n?": ":":"),l(m,g+1))}a("}",b,g)}function p(c,g){if(i.has(c)){t.append("[Circular]");return}if(g>=5){t.append("[MaxDepth]");return}let d;try{d=Array.isArray(c)}catch(b){t.append("[Uninspectable]");return}i.add(c);try{d?o(c,g):f(c,g)}finally{i.delete(c)}}function y(c,g){c===null?t.append("null"):typeof c=="string"?F(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"?K(t,c):typeof c=="function"?t.append("[Function]"):p(c,g)}try{return y(e,0),t.result()}catch(c){return"[Uninspectable]"}}var Fe=["_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(""),P=Fe.slice(1).split("_"),Ee=[],H=127;for(let e=0;e<P.length;e+=2){let r=H+1+Number.parseInt(P[e],36),t=r+Number.parseInt(P[e+1],36);Ee.push([r,t]),H=t}var Ze=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"]);var Re=Function.prototype.toString,Ye=Re.call(Object);var Xe=Map.prototype.entries,et=Set.prototype.values;var G,tt=(G=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:G.get,J,rt=(J=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:J.get,Q,nt=(Q=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:Q.get,Z,_t=(Z=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:Z.get,it=RegExp.prototype.test;var ot=Date.prototype.getTime;function Y(e,r,t){let n=e.length,i=0,s=0,_=-1,u=()=>{let a=0,l=0,o;do o=parseInt(e[i++],36),a+=(o&15)<<l,l+=4;while(o&16);return a};for(;i<n;){let a=_+1+u();t(a,_=a+u(),r?parseInt(r[s++],36):0)}}function X(e,r,t){let n=0,i=r.length-1;for(;n<=i;){let s=n+i>>>1,_=t[s];if(e<r[s])i=s-1;else if(e>_>>>5)n=s+1;else return _&31}return 0}var ee="090001000h1v5g2903000hl2v6jh16ng1s210111110o35aa10u2k1g10l6600152113h2010u1q1r5aq3890o13181214r22k3158q2n1000v100h1k20000001207030001160721k171001h1j11610332010010321210090411021c1c02100o301201412230u1130b100h1j116111420120411001100k11l10051001h1j11611142011000321210072411021d0g10r3000000132120090o200200g1j11f2012031213711271t1001o301001000001121371b1f0c101h1l2011001031212000080a1t1001m40400102101600i11t301006c7i601008b6p41r10101041h3d0004115a1j290p3q223000511010100g1501010302003172030c0010016000e0i6v50n40n5tl12ir33s12t11u11cj30100060700010a90t220000l71i20m7203010241000502rd101004k300000006101027050920g3t22bk1300616g209030207u18c1000t10003010501b2o20000102000004g37070101o921c000640602001mcv3rg20000001o16d0c0m1fg6g2h30m10q55f1vm11c0ma0p1a42nc0ne1a090q3314902021204020112030318250105bb1201110i1021i15101131502141b15120511011k1155132040202510201010603060a1f02040104210b1g3290e0e0kn11vs12j11j3040pp12t80g6v1qi2500c0r51ktl7319g21g51gh103040n11010040j51i3f01q1h1d0m27p1a0000cs13200523j200010301010100v140018a4q2501010101c08000i1f12601011g3012215110u1a0001015000pcq181000100011000iji5fvc0u91g5bhg20ie0l94lo6002115303121s12240la1tj23h44tj11t45m4ah33q700000l3ep2021a200t220301012040a0i320j2040007f00100r20c100g3208000011531000s520201036020t900207l1101n311000000321210090a12634b910201l22001051020120011020000e1i520701020000n10h5001050000010000010001re0010323010001r11i520701000001q6000000107l600000230004gg12080001lc62027111n1000411230000000000t820321030030r10090n205001380800501020n2050c0001mc00002000000nc006150000i5l1100600010001q753011160000i441111000000rl11019100000c1h201043102n10ltk1f006eoss2b0202gs94r36si2033ku101m373h50b1rqs4113sli1t22m1uh2435070726u13k92rr7m34h380e0m141egl561g1261114k60ga6nn10t33sv13uf1jf0207150qt16t66pr60n23k6bf1f0e1l29g71c1e029j1n30p11ea0k1028139m16rb2v621122i52213040tf1u3b51n17127c0232041d120819052c28220104060306l5g3l4572g130152cqdl2c3o37a5o27u11c32d9m2cu2191obo57eh9gg1tv3",te="262122424333333393233393339333333333393393bf3b3b3b3b3f3f3bffff33b3bb33ff3f33b3b3333333bffff3b33bb33f33bffff33b3bb33ff3f33b3bbb333b3ff33b333f33b3b3b3b3333b3bf33b3bb39333b33b33b3b3b333b333333b3b33333f3b33b3ffb3f3fff3f3b33f35dc33333f3b3b3b33323333b3bb3b33b3fb3b3333b33333bff3b3f33bfb3b3ff3b3b3b3b3b333b333b3323e224423444444444444444444444444444444444444444444444444444444444444444444444444444444433334433333333b3b3bb33333b353bff3b3b3b3f3ff3b3b333bfff3f33333fb3bb3fb3b3bb33232333f333fff333333333b3b3333bb3b39393f3b3fbf33bb3b393b3b3b3333b33b33b3bbb33b33ffff3b3333bb3933b3b3b333b3b3b3b3b33b3b3b33b3b3b33b3b33b33b3b3b3fffff3bb39b9b3b33b3bf3f3b33f3b3f93b33b3b3bb33b33b3b3b3333393b3b3b33b39bffb3b332333b333dd3b3333233332333333333333333333333333333444444444444a4444444444444344444444444444444444444444444444444444444444",re="0001000000010010000000100000000000000000000000000001000000010018000100000001001000010101100101100000000000000000000100000001111000010000000110101001110111111111000100000021001000010000000100100001000000011010000100000001111000014000000100180001000000010010";var ie=new Uint8Array(12448),oe=new Uint8Array(1440),le=new Uint8Array(2816),se,ae;{let e=(i,s,_,u,a)=>{let l=u-s+1,o=i.length;l>0&&_-s<o&&i.fill(a,_>s?_-s:0,l>o?o:l)},r=new Uint32Array(320),t=new Uint32Array(320),n=0;Y(ee,te,(i,s,_)=>{e(ie,0,i,s,_),e(oe,42592,i,s,_),e(le,126976,i,s,_),s>=65040&&!(i>=126976&&s<=129791)&&(r[n]=i,t[n++]=s<<5|_)}),se=r.slice(0,n),ae=t.slice(0,n)}function ne(e){return e<12448?ie[e]:e<42592?e===12951||e===12953?4:0:e<44032?oe[e-42592]:e<55204?(e-44032)%28?8:7:e>=126976&&e<129792?le[e-126976]:e>>>4===4064?3:Ie(e)}function Ie(e){return e<57344?e<=55238?e>=55216?13:0:e>=55243&&e<=55291?12:0:e<65024?e===64286?3:0:e>=917504?e>921599?0:e>=917536&&e<917632||e>=917760&&e<918e3?3:2:X(e,se,ae)}var Pe=Uint8Array.from(re);function Te(e){return e===2381||e===2509||e===2765||e===2893||e===3149||e===3405||e===4153||e===6098||e===6752||e===6980||e===7083||e===43456||e===43766||e===68159||e===69939||e===70608||e===71998||e===72263||e===72345||e===73538}function Be(e,r){return r===8204?e&21:e&8||Te(r)?e&21|40:e&21|32}function _e(e,r,t){return r===3?e&32?Be(e,t):e&21:r===4?17:r===10?e&2^3:r===14?(e&16)>>2|e&41:r===15?33:1}function ue(e){let r=[],t=e.length;if(t===0)return r;let n=e.codePointAt(0),i=n>65535?2:1,s=ne(n),_=_e(1,s,n),u=0;for(;i<t;){n=e.codePointAt(i);let a=ne(n),l=!(_&Pe[s<<4|a]);_=_e(_,a,n),l&&(r.push(e.slice(u,i)),u=i),i+=n>65535?2:1,s=a}return r.push(e.slice(u)),r}var ce=Symbol.for("ast-monkey-traverse.delete"),We=Object.prototype.hasOwnProperty;function A(e){throw new TypeError("ast-monkey-traverse/traverse(): [THROW_ID_02] The first argument must be an acyclic, unaliased tree of arrays, plain objects, and supported primitive values; ".concat(e,"."))}function Ue(e,r){let t=Number(e);return Number.isInteger(t)&&t>=0&&t<r&&"".concat(t)===e}function fe(e){return Array.isArray(e)?new Array(e.length):{}}function B(e,r,t){r==="__proto__"?Object.defineProperty(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}function W(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function pe(e,r=!1){if(W(e))return e;typeof e!="object"&&A("encountered an unsupported ".concat(typeof e," value"));let t=e,n=fe(t),i=[{source:t,target:n}],s=new WeakSet([t]);for(;i.length;){let _=i.pop(),{source:u,target:a}=_,l=Array.isArray(u);Object.getPrototypeOf(u)!==(l?Array.prototype:Object.prototype)&&A(l?"encountered an array with a custom prototype":"encountered a non-plain or custom-prototype object");for(let o of Reflect.ownKeys(u)){if(l&&o==="length")continue;typeof o!="string"&&A(l?"encountered a symbol-keyed array property":"encountered a symbol-keyed object property"),l&&!Ue(o,u.length)&&A("encountered the non-index array property ".concat(JSON.stringify(o)));let f=Object.getOwnPropertyDescriptor(u,o);f.enumerable||A(l?"encountered a non-enumerable array index ".concat(o):"encountered a non-enumerable property ".concat(JSON.stringify(o))),!("value"in f)&&!r&&A(l?"encountered an accessor array index ".concat(o):"encountered an accessor property ".concat(JSON.stringify(o)));let p="value"in f?f.value:u[o];if(W(p))B(a,o,p);else if(typeof p=="object"){s.has(p)&&A("encountered a cycle or repeated object reference"),s.add(p);let y=fe(p);B(a,o,y),i.push({source:p,target:y})}else A("encountered an unsupported ".concat(typeof p," value"))}}return n}var j=Symbol("deleted snapshot entry");function T(e){let r=w({array:Array.isArray(e),entries:new Map},Array.isArray(e)?{lengths:[{value:e.length,version:0}]}:{}),t=[{source:e,target:r}];for(;t.length;){let n=t.pop(),{source:i,target:s}=n;for(let _ of Object.keys(i)){let u=i[_];if(typeof u=="object"&&u!==null){let a=w({array:Array.isArray(u),entries:new Map},Array.isArray(u)?{lengths:[{value:u.length,version:0}]}:{});s.entries.set(_,[{value:a,version:0}]),t.push({source:u,target:a})}else s.entries.set(_,[{value:u,version:0}])}}return r}function de(e,r){let t=0,n=e.length-1;for(;t<n;){let i=Math.ceil((t+n)/2);e[i].version<=r?t=i:n=i-1}return e[t]}function S(e,r,t){let n=e.entries.get(r);return n?de(n,t).value:j}function U(e,r){return de(e.lengths,r).value}function E(e,r,t,n){let i=e.entries.get(r);i?i.push({value:t,version:n}):e.entries.set(r,[{value:j,version:n-1},{value:t,version:n}])}function Me(e,r,t){let n=t-1,i=U(e,n);for(let s=r;s<i-1;s+=1)E(e,"".concat(s),S(e,"".concat(s+1),n),t);i&&E(e,"".concat(i-1),j,t),e.lengths.push({value:Math.max(0,i-1),version:t})}function ge(e,r){let t=new WeakMap;function n(i){let s=t.get(i);if(s)return s;let _=i.array?new Array(U(i,r)):{},u={defineProperty:()=>!0,deleteProperty:()=>!0,get:(l,o,f)=>{if(i.array&&o==="length")return U(i,r);if(typeof o=="string"){let p=S(i,o,r);if(p!==j)return typeof p=="object"&&p!==null?n(p):p}return Reflect.get(l,o,f)},getOwnPropertyDescriptor:(l,o)=>{if(i.array&&o==="length")return Reflect.getOwnPropertyDescriptor(l,o);if(typeof o=="string"){let f=S(i,o,r);return f===j?void 0:{configurable:!0,enumerable:!0,value:typeof f=="object"&&f!==null?n(f):f,writable:!0}}},has:(l,o)=>typeof o=="string"&&S(i,o,r)!==j||Reflect.has(l,o),ownKeys:()=>{let l=[...i.entries].filter(([o])=>S(i,o,r)!==j).map(([o])=>o);return i.array?[...l,"length"]:l},set:()=>!0,setPrototypeOf:()=>!0},a=new Proxy(_,u);return t.set(i,a),a}return n(e)}function he(e){let r=[],t=e;for(;t;)r.push(t.segment),t=t.parent;return r.reverse()}function Ne(e){let r="";for(let t of e)r=r?"".concat(r,".").concat(t):t;return r}function M(e,r){if(typeof r!="function")throw new TypeError("ast-monkey-traverse/traverse(): [THROW_ID_01] The second argument must be a callback function. It was ".concat(typeof r,"."));let t=pe(e);if(typeof t!="object"||t===null)return t;let n=0,i={now:!1},s=[{container:t,depth:0,index:0,keys:Array.isArray(t)?[]:Object.keys(t),parentKey:null}];for(;s.length&&!i.now;){let _=s[s.length-1],u=Array.isArray(_.container)?_.container:void 0,a=!!u,l;if(u){if(_.index>=u.length){s.pop();continue}if(!We.call(u,_.index)){_.index+=1;continue}l="".concat(_.index)}else{if(_.index>=_.keys.length){s.pop();continue}l=_.keys[_.index]}let o=_.container[l],f={parent:_.pathNode,segment:l},p=_.depth===0&&!a?l:_.topmostKey,y,c=n,g,d,b;if(_.depth<100)g=_.path?"".concat(_.path,".").concat(l):l,d=_.pathSegments?[..._.pathSegments,l]:[l],b=w({depth:_.depth,path:g,pathSegments:d,get parent(){return _.snapshot||(_.snapshot=T(_.container)),y||(y=ge(_.snapshot,c)),y},parentType:a?"array":"object",parentKey:_.parentKey},p===void 0?{}:{topmostKey:p});else{let k,D;b=w({depth:_.depth,get path(){return k||(k=he(f)),D!=null||(D=Ne(k)),D},get pathSegments(){return k||(k=he(f)),k},get parent(){return _.snapshot||(_.snapshot=T(_.container)),y||(y=ge(_.snapshot,c)),y},parentType:a?"array":"object",parentKey:_.parentKey},p===void 0?{}:{topmostKey:p})}let h=r(a?o:l,a?void 0:o,b,i),m=h===ce,v=typeof h=="object"&&h!==null,I=v&&typeof o=="object"&&o!==null&&h===o&&!!_.snapshot,x=h===ce?o:h,O;!m&&!v&&!W(h)&&A("encountered an unsupported ".concat(typeof h," value")),!m&&v&&(h!==o||I)&&(x=pe(h,!0),_.snapshot&&(O=T(x))),m?u?(u.splice(_.index,1),n+=1,_.snapshot&&Me(_.snapshot,_.index,n)):(delete _.container[l],n+=1,_.snapshot&&E(_.snapshot,l,j,n),_.index+=1):((!Object.is(x,o)||I)&&(B(_.container,l,x),n+=1,_.snapshot&&E(_.snapshot,l,O===void 0?x:O,n)),_.index+=1,!i.now&&typeof x=="object"&&x!==null&&s.push(w(w(w(z(w({container:x,depth:_.depth+1,index:0,keys:Array.isArray(x)?[]:Object.keys(x),parentKey:l},g===void 0?{}:{path:g}),{pathNode:f}),d===void 0?{}:{pathSegments:d}),O?{snapshot:O}:{}),p===void 0?{}:{topmostKey:p})))}return t}var be="6.2.3";var qe=be,ye=typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function R(e){let r=typeof e;return r==="string"||r==="number"}function me(e,r,t){let n=e==="n"?"nativeToUnicode":"unicodeToNative";function i(a){return!(!R(a)||typeof a=="string"&&!/^\d*$/.test(a)||typeof a=="number"&&(!Number.isInteger(a)||a<0))}function s(a,l){let o=0,f=0;for(let p=0,y=a.length;p<y;p++){if(f+=a[p].length,l>=o&&l<f)return p;o+=a[p].length}throw new Error("string-convert-indexes/".concat(n,'(): [THROW_ID_01] the "indexes" value, ').concat(t,", is not covered by graphemes length!"))}function _(a,l){if(l>=a.length)throw new Error("string-convert-indexes/".concat(n,"(): [THROW_ID_02] the index to convert, ").concat(l,", is not covered by graphemes length!"));return a.slice(0,l).join("").length}if(typeof r!="string"||!r)throw new TypeError("string-convert-indexes/".concat(n,"(): [THROW_ID_03] the first input argument, input string, must be a non-zero-length string! Currently it's: ").concat(typeof r,", equal to:\n").concat(r));if(t===0)return 0;if(t==="0")return"0";let u=ye?Array.from(ye.segment(r),({segment:a})=>a):ue(r);if(R(t)){if(i(t))return e==="u"?typeof t=="string"?String(_(u,+t)):_(u,+t):typeof t=="string"?String(s(u,+t)):s(u,+t);throw new Error("string-convert-indexes/".concat(n,'(): [THROW_ID_04] the second input argument, "indexes" is not suitable to describe string index - it was given as ').concat(C(t,4)," (").concat(typeof t,")"))}else{if(t&&typeof t=="object")return e==="u"?M(t,(a,l,o)=>{let f=o.parentType==="object"?l:a;if(R(f)){if(i(f))return typeof f=="string"?String(_(u,+f)):_(u,+f);throw new Error("string-convert-indexes/".concat(n,"(): [THROW_ID_05] bad value was encountered, ").concat(C(f,4),", its path is ").concat(o.path))}return f}):M(t,(a,l,o)=>{let f=o.parentType==="object"?l:a;if(R(f)){if(i(f))return typeof f=="string"?String(s(u,+f)):s(u,+f);throw new Error("string-convert-indexes/".concat(n,"(): [THROW_ID_06] bad value was encountered, ").concat(C(f,4),", its path is ").concat(o.path))}return f});throw new Error("string-convert-indexes/".concat(n,"(): [THROW_ID_07] the first input argument, a source string should be a string but it was given as ").concat(r,", type ").concat(typeof r))}}function ze(e,r){return me("n",e,r)}function Ve(e,r){return me("u",e,r)}return De(Ke);})();
|
|
11
|
+
/**
|
|
12
|
+
* @name codsen-format-diagnostic-value
|
|
13
|
+
* @fileoverview Safely format untrusted JavaScript values for diagnostics
|
|
14
|
+
* @version 1.1.0
|
|
15
|
+
* @author Roy Revelt
|
|
16
|
+
* @license MIT
|
|
17
|
+
* {@link https://codsen.com/os/codsen-format-diagnostic-value/}
|
|
18
|
+
*/
|
|
11
19
|
/**
|
|
12
20
|
* @name codsen-utils
|
|
13
21
|
* @fileoverview Various utility functions
|
|
14
|
-
* @version 1.
|
|
22
|
+
* @version 1.10.0
|
|
15
23
|
* @author Roy Revelt
|
|
16
24
|
* @license MIT
|
|
17
25
|
* {@link https://codsen.com/os/codsen-utils/}
|
|
@@ -19,7 +27,7 @@
|
|
|
19
27
|
/**
|
|
20
28
|
* @name ast-monkey-traverse
|
|
21
29
|
* @fileoverview Utility library to traverse AST
|
|
22
|
-
* @version 4.
|
|
30
|
+
* @version 4.3.0
|
|
23
31
|
* @author Roy Revelt
|
|
24
32
|
* @license MIT
|
|
25
33
|
* {@link https://codsen.com/os/ast-monkey-traverse/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-convert-indexes",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.3",
|
|
4
4
|
"description": "Convert between native JS string character indexes and grapheme-count-based indexes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astral",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"various": {}
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"ast-monkey-traverse": "^4.
|
|
70
|
-
"codsen-utils": "^1.
|
|
69
|
+
"ast-monkey-traverse": "^4.3.0",
|
|
70
|
+
"codsen-utils": "^1.10.0",
|
|
71
71
|
"unicode-segmenter": "^0.17.3"
|
|
72
72
|
},
|
|
73
73
|
"engines": {
|