string-convert-indexes 5.0.5 → 5.0.11
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/LICENSE +1 -1
- package/README.md +4 -5
- package/dist/string-convert-indexes.esm.js +3 -83
- package/dist/string-convert-indexes.umd.js +13 -12
- package/examples/_quickTake.js +1 -0
- package/package.json +25 -79
- package/types/index.d.ts +0 -0
- package/examples/api.json +0 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2010-
|
|
3
|
+
Copyright (c) 2010-2022 Roy Revelt and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/README.md
CHANGED
|
@@ -26,18 +26,17 @@
|
|
|
26
26
|
|
|
27
27
|
## Install
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
The latest version is **ESM only**: Node 12+ is needed to use it and it must be `import`ed instead of `require`d. If your project is not on ESM yet and you want to use `require`, use an older version of this program, `4.1.0`.
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
npm i string-convert-indexes
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
If you need a legacy version which works with `require`, use version 4.1.0
|
|
36
|
-
|
|
37
35
|
## Quick Take
|
|
38
36
|
|
|
39
37
|
```js
|
|
40
38
|
import { strict as assert } from "assert";
|
|
39
|
+
|
|
41
40
|
import { nativeToUnicode, unicodeToNative } from "string-convert-indexes";
|
|
42
41
|
|
|
43
42
|
// CONVERTING NATIVE JS INDEXES TO UNICODE-CHAR-COUNT-BASED
|
|
@@ -76,7 +75,7 @@ assert.throws(() => unicodeToNative("\uD834\uDF06aa", [1, 0, 2, 3]));
|
|
|
76
75
|
|
|
77
76
|
## Documentation
|
|
78
77
|
|
|
79
|
-
Please [visit codsen.com](https://codsen.com/os/string-convert-indexes/) for a full description of the API
|
|
78
|
+
Please [visit codsen.com](https://codsen.com/os/string-convert-indexes/) for a full description of the API.
|
|
80
79
|
|
|
81
80
|
## Contributing
|
|
82
81
|
|
|
@@ -86,6 +85,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
86
85
|
|
|
87
86
|
MIT License
|
|
88
87
|
|
|
89
|
-
Copyright (c) 2010-
|
|
88
|
+
Copyright (c) 2010-2022 Roy Revelt and other contributors
|
|
90
89
|
|
|
91
90
|
<img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
|
|
@@ -1,91 +1,11 @@
|
|
|
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 5.0.
|
|
4
|
+
* @version 5.0.11
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-convert-indexes/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var version$1 = "5.0.5";
|
|
14
|
-
|
|
15
|
-
const version = version$1;
|
|
16
|
-
function strConvertIndexes(mode, str, indexes) {
|
|
17
|
-
function isItOk(something) {
|
|
18
|
-
if (!["string", "number"].includes(typeof something) || typeof something === "string" && !/^\d*$/.test(something) || typeof something === "number" && (!Number.isInteger(something) || something < 0)) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
function oneNativeToUnicode(graphemeStrArr, idx) {
|
|
24
|
-
let currLowerIdx = 0;
|
|
25
|
-
let currUpperIdx = 0;
|
|
26
|
-
for (let i = 0, len = graphemeStrArr.length; i < len; i++) {
|
|
27
|
-
currUpperIdx += graphemeStrArr[i].length;
|
|
28
|
-
if (idx >= currLowerIdx && idx < currUpperIdx) {
|
|
29
|
-
return i;
|
|
30
|
-
}
|
|
31
|
-
currLowerIdx += graphemeStrArr[i].length;
|
|
32
|
-
}
|
|
33
|
-
throw new Error(`string-convert-indexes: [THROW_ID_05] the "indexes" value, ${indexes}, is not covered by graphemes length!`);
|
|
34
|
-
}
|
|
35
|
-
function oneUnicodeToNative(graphemeStrArr, idx) {
|
|
36
|
-
if (idx >= graphemeStrArr.length) {
|
|
37
|
-
throw new Error(`string-convert-indexes: [THROW_ID_06] the index to convert, ${idx}, is not covered by graphemes length!`);
|
|
38
|
-
}
|
|
39
|
-
return graphemeStrArr.slice(0, idx).join("").length;
|
|
40
|
-
}
|
|
41
|
-
if (typeof str !== "string" || !str) {
|
|
42
|
-
throw new TypeError(`string-convert-indexes: [THROW_ID_01] the first input argument, input string, must be a non-zero-length string! Currently it's: ${typeof str}, equal to:\n${str}`);
|
|
43
|
-
}
|
|
44
|
-
if (indexes === 0) {
|
|
45
|
-
return 0;
|
|
46
|
-
}
|
|
47
|
-
if (indexes === "0") {
|
|
48
|
-
return "0";
|
|
49
|
-
}
|
|
50
|
-
const splitter = new GraphemeSplitter();
|
|
51
|
-
const graphemeStrArr = splitter.splitGraphemes(str);
|
|
52
|
-
if (["string", "number"].includes(typeof indexes)) {
|
|
53
|
-
if (isItOk(indexes)) {
|
|
54
|
-
if (mode === "u") {
|
|
55
|
-
return typeof indexes === "string" ? String(oneUnicodeToNative(graphemeStrArr, +indexes)) : oneUnicodeToNative(graphemeStrArr, +indexes);
|
|
56
|
-
}
|
|
57
|
-
return typeof indexes === "string" ? String(oneNativeToUnicode(graphemeStrArr, +indexes)) : oneNativeToUnicode(graphemeStrArr, +indexes);
|
|
58
|
-
}
|
|
59
|
-
throw new Error(`string-convert-indexes: [THROW_ID_02] the second input argument, "indexes" is not suitable to describe string index - it was given as ${JSON.stringify(indexes, null, 4)} (${typeof indexes})`);
|
|
60
|
-
} else if (indexes && typeof indexes === "object") {
|
|
61
|
-
return mode === "u" ? traverse(indexes, (key, val, innerObj) => {
|
|
62
|
-
const current = val !== undefined ? val : key;
|
|
63
|
-
if (["string", "number"].includes(typeof current)) {
|
|
64
|
-
if (isItOk(current)) {
|
|
65
|
-
return typeof current === "string" ? String(oneUnicodeToNative(graphemeStrArr, +current)) : oneUnicodeToNative(graphemeStrArr, +current);
|
|
66
|
-
}
|
|
67
|
-
throw new Error(`string-convert-indexes: [THROW_ID_03] bad value was encountered, ${JSON.stringify(current, null, 4)}, its path is ${innerObj.path}`);
|
|
68
|
-
}
|
|
69
|
-
return current;
|
|
70
|
-
}) : traverse(indexes, (key, val, innerObj) => {
|
|
71
|
-
const current = val !== undefined ? val : key;
|
|
72
|
-
if (["string", "number"].includes(typeof current)) {
|
|
73
|
-
if (isItOk(current)) {
|
|
74
|
-
return typeof current === "string" ? String(oneNativeToUnicode(graphemeStrArr, +current)) : oneNativeToUnicode(graphemeStrArr, +current);
|
|
75
|
-
}
|
|
76
|
-
throw new Error(`string-convert-indexes: [THROW_ID_04] bad value was encountered, ${JSON.stringify(current, null, 4)}, its path is ${innerObj.path}`);
|
|
77
|
-
}
|
|
78
|
-
return current;
|
|
79
|
-
});
|
|
80
|
-
} else {
|
|
81
|
-
throw new Error(`string-convert-indexes: [THROW_ID_07] the first input argument, a source string should be a string but it was given as ${str}, type ${typeof str}`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function nativeToUnicode(str, indexes) {
|
|
85
|
-
return strConvertIndexes("n", str, indexes);
|
|
86
|
-
}
|
|
87
|
-
function unicodeToNative(str, indexes) {
|
|
88
|
-
return strConvertIndexes("u", str, indexes);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export { nativeToUnicode, unicodeToNative, version };
|
|
10
|
+
import{traverse as d}from"ast-monkey-traverse";import m from"grapheme-splitter";var g="5.0.11";var I=g;function f(o,i,t){function a(r){return!(!["string","number"].includes(typeof r)||typeof r=="string"&&!/^\d*$/.test(r)||typeof r=="number"&&(!Number.isInteger(r)||r<0))}function l(r,n){let u=0,e=0;for(let c=0,y=r.length;c<y;c++){if(e+=r[c].length,n>=u&&n<e)return c;u+=r[c].length}throw new Error(`string-convert-indexes: [THROW_ID_05] the "indexes" value, ${t}, is not covered by graphemes length!`)}function p(r,n){if(n>=r.length)throw new Error(`string-convert-indexes: [THROW_ID_06] the index to convert, ${n}, is not covered by graphemes length!`);return r.slice(0,n).join("").length}if(typeof i!="string"||!i)throw new TypeError(`string-convert-indexes: [THROW_ID_01] the first input argument, input string, must be a non-zero-length string! Currently it's: ${typeof i}, equal to:
|
|
11
|
+
${i}`);if(t===0)return 0;if(t==="0")return"0";let s=new m().splitGraphemes(i);if(["string","number"].includes(typeof t)){if(a(t))return o==="u"?typeof t=="string"?String(p(s,+t)):p(s,+t):typeof t=="string"?String(l(s,+t)):l(s,+t);throw new Error(`string-convert-indexes: [THROW_ID_02] the second input argument, "indexes" is not suitable to describe string index - it was given as ${JSON.stringify(t,null,4)} (${typeof t})`)}else{if(t&&typeof t=="object")return o==="u"?d(t,(r,n,u)=>{let e=n!==void 0?n:r;if(["string","number"].includes(typeof e)){if(a(e))return typeof e=="string"?String(p(s,+e)):p(s,+e);throw new Error(`string-convert-indexes: [THROW_ID_03] bad value was encountered, ${JSON.stringify(e,null,4)}, its path is ${u.path}`)}return e}):d(t,(r,n,u)=>{let e=n!==void 0?n:r;if(["string","number"].includes(typeof e)){if(a(e))return typeof e=="string"?String(l(s,+e)):l(s,+e);throw new Error(`string-convert-indexes: [THROW_ID_04] bad value was encountered, ${JSON.stringify(e,null,4)}, its path is ${u.path}`)}return e});throw new Error(`string-convert-indexes: [THROW_ID_07] the first input argument, a source string should be a string but it was given as ${i}, type ${typeof i}`)}}function T(o,i){return f("n",o,i)}function _(o,i){return f("u",o,i)}export{T as nativeToUnicode,_ as unicodeToNative,I as version};
|
|
@@ -1,26 +1,27 @@
|
|
|
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 5.0.
|
|
4
|
+
* @version 5.0.11
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/string-convert-indexes/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).stringConvertIndexes={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r={exports:{}};!function(t,r){var n="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",u="[object Boolean]",c="[object Date]",a="[object Function]",f="[object GeneratorFunction]",s="[object Map]",l="[object Number]",p="[object Object]",h="[object Promise]",d="[object RegExp]",y="[object Set]",v="[object String]",g="[object Symbol]",_="[object WeakMap]",b="[object ArrayBuffer]",j="[object DataView]",w="[object Float32Array]",O="[object Float64Array]",x="[object Int8Array]",m="[object Int16Array]",A="[object Int32Array]",$="[object Uint8Array]",S="[object Uint8ClampedArray]",I="[object Uint16Array]",T="[object Uint32Array]",E=/\w*$/,N=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,k={};k[i]=k["[object Array]"]=k[b]=k[j]=k[u]=k[c]=k[w]=k[O]=k[x]=k[m]=k[A]=k[s]=k[l]=k[p]=k[d]=k[y]=k[v]=k[g]=k[$]=k[S]=k[I]=k[T]=!0,k["[object Error]"]=k[a]=k[_]=!1;var D="object"==typeof self&&self&&self.Object===Object&&self,P="object"==typeof e&&e&&e.Object===Object&&e||D||Function("return this")(),R=r&&!r.nodeType&&r,B=R&&t&&!t.nodeType&&t,W=B&&B.exports===R;function F(t,e){return t.set(e[0],e[1]),t}function H(t,e){return t.add(e),t}function U(t,e,r,n){var o=-1,i=t?t.length:0;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}function G(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function M(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function z(t,e){return function(r){return t(e(r))}}function J(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var K,L=Array.prototype,V=Function.prototype,q=Object.prototype,Q=P["__core-js_shared__"],X=(K=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"",Y=V.toString,Z=q.hasOwnProperty,tt=q.toString,et=RegExp("^"+Y.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=W?P.Buffer:void 0,nt=P.Symbol,ot=P.Uint8Array,it=z(Object.getPrototypeOf,Object),ut=Object.create,ct=q.propertyIsEnumerable,at=L.splice,ft=Object.getOwnPropertySymbols,st=rt?rt.isBuffer:void 0,lt=z(Object.keys,Object),pt=Bt(P,"DataView"),ht=Bt(P,"Map"),dt=Bt(P,"Promise"),yt=Bt(P,"Set"),vt=Bt(P,"WeakMap"),gt=Bt(Object,"create"),_t=Gt(pt),bt=Gt(ht),jt=Gt(dt),wt=Gt(yt),Ot=Gt(vt),xt=nt?nt.prototype:void 0,mt=xt?xt.valueOf:void 0;function At(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function $t(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function St(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function It(t){this.__data__=new $t(t)}function Tt(t,e){var r=zt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Jt(t)}(t)&&Z.call(t,"callee")&&(!ct.call(t,"callee")||tt.call(t)==i)}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var u in t)!e&&!Z.call(t,u)||o&&("length"==u||Ht(u,n))||r.push(u);return r}function Et(t,e,r){var n=t[e];Z.call(t,e)&&Mt(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function Nt(t,e){for(var r=t.length;r--;)if(Mt(t[r][0],e))return r;return-1}function Ct(t,e,r,n,o,h,_){var N;if(n&&(N=h?n(t,o,h,_):n(t)),void 0!==N)return N;if(!Vt(t))return t;var C=zt(t);if(C){if(N=function(t){var e=t.length,r=t.constructor(e);e&&"string"==typeof t[0]&&Z.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!e)return function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(t,N)}else{var D=Ft(t),P=D==a||D==f;if(Kt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if(D==p||D==i||P&&!h){if(G(t))return h?t:{};if(N=function(t){return"function"!=typeof t.constructor||Ut(t)?{}:(e=it(t),Vt(e)?ut(e):{});var e}(P?{}:t),!e)return function(t,e){return Pt(t,Wt(t),e)}(t,function(t,e){return t&&Pt(e,qt(e),t)}(N,t))}else{if(!k[D])return h?t:{};N=function(t,e,r,n){var o=t.constructor;switch(e){case b:return Dt(t);case u:case c:return new o(+t);case j:return function(t,e){var r=e?Dt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,n);case w:case O:case x:case m:case A:case $:case S:case I:case T:return function(t,e){var r=e?Dt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,n);case s:return function(t,e,r){return U(e?r(M(t),!0):M(t),F,new t.constructor)}(t,n,r);case l:case v:return new o(t);case d:return function(t){var e=new t.constructor(t.source,E.exec(t));return e.lastIndex=t.lastIndex,e}(t);case y:return function(t,e,r){return U(e?r(J(t),!0):J(t),H,new t.constructor)}(t,n,r);case g:return i=t,mt?Object(mt.call(i)):{}}var i}(t,D,Ct,e)}}_||(_=new It);var R=_.get(t);if(R)return R;if(_.set(t,N),!C)var B=r?function(t){return function(t,e,r){var n=e(t);return zt(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,qt,Wt)}(t):qt(t);return function(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r,t););}(B||t,(function(o,i){B&&(o=t[i=o]),Et(N,i,Ct(o,e,r,n,i,t,_))})),N}function kt(t){return!(!Vt(t)||(e=t,X&&X in e))&&(Lt(t)||G(t)?et:N).test(Gt(t));var e}function Dt(t){var e=new t.constructor(t.byteLength);return new ot(e).set(new ot(t)),e}function Pt(t,e,r,n){r||(r={});for(var o=-1,i=e.length;++o<i;){var u=e[o],c=n?n(r[u],t[u],u,r,t):void 0;Et(r,u,void 0===c?t[u]:c)}return r}function Rt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function Bt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return kt(r)?r:void 0}At.prototype.clear=function(){this.__data__=gt?gt(null):{}},At.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},At.prototype.get=function(t){var e=this.__data__;if(gt){var r=e[t];return r===n?void 0:r}return Z.call(e,t)?e[t]:void 0},At.prototype.has=function(t){var e=this.__data__;return gt?void 0!==e[t]:Z.call(e,t)},At.prototype.set=function(t,e){return this.__data__[t]=gt&&void 0===e?n:e,this},$t.prototype.clear=function(){this.__data__=[]},$t.prototype.delete=function(t){var e=this.__data__,r=Nt(e,t);return!(r<0)&&(r==e.length-1?e.pop():at.call(e,r,1),!0)},$t.prototype.get=function(t){var e=this.__data__,r=Nt(e,t);return r<0?void 0:e[r][1]},$t.prototype.has=function(t){return Nt(this.__data__,t)>-1},$t.prototype.set=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},St.prototype.clear=function(){this.__data__={hash:new At,map:new(ht||$t),string:new At}},St.prototype.delete=function(t){return Rt(this,t).delete(t)},St.prototype.get=function(t){return Rt(this,t).get(t)},St.prototype.has=function(t){return Rt(this,t).has(t)},St.prototype.set=function(t,e){return Rt(this,t).set(t,e),this},It.prototype.clear=function(){this.__data__=new $t},It.prototype.delete=function(t){return this.__data__.delete(t)},It.prototype.get=function(t){return this.__data__.get(t)},It.prototype.has=function(t){return this.__data__.has(t)},It.prototype.set=function(t,e){var r=this.__data__;if(r instanceof $t){var n=r.__data__;if(!ht||n.length<199)return n.push([t,e]),this;r=this.__data__=new St(n)}return r.set(t,e),this};var Wt=ft?z(ft,Object):function(){return[]},Ft=function(t){return tt.call(t)};function Ht(t,e){return!!(e=null==e?o:e)&&("number"==typeof t||C.test(t))&&t>-1&&t%1==0&&t<e}function Ut(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||q)}function Gt(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Mt(t,e){return t===e||t!=t&&e!=e}(pt&&Ft(new pt(new ArrayBuffer(1)))!=j||ht&&Ft(new ht)!=s||dt&&Ft(dt.resolve())!=h||yt&&Ft(new yt)!=y||vt&&Ft(new vt)!=_)&&(Ft=function(t){var e=tt.call(t),r=e==p?t.constructor:void 0,n=r?Gt(r):void 0;if(n)switch(n){case _t:return j;case bt:return s;case jt:return h;case wt:return y;case Ot:return _}return e});var zt=Array.isArray;function Jt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}(t.length)&&!Lt(t)}var Kt=st||function(){return!1};function Lt(t){var e=Vt(t)?tt.call(t):"";return e==a||e==f}function Vt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function qt(t){return Jt(t)?Tt(t):function(t){if(!Ut(t))return lt(t);var e=[];for(var r in Object(t))Z.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return Ct(t,!0,!0)}}(r,r.exports);var n=r.exports;var o,i,u=Object.prototype,c=Function.prototype.toString,a=u.hasOwnProperty,f=c.call(Object),s=u.toString,l=(o=Object.getPrototypeOf,i=Object,function(t){return o(i(t))});var p=function(t){if(!function(t){return!!t&&"object"==typeof t}(t)||"[object Object]"!=s.call(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t))return!1;var e=l(t);if(null===e)return!0;var r=a.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==f};
|
|
11
|
-
|
|
12
|
-
* @name ast-monkey-util
|
|
13
|
-
* @fileoverview Utility library of AST helper functions
|
|
14
|
-
* @version 2.0.5
|
|
15
|
-
* @author Roy Revelt, Codsen Ltd
|
|
16
|
-
* @license MIT
|
|
17
|
-
* {@link https://codsen.com/os/ast-monkey-util/}
|
|
18
|
-
*/function h(t){if(t.includes(".")){const e=t.lastIndexOf(".");if(!t.slice(0,e).includes("."))return t.slice(0,e);for(let r=e-1;r--;)if("."===t[r])return t.slice(r+1,e)}return null}
|
|
10
|
+
var stringConvertIndexes=(()=>{var $x=Object.create;var M=Object.defineProperty,Px=Object.defineProperties,Nx=Object.getOwnPropertyDescriptor,Rx=Object.getOwnPropertyDescriptors,Gx=Object.getOwnPropertyNames,w0=Object.getOwnPropertySymbols,Mx=Object.getPrototypeOf,O0=Object.prototype.hasOwnProperty,kx=Object.prototype.propertyIsEnumerable;var T0=(t,r,n)=>r in t?M(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,$=(t,r)=>{for(var n in r||(r={}))O0.call(r,n)&&T0(t,n,r[n]);if(w0)for(var n of w0(r))kx.call(r,n)&&T0(t,n,r[n]);return t},k=(t,r)=>Px(t,Rx(r)),S0=t=>M(t,"__esModule",{value:!0});var x0=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),Hx=(t,r)=>{for(var n in r)M(t,n,{get:r[n],enumerable:!0})},j0=(t,r,n,C)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Gx(r))!O0.call(t,i)&&(n||i!=="default")&&M(t,i,{get:()=>r[i],enumerable:!(C=Nx(r,i))||C.enumerable});return t},t0=(t,r)=>j0(S0(M(t!=null?$x(Mx(t)):{},"default",!r&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),Lx=(t=>(r,n)=>t&&t.get(r)||(n=j0(S0({}),r,1),t&&t.set(r,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var px=x0((U,G)=>{var Ux=200,I0="__lodash_hash_undefined__",$0=9007199254740991,r0="[object Arguments]",Vx="[object Array]",P0="[object Boolean]",N0="[object Date]",Kx="[object Error]",n0="[object Function]",R0="[object GeneratorFunction]",K="[object Map]",G0="[object Number]",C0="[object Object]",M0="[object Promise]",k0="[object RegExp]",W="[object Set]",H0="[object String]",L0="[object Symbol]",B0="[object WeakMap]",U0="[object ArrayBuffer]",J="[object DataView]",V0="[object Float32Array]",K0="[object Float64Array]",W0="[object Int8Array]",J0="[object Int16Array]",Z0="[object Int32Array]",q0="[object Uint8Array]",X0="[object Uint8ClampedArray]",Y0="[object Uint16Array]",Q0="[object Uint32Array]",Wx=/[\\^$.*+?()[\]{}|]/g,Jx=/\w*$/,Zx=/^\[object .+?Constructor\]$/,qx=/^(?:0|[1-9]\d*)$/,p={};p[r0]=p[Vx]=p[U0]=p[J]=p[P0]=p[N0]=p[V0]=p[K0]=p[W0]=p[J0]=p[Z0]=p[K]=p[G0]=p[C0]=p[k0]=p[W]=p[H0]=p[L0]=p[q0]=p[X0]=p[Y0]=p[Q0]=!0;p[Kx]=p[n0]=p[B0]=!1;var Xx=typeof global=="object"&&global&&global.Object===Object&&global,Yx=typeof self=="object"&&self&&self.Object===Object&&self,w=Xx||Yx||Function("return this")(),z0=typeof U=="object"&&U&&!U.nodeType&&U,e0=z0&&typeof G=="object"&&G&&!G.nodeType&&G,Qx=e0&&e0.exports===z0;function zx(t,r){return t.set(r[0],r[1]),t}function ex(t,r){return t.add(r),t}function ox(t,r){for(var n=-1,C=t?t.length:0;++n<C&&r(t[n],n,t)!==!1;);return t}function cx(t,r){for(var n=-1,C=r.length,i=t.length;++n<C;)t[i+n]=r[n];return t}function o0(t,r,n,C){var i=-1,E=t?t.length:0;for(C&&E&&(n=t[++i]);++i<E;)n=r(n,t[i],i,t);return n}function dx(t,r){for(var n=-1,C=Array(t);++n<t;)C[n]=r(n);return C}function x1(t,r){return t==null?void 0:t[r]}function c0(t){var r=!1;if(t!=null&&typeof t.toString!="function")try{r=!!(t+"")}catch(n){}return r}function d0(t){var r=-1,n=Array(t.size);return t.forEach(function(C,i){n[++r]=[i,C]}),n}function D0(t,r){return function(n){return t(r(n))}}function xx(t){var r=-1,n=Array(t.size);return t.forEach(function(C){n[++r]=C}),n}var t1=Array.prototype,r1=Function.prototype,Z=Object.prototype,i0=w["__core-js_shared__"],tx=function(){var t=/[^.]+$/.exec(i0&&i0.keys&&i0.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),rx=r1.toString,T=Z.hasOwnProperty,q=Z.toString,n1=RegExp("^"+rx.call(T).replace(Wx,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),nx=Qx?w.Buffer:void 0,Cx=w.Symbol,Bx=w.Uint8Array,C1=D0(Object.getPrototypeOf,Object),B1=Object.create,D1=Z.propertyIsEnumerable,i1=t1.splice,Dx=Object.getOwnPropertySymbols,A1=nx?nx.isBuffer:void 0,a1=D0(Object.keys,Object),A0=R(w,"DataView"),H=R(w,"Map"),a0=R(w,"Promise"),F0=R(w,"Set"),u0=R(w,"WeakMap"),L=R(Object,"create"),F1=I(A0),u1=I(H),s1=I(a0),f1=I(F0),E1=I(u0),ix=Cx?Cx.prototype:void 0,Ax=ix?ix.valueOf:void 0;function S(t){var r=-1,n=t?t.length:0;for(this.clear();++r<n;){var C=t[r];this.set(C[0],C[1])}}function l1(){this.__data__=L?L(null):{}}function p1(t){return this.has(t)&&delete this.__data__[t]}function h1(t){var r=this.__data__;if(L){var n=r[t];return n===I0?void 0:n}return T.call(r,t)?r[t]:void 0}function g1(t){var r=this.__data__;return L?r[t]!==void 0:T.call(r,t)}function y1(t,r){var n=this.__data__;return n[t]=L&&r===void 0?I0:r,this}S.prototype.clear=l1;S.prototype.delete=p1;S.prototype.get=h1;S.prototype.has=g1;S.prototype.set=y1;function O(t){var r=-1,n=t?t.length:0;for(this.clear();++r<n;){var C=t[r];this.set(C[0],C[1])}}function b1(){this.__data__=[]}function v1(t){var r=this.__data__,n=X(r,t);if(n<0)return!1;var C=r.length-1;return n==C?r.pop():i1.call(r,n,1),!0}function _1(t){var r=this.__data__,n=X(r,t);return n<0?void 0:r[n][1]}function m1(t){return X(this.__data__,t)>-1}function w1(t,r){var n=this.__data__,C=X(n,t);return C<0?n.push([t,r]):n[C][1]=r,this}O.prototype.clear=b1;O.prototype.delete=v1;O.prototype.get=_1;O.prototype.has=m1;O.prototype.set=w1;function P(t){var r=-1,n=t?t.length:0;for(this.clear();++r<n;){var C=t[r];this.set(C[0],C[1])}}function O1(){this.__data__={hash:new S,map:new(H||O),string:new S}}function T1(t){return Y(this,t).delete(t)}function S1(t){return Y(this,t).get(t)}function j1(t){return Y(this,t).has(t)}function I1(t,r){return Y(this,t).set(t,r),this}P.prototype.clear=O1;P.prototype.delete=T1;P.prototype.get=S1;P.prototype.has=j1;P.prototype.set=I1;function N(t){this.__data__=new O(t)}function $1(){this.__data__=new O}function P1(t){return this.__data__.delete(t)}function N1(t){return this.__data__.get(t)}function R1(t){return this.__data__.has(t)}function G1(t,r){var n=this.__data__;if(n instanceof O){var C=n.__data__;if(!H||C.length<Ux-1)return C.push([t,r]),this;n=this.__data__=new P(C)}return n.set(t,r),this}N.prototype.clear=$1;N.prototype.delete=P1;N.prototype.get=N1;N.prototype.has=R1;N.prototype.set=G1;function M1(t,r){var n=E0(t)||Bt(t)?dx(t.length,String):[],C=n.length,i=!!C;for(var E in t)(r||T.call(t,E))&&!(i&&(E=="length"||tt(E,C)))&&n.push(E);return n}function ax(t,r,n){var C=t[r];(!(T.call(t,r)&&fx(C,n))||n===void 0&&!(r in t))&&(t[r]=n)}function X(t,r){for(var n=t.length;n--;)if(fx(t[n][0],r))return n;return-1}function k1(t,r){return t&&Fx(r,l0(r),t)}function s0(t,r,n,C,i,E,g){var a;if(C&&(a=E?C(t,i,E,g):C(t)),a!==void 0)return a;if(!Q(t))return t;var D=E0(t);if(D){if(a=c1(t),!r)return z1(t,a)}else{var s=j(t),u=s==n0||s==R0;if(it(t))return W1(t,r);if(s==C0||s==r0||u&&!E){if(c0(t))return E?t:{};if(a=d1(u?{}:t),!r)return e1(t,k1(a,t))}else{if(!p[s])return E?t:{};a=xt(t,s,s0,r)}}g||(g=new N);var B=g.get(t);if(B)return B;if(g.set(t,a),!D)var y=n?o1(t):l0(t);return ox(y||t,function(b,_){y&&(_=b,b=t[_]),ax(a,_,s0(b,r,n,C,_,t,g))}),a}function H1(t){return Q(t)?B1(t):{}}function L1(t,r,n){var C=r(t);return E0(t)?C:cx(C,n(t))}function U1(t){return q.call(t)}function V1(t){if(!Q(t)||nt(t))return!1;var r=lx(t)||c0(t)?n1:Zx;return r.test(I(t))}function K1(t){if(!sx(t))return a1(t);var r=[];for(var n in Object(t))T.call(t,n)&&n!="constructor"&&r.push(n);return r}function W1(t,r){if(r)return t.slice();var n=new t.constructor(t.length);return t.copy(n),n}function f0(t){var r=new t.constructor(t.byteLength);return new Bx(r).set(new Bx(t)),r}function J1(t,r){var n=r?f0(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}function Z1(t,r,n){var C=r?n(d0(t),!0):d0(t);return o0(C,zx,new t.constructor)}function q1(t){var r=new t.constructor(t.source,Jx.exec(t));return r.lastIndex=t.lastIndex,r}function X1(t,r,n){var C=r?n(xx(t),!0):xx(t);return o0(C,ex,new t.constructor)}function Y1(t){return Ax?Object(Ax.call(t)):{}}function Q1(t,r){var n=r?f0(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function z1(t,r){var n=-1,C=t.length;for(r||(r=Array(C));++n<C;)r[n]=t[n];return r}function Fx(t,r,n,C){n||(n={});for(var i=-1,E=r.length;++i<E;){var g=r[i],a=C?C(n[g],t[g],g,n,t):void 0;ax(n,g,a===void 0?t[g]:a)}return n}function e1(t,r){return Fx(t,ux(t),r)}function o1(t){return L1(t,l0,ux)}function Y(t,r){var n=t.__data__;return rt(r)?n[typeof r=="string"?"string":"hash"]:n.map}function R(t,r){var n=x1(t,r);return V1(n)?n:void 0}var ux=Dx?D0(Dx,Object):Ft,j=U1;(A0&&j(new A0(new ArrayBuffer(1)))!=J||H&&j(new H)!=K||a0&&j(a0.resolve())!=M0||F0&&j(new F0)!=W||u0&&j(new u0)!=B0)&&(j=function(t){var r=q.call(t),n=r==C0?t.constructor:void 0,C=n?I(n):void 0;if(C)switch(C){case F1:return J;case u1:return K;case s1:return M0;case f1:return W;case E1:return B0}return r});function c1(t){var r=t.length,n=t.constructor(r);return r&&typeof t[0]=="string"&&T.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function d1(t){return typeof t.constructor=="function"&&!sx(t)?H1(C1(t)):{}}function xt(t,r,n,C){var i=t.constructor;switch(r){case U0:return f0(t);case P0:case N0:return new i(+t);case J:return J1(t,C);case V0:case K0:case W0:case J0:case Z0:case q0:case X0:case Y0:case Q0:return Q1(t,C);case K:return Z1(t,C,n);case G0:case H0:return new i(t);case k0:return q1(t);case W:return X1(t,C,n);case L0:return Y1(t)}}function tt(t,r){return r=r==null?$0:r,!!r&&(typeof t=="number"||qx.test(t))&&t>-1&&t%1==0&&t<r}function rt(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}function nt(t){return!!tx&&tx in t}function sx(t){var r=t&&t.constructor,n=typeof r=="function"&&r.prototype||Z;return t===n}function I(t){if(t!=null){try{return rx.call(t)}catch(r){}try{return t+""}catch(r){}}return""}function Ct(t){return s0(t,!0,!0)}function fx(t,r){return t===r||t!==t&&r!==r}function Bt(t){return Dt(t)&&T.call(t,"callee")&&(!D1.call(t,"callee")||q.call(t)==r0)}var E0=Array.isArray;function Ex(t){return t!=null&&At(t.length)&&!lx(t)}function Dt(t){return at(t)&&Ex(t)}var it=A1||ut;function lx(t){var r=Q(t)?q.call(t):"";return r==n0||r==R0}function At(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=$0}function Q(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function at(t){return!!t&&typeof t=="object"}function l0(t){return Ex(t)?M1(t):K1(t)}function Ft(){return[]}function ut(){return!1}G.exports=Ct});var bx=x0(($t,yx)=>{var st="[object Object]";function ft(t){var r=!1;if(t!=null&&typeof t.toString!="function")try{r=!!(t+"")}catch(n){}return r}function Et(t,r){return function(n){return t(r(n))}}var lt=Function.prototype,hx=Object.prototype,gx=lt.toString,pt=hx.hasOwnProperty,ht=gx.call(Object),gt=hx.toString,yt=Et(Object.getPrototypeOf,Object);function bt(t){return!!t&&typeof t=="object"}function vt(t){if(!bt(t)||gt.call(t)!=st||ft(t))return!1;var r=yt(t);if(r===null)return!0;var n=pt.call(r,"constructor")&&r.constructor;return typeof n=="function"&&n instanceof n&&gx.call(n)==ht}yx.exports=vt});var _x=x0((Gt,e)=>{function mt(){var t=0,r=1,n=2,C=3,i=4,E=5,g=6,a=7,D=8,s=9,u=10,B=11,y=12,b=13,_=14,o=15,g0=16,V=17,v=0,c=1,d=2,Tx=3,Sx=4;function jx(x,A){return 55296<=x.charCodeAt(A)&&x.charCodeAt(A)<=56319&&56320<=x.charCodeAt(A+1)&&x.charCodeAt(A+1)<=57343}function y0(x,A){A===void 0&&(A=0);var l=x.charCodeAt(A);if(55296<=l&&l<=56319&&A<x.length-1){var F=l,f=x.charCodeAt(A+1);return 56320<=f&&f<=57343?(F-55296)*1024+(f-56320)+65536:F}if(56320<=l&&l<=57343&&A>=1){var F=x.charCodeAt(A-1),f=l;return 55296<=F&&F<=56319?(F-55296)*1024+(f-56320)+65536:f}return l}function Ix(x,A,l){var F=[x].concat(A).concat([l]),f=F[F.length-2],h=l,v0=F.lastIndexOf(_);if(v0>1&&F.slice(1,v0).every(function(m){return m==C})&&[C,b,V].indexOf(x)==-1)return d;var _0=F.lastIndexOf(i);if(_0>0&&F.slice(1,_0).every(function(m){return m==i})&&[y,i].indexOf(f)==-1)return F.filter(function(m){return m==i}).length%2==1?Tx:Sx;if(f==t&&h==r)return v;if(f==n||f==t||f==r)return h==_&&A.every(function(m){return m==C})?d:c;if(h==n||h==t||h==r)return c;if(f==g&&(h==g||h==a||h==s||h==u))return v;if((f==s||f==a)&&(h==a||h==D))return v;if((f==u||f==D)&&h==D)return v;if(h==C||h==o)return v;if(h==E)return v;if(f==y)return v;var m0=F.indexOf(C)!=-1?F.lastIndexOf(C)-1:F.length-2;return[b,V].indexOf(F[m0])!=-1&&F.slice(m0+1,-1).every(function(m){return m==C})&&h==_||f==o&&[g0,V].indexOf(h)!=-1?v:A.indexOf(i)!=-1?d:f==i&&h==i?v:c}this.nextBreak=function(x,A){if(A===void 0&&(A=0),A<0)return 0;if(A>=x.length-1)return x.length;for(var l=b0(y0(x,A)),F=[],f=A+1;f<x.length;f++)if(!jx(x,f-1)){var h=b0(y0(x,f));if(Ix(l,F,h))return f;F.push(h)}return x.length},this.splitGraphemes=function(x){for(var A=[],l=0,F;(F=this.nextBreak(x,l))<x.length;)A.push(x.slice(l,F)),l=F;return l<x.length&&A.push(x.slice(l)),A},this.iterateGraphemes=function(x){var A=0,l={next:function(){var F,f;return(f=this.nextBreak(x,A))<x.length?(F=x.slice(A,f),A=f,{value:F,done:!1}):A<x.length?(F=x.slice(A),A=x.length,{value:F,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol!="undefined"&&Symbol.iterator&&(l[Symbol.iterator]=function(){return l}),l},this.countGraphemes=function(x){for(var A=0,l=0,F;(F=this.nextBreak(x,l))<x.length;)l=F,A++;return l<x.length&&A++,A};function b0(x){return 1536<=x&&x<=1541||x==1757||x==1807||x==2274||x==3406||x==69821||70082<=x&&x<=70083||x==72250||72326<=x&&x<=72329||x==73030?y:x==13?t:x==10?r:0<=x&&x<=9||11<=x&&x<=12||14<=x&&x<=31||127<=x&&x<=159||x==173||x==1564||x==6158||x==8203||8206<=x&&x<=8207||x==8232||x==8233||8234<=x&&x<=8238||8288<=x&&x<=8292||x==8293||8294<=x&&x<=8303||55296<=x&&x<=57343||x==65279||65520<=x&&x<=65528||65529<=x&&x<=65531||113824<=x&&x<=113827||119155<=x&&x<=119162||x==917504||x==917505||917506<=x&&x<=917535||917632<=x&&x<=917759||918e3<=x&&x<=921599?n:768<=x&&x<=879||1155<=x&&x<=1159||1160<=x&&x<=1161||1425<=x&&x<=1469||x==1471||1473<=x&&x<=1474||1476<=x&&x<=1477||x==1479||1552<=x&&x<=1562||1611<=x&&x<=1631||x==1648||1750<=x&&x<=1756||1759<=x&&x<=1764||1767<=x&&x<=1768||1770<=x&&x<=1773||x==1809||1840<=x&&x<=1866||1958<=x&&x<=1968||2027<=x&&x<=2035||2070<=x&&x<=2073||2075<=x&&x<=2083||2085<=x&&x<=2087||2089<=x&&x<=2093||2137<=x&&x<=2139||2260<=x&&x<=2273||2275<=x&&x<=2306||x==2362||x==2364||2369<=x&&x<=2376||x==2381||2385<=x&&x<=2391||2402<=x&&x<=2403||x==2433||x==2492||x==2494||2497<=x&&x<=2500||x==2509||x==2519||2530<=x&&x<=2531||2561<=x&&x<=2562||x==2620||2625<=x&&x<=2626||2631<=x&&x<=2632||2635<=x&&x<=2637||x==2641||2672<=x&&x<=2673||x==2677||2689<=x&&x<=2690||x==2748||2753<=x&&x<=2757||2759<=x&&x<=2760||x==2765||2786<=x&&x<=2787||2810<=x&&x<=2815||x==2817||x==2876||x==2878||x==2879||2881<=x&&x<=2884||x==2893||x==2902||x==2903||2914<=x&&x<=2915||x==2946||x==3006||x==3008||x==3021||x==3031||x==3072||3134<=x&&x<=3136||3142<=x&&x<=3144||3146<=x&&x<=3149||3157<=x&&x<=3158||3170<=x&&x<=3171||x==3201||x==3260||x==3263||x==3266||x==3270||3276<=x&&x<=3277||3285<=x&&x<=3286||3298<=x&&x<=3299||3328<=x&&x<=3329||3387<=x&&x<=3388||x==3390||3393<=x&&x<=3396||x==3405||x==3415||3426<=x&&x<=3427||x==3530||x==3535||3538<=x&&x<=3540||x==3542||x==3551||x==3633||3636<=x&&x<=3642||3655<=x&&x<=3662||x==3761||3764<=x&&x<=3769||3771<=x&&x<=3772||3784<=x&&x<=3789||3864<=x&&x<=3865||x==3893||x==3895||x==3897||3953<=x&&x<=3966||3968<=x&&x<=3972||3974<=x&&x<=3975||3981<=x&&x<=3991||3993<=x&&x<=4028||x==4038||4141<=x&&x<=4144||4146<=x&&x<=4151||4153<=x&&x<=4154||4157<=x&&x<=4158||4184<=x&&x<=4185||4190<=x&&x<=4192||4209<=x&&x<=4212||x==4226||4229<=x&&x<=4230||x==4237||x==4253||4957<=x&&x<=4959||5906<=x&&x<=5908||5938<=x&&x<=5940||5970<=x&&x<=5971||6002<=x&&x<=6003||6068<=x&&x<=6069||6071<=x&&x<=6077||x==6086||6089<=x&&x<=6099||x==6109||6155<=x&&x<=6157||6277<=x&&x<=6278||x==6313||6432<=x&&x<=6434||6439<=x&&x<=6440||x==6450||6457<=x&&x<=6459||6679<=x&&x<=6680||x==6683||x==6742||6744<=x&&x<=6750||x==6752||x==6754||6757<=x&&x<=6764||6771<=x&&x<=6780||x==6783||6832<=x&&x<=6845||x==6846||6912<=x&&x<=6915||x==6964||6966<=x&&x<=6970||x==6972||x==6978||7019<=x&&x<=7027||7040<=x&&x<=7041||7074<=x&&x<=7077||7080<=x&&x<=7081||7083<=x&&x<=7085||x==7142||7144<=x&&x<=7145||x==7149||7151<=x&&x<=7153||7212<=x&&x<=7219||7222<=x&&x<=7223||7376<=x&&x<=7378||7380<=x&&x<=7392||7394<=x&&x<=7400||x==7405||x==7412||7416<=x&&x<=7417||7616<=x&&x<=7673||7675<=x&&x<=7679||x==8204||8400<=x&&x<=8412||8413<=x&&x<=8416||x==8417||8418<=x&&x<=8420||8421<=x&&x<=8432||11503<=x&&x<=11505||x==11647||11744<=x&&x<=11775||12330<=x&&x<=12333||12334<=x&&x<=12335||12441<=x&&x<=12442||x==42607||42608<=x&&x<=42610||42612<=x&&x<=42621||42654<=x&&x<=42655||42736<=x&&x<=42737||x==43010||x==43014||x==43019||43045<=x&&x<=43046||43204<=x&&x<=43205||43232<=x&&x<=43249||43302<=x&&x<=43309||43335<=x&&x<=43345||43392<=x&&x<=43394||x==43443||43446<=x&&x<=43449||x==43452||x==43493||43561<=x&&x<=43566||43569<=x&&x<=43570||43573<=x&&x<=43574||x==43587||x==43596||x==43644||x==43696||43698<=x&&x<=43700||43703<=x&&x<=43704||43710<=x&&x<=43711||x==43713||43756<=x&&x<=43757||x==43766||x==44005||x==44008||x==44013||x==64286||65024<=x&&x<=65039||65056<=x&&x<=65071||65438<=x&&x<=65439||x==66045||x==66272||66422<=x&&x<=66426||68097<=x&&x<=68099||68101<=x&&x<=68102||68108<=x&&x<=68111||68152<=x&&x<=68154||x==68159||68325<=x&&x<=68326||x==69633||69688<=x&&x<=69702||69759<=x&&x<=69761||69811<=x&&x<=69814||69817<=x&&x<=69818||69888<=x&&x<=69890||69927<=x&&x<=69931||69933<=x&&x<=69940||x==70003||70016<=x&&x<=70017||70070<=x&&x<=70078||70090<=x&&x<=70092||70191<=x&&x<=70193||x==70196||70198<=x&&x<=70199||x==70206||x==70367||70371<=x&&x<=70378||70400<=x&&x<=70401||x==70460||x==70462||x==70464||x==70487||70502<=x&&x<=70508||70512<=x&&x<=70516||70712<=x&&x<=70719||70722<=x&&x<=70724||x==70726||x==70832||70835<=x&&x<=70840||x==70842||x==70845||70847<=x&&x<=70848||70850<=x&&x<=70851||x==71087||71090<=x&&x<=71093||71100<=x&&x<=71101||71103<=x&&x<=71104||71132<=x&&x<=71133||71219<=x&&x<=71226||x==71229||71231<=x&&x<=71232||x==71339||x==71341||71344<=x&&x<=71349||x==71351||71453<=x&&x<=71455||71458<=x&&x<=71461||71463<=x&&x<=71467||72193<=x&&x<=72198||72201<=x&&x<=72202||72243<=x&&x<=72248||72251<=x&&x<=72254||x==72263||72273<=x&&x<=72278||72281<=x&&x<=72283||72330<=x&&x<=72342||72344<=x&&x<=72345||72752<=x&&x<=72758||72760<=x&&x<=72765||x==72767||72850<=x&&x<=72871||72874<=x&&x<=72880||72882<=x&&x<=72883||72885<=x&&x<=72886||73009<=x&&x<=73014||x==73018||73020<=x&&x<=73021||73023<=x&&x<=73029||x==73031||92912<=x&&x<=92916||92976<=x&&x<=92982||94095<=x&&x<=94098||113821<=x&&x<=113822||x==119141||119143<=x&&x<=119145||119150<=x&&x<=119154||119163<=x&&x<=119170||119173<=x&&x<=119179||119210<=x&&x<=119213||119362<=x&&x<=119364||121344<=x&&x<=121398||121403<=x&&x<=121452||x==121461||x==121476||121499<=x&&x<=121503||121505<=x&&x<=121519||122880<=x&&x<=122886||122888<=x&&x<=122904||122907<=x&&x<=122913||122915<=x&&x<=122916||122918<=x&&x<=122922||125136<=x&&x<=125142||125252<=x&&x<=125258||917536<=x&&x<=917631||917760<=x&&x<=917999?C:127462<=x&&x<=127487?i:x==2307||x==2363||2366<=x&&x<=2368||2377<=x&&x<=2380||2382<=x&&x<=2383||2434<=x&&x<=2435||2495<=x&&x<=2496||2503<=x&&x<=2504||2507<=x&&x<=2508||x==2563||2622<=x&&x<=2624||x==2691||2750<=x&&x<=2752||x==2761||2763<=x&&x<=2764||2818<=x&&x<=2819||x==2880||2887<=x&&x<=2888||2891<=x&&x<=2892||x==3007||3009<=x&&x<=3010||3014<=x&&x<=3016||3018<=x&&x<=3020||3073<=x&&x<=3075||3137<=x&&x<=3140||3202<=x&&x<=3203||x==3262||3264<=x&&x<=3265||3267<=x&&x<=3268||3271<=x&&x<=3272||3274<=x&&x<=3275||3330<=x&&x<=3331||3391<=x&&x<=3392||3398<=x&&x<=3400||3402<=x&&x<=3404||3458<=x&&x<=3459||3536<=x&&x<=3537||3544<=x&&x<=3550||3570<=x&&x<=3571||x==3635||x==3763||3902<=x&&x<=3903||x==3967||x==4145||4155<=x&&x<=4156||4182<=x&&x<=4183||x==4228||x==6070||6078<=x&&x<=6085||6087<=x&&x<=6088||6435<=x&&x<=6438||6441<=x&&x<=6443||6448<=x&&x<=6449||6451<=x&&x<=6456||6681<=x&&x<=6682||x==6741||x==6743||6765<=x&&x<=6770||x==6916||x==6965||x==6971||6973<=x&&x<=6977||6979<=x&&x<=6980||x==7042||x==7073||7078<=x&&x<=7079||x==7082||x==7143||7146<=x&&x<=7148||x==7150||7154<=x&&x<=7155||7204<=x&&x<=7211||7220<=x&&x<=7221||x==7393||7410<=x&&x<=7411||x==7415||43043<=x&&x<=43044||x==43047||43136<=x&&x<=43137||43188<=x&&x<=43203||43346<=x&&x<=43347||x==43395||43444<=x&&x<=43445||43450<=x&&x<=43451||43453<=x&&x<=43456||43567<=x&&x<=43568||43571<=x&&x<=43572||x==43597||x==43755||43758<=x&&x<=43759||x==43765||44003<=x&&x<=44004||44006<=x&&x<=44007||44009<=x&&x<=44010||x==44012||x==69632||x==69634||x==69762||69808<=x&&x<=69810||69815<=x&&x<=69816||x==69932||x==70018||70067<=x&&x<=70069||70079<=x&&x<=70080||70188<=x&&x<=70190||70194<=x&&x<=70195||x==70197||70368<=x&&x<=70370||70402<=x&&x<=70403||x==70463||70465<=x&&x<=70468||70471<=x&&x<=70472||70475<=x&&x<=70477||70498<=x&&x<=70499||70709<=x&&x<=70711||70720<=x&&x<=70721||x==70725||70833<=x&&x<=70834||x==70841||70843<=x&&x<=70844||x==70846||x==70849||71088<=x&&x<=71089||71096<=x&&x<=71099||x==71102||71216<=x&&x<=71218||71227<=x&&x<=71228||x==71230||x==71340||71342<=x&&x<=71343||x==71350||71456<=x&&x<=71457||x==71462||72199<=x&&x<=72200||x==72249||72279<=x&&x<=72280||x==72343||x==72751||x==72766||x==72873||x==72881||x==72884||94033<=x&&x<=94078||x==119142||x==119149?E:4352<=x&&x<=4447||43360<=x&&x<=43388?g:4448<=x&&x<=4519||55216<=x&&x<=55238?a:4520<=x&&x<=4607||55243<=x&&x<=55291?D:x==44032||x==44060||x==44088||x==44116||x==44144||x==44172||x==44200||x==44228||x==44256||x==44284||x==44312||x==44340||x==44368||x==44396||x==44424||x==44452||x==44480||x==44508||x==44536||x==44564||x==44592||x==44620||x==44648||x==44676||x==44704||x==44732||x==44760||x==44788||x==44816||x==44844||x==44872||x==44900||x==44928||x==44956||x==44984||x==45012||x==45040||x==45068||x==45096||x==45124||x==45152||x==45180||x==45208||x==45236||x==45264||x==45292||x==45320||x==45348||x==45376||x==45404||x==45432||x==45460||x==45488||x==45516||x==45544||x==45572||x==45600||x==45628||x==45656||x==45684||x==45712||x==45740||x==45768||x==45796||x==45824||x==45852||x==45880||x==45908||x==45936||x==45964||x==45992||x==46020||x==46048||x==46076||x==46104||x==46132||x==46160||x==46188||x==46216||x==46244||x==46272||x==46300||x==46328||x==46356||x==46384||x==46412||x==46440||x==46468||x==46496||x==46524||x==46552||x==46580||x==46608||x==46636||x==46664||x==46692||x==46720||x==46748||x==46776||x==46804||x==46832||x==46860||x==46888||x==46916||x==46944||x==46972||x==47e3||x==47028||x==47056||x==47084||x==47112||x==47140||x==47168||x==47196||x==47224||x==47252||x==47280||x==47308||x==47336||x==47364||x==47392||x==47420||x==47448||x==47476||x==47504||x==47532||x==47560||x==47588||x==47616||x==47644||x==47672||x==47700||x==47728||x==47756||x==47784||x==47812||x==47840||x==47868||x==47896||x==47924||x==47952||x==47980||x==48008||x==48036||x==48064||x==48092||x==48120||x==48148||x==48176||x==48204||x==48232||x==48260||x==48288||x==48316||x==48344||x==48372||x==48400||x==48428||x==48456||x==48484||x==48512||x==48540||x==48568||x==48596||x==48624||x==48652||x==48680||x==48708||x==48736||x==48764||x==48792||x==48820||x==48848||x==48876||x==48904||x==48932||x==48960||x==48988||x==49016||x==49044||x==49072||x==49100||x==49128||x==49156||x==49184||x==49212||x==49240||x==49268||x==49296||x==49324||x==49352||x==49380||x==49408||x==49436||x==49464||x==49492||x==49520||x==49548||x==49576||x==49604||x==49632||x==49660||x==49688||x==49716||x==49744||x==49772||x==49800||x==49828||x==49856||x==49884||x==49912||x==49940||x==49968||x==49996||x==50024||x==50052||x==50080||x==50108||x==50136||x==50164||x==50192||x==50220||x==50248||x==50276||x==50304||x==50332||x==50360||x==50388||x==50416||x==50444||x==50472||x==50500||x==50528||x==50556||x==50584||x==50612||x==50640||x==50668||x==50696||x==50724||x==50752||x==50780||x==50808||x==50836||x==50864||x==50892||x==50920||x==50948||x==50976||x==51004||x==51032||x==51060||x==51088||x==51116||x==51144||x==51172||x==51200||x==51228||x==51256||x==51284||x==51312||x==51340||x==51368||x==51396||x==51424||x==51452||x==51480||x==51508||x==51536||x==51564||x==51592||x==51620||x==51648||x==51676||x==51704||x==51732||x==51760||x==51788||x==51816||x==51844||x==51872||x==51900||x==51928||x==51956||x==51984||x==52012||x==52040||x==52068||x==52096||x==52124||x==52152||x==52180||x==52208||x==52236||x==52264||x==52292||x==52320||x==52348||x==52376||x==52404||x==52432||x==52460||x==52488||x==52516||x==52544||x==52572||x==52600||x==52628||x==52656||x==52684||x==52712||x==52740||x==52768||x==52796||x==52824||x==52852||x==52880||x==52908||x==52936||x==52964||x==52992||x==53020||x==53048||x==53076||x==53104||x==53132||x==53160||x==53188||x==53216||x==53244||x==53272||x==53300||x==53328||x==53356||x==53384||x==53412||x==53440||x==53468||x==53496||x==53524||x==53552||x==53580||x==53608||x==53636||x==53664||x==53692||x==53720||x==53748||x==53776||x==53804||x==53832||x==53860||x==53888||x==53916||x==53944||x==53972||x==54e3||x==54028||x==54056||x==54084||x==54112||x==54140||x==54168||x==54196||x==54224||x==54252||x==54280||x==54308||x==54336||x==54364||x==54392||x==54420||x==54448||x==54476||x==54504||x==54532||x==54560||x==54588||x==54616||x==54644||x==54672||x==54700||x==54728||x==54756||x==54784||x==54812||x==54840||x==54868||x==54896||x==54924||x==54952||x==54980||x==55008||x==55036||x==55064||x==55092||x==55120||x==55148||x==55176?s:44033<=x&&x<=44059||44061<=x&&x<=44087||44089<=x&&x<=44115||44117<=x&&x<=44143||44145<=x&&x<=44171||44173<=x&&x<=44199||44201<=x&&x<=44227||44229<=x&&x<=44255||44257<=x&&x<=44283||44285<=x&&x<=44311||44313<=x&&x<=44339||44341<=x&&x<=44367||44369<=x&&x<=44395||44397<=x&&x<=44423||44425<=x&&x<=44451||44453<=x&&x<=44479||44481<=x&&x<=44507||44509<=x&&x<=44535||44537<=x&&x<=44563||44565<=x&&x<=44591||44593<=x&&x<=44619||44621<=x&&x<=44647||44649<=x&&x<=44675||44677<=x&&x<=44703||44705<=x&&x<=44731||44733<=x&&x<=44759||44761<=x&&x<=44787||44789<=x&&x<=44815||44817<=x&&x<=44843||44845<=x&&x<=44871||44873<=x&&x<=44899||44901<=x&&x<=44927||44929<=x&&x<=44955||44957<=x&&x<=44983||44985<=x&&x<=45011||45013<=x&&x<=45039||45041<=x&&x<=45067||45069<=x&&x<=45095||45097<=x&&x<=45123||45125<=x&&x<=45151||45153<=x&&x<=45179||45181<=x&&x<=45207||45209<=x&&x<=45235||45237<=x&&x<=45263||45265<=x&&x<=45291||45293<=x&&x<=45319||45321<=x&&x<=45347||45349<=x&&x<=45375||45377<=x&&x<=45403||45405<=x&&x<=45431||45433<=x&&x<=45459||45461<=x&&x<=45487||45489<=x&&x<=45515||45517<=x&&x<=45543||45545<=x&&x<=45571||45573<=x&&x<=45599||45601<=x&&x<=45627||45629<=x&&x<=45655||45657<=x&&x<=45683||45685<=x&&x<=45711||45713<=x&&x<=45739||45741<=x&&x<=45767||45769<=x&&x<=45795||45797<=x&&x<=45823||45825<=x&&x<=45851||45853<=x&&x<=45879||45881<=x&&x<=45907||45909<=x&&x<=45935||45937<=x&&x<=45963||45965<=x&&x<=45991||45993<=x&&x<=46019||46021<=x&&x<=46047||46049<=x&&x<=46075||46077<=x&&x<=46103||46105<=x&&x<=46131||46133<=x&&x<=46159||46161<=x&&x<=46187||46189<=x&&x<=46215||46217<=x&&x<=46243||46245<=x&&x<=46271||46273<=x&&x<=46299||46301<=x&&x<=46327||46329<=x&&x<=46355||46357<=x&&x<=46383||46385<=x&&x<=46411||46413<=x&&x<=46439||46441<=x&&x<=46467||46469<=x&&x<=46495||46497<=x&&x<=46523||46525<=x&&x<=46551||46553<=x&&x<=46579||46581<=x&&x<=46607||46609<=x&&x<=46635||46637<=x&&x<=46663||46665<=x&&x<=46691||46693<=x&&x<=46719||46721<=x&&x<=46747||46749<=x&&x<=46775||46777<=x&&x<=46803||46805<=x&&x<=46831||46833<=x&&x<=46859||46861<=x&&x<=46887||46889<=x&&x<=46915||46917<=x&&x<=46943||46945<=x&&x<=46971||46973<=x&&x<=46999||47001<=x&&x<=47027||47029<=x&&x<=47055||47057<=x&&x<=47083||47085<=x&&x<=47111||47113<=x&&x<=47139||47141<=x&&x<=47167||47169<=x&&x<=47195||47197<=x&&x<=47223||47225<=x&&x<=47251||47253<=x&&x<=47279||47281<=x&&x<=47307||47309<=x&&x<=47335||47337<=x&&x<=47363||47365<=x&&x<=47391||47393<=x&&x<=47419||47421<=x&&x<=47447||47449<=x&&x<=47475||47477<=x&&x<=47503||47505<=x&&x<=47531||47533<=x&&x<=47559||47561<=x&&x<=47587||47589<=x&&x<=47615||47617<=x&&x<=47643||47645<=x&&x<=47671||47673<=x&&x<=47699||47701<=x&&x<=47727||47729<=x&&x<=47755||47757<=x&&x<=47783||47785<=x&&x<=47811||47813<=x&&x<=47839||47841<=x&&x<=47867||47869<=x&&x<=47895||47897<=x&&x<=47923||47925<=x&&x<=47951||47953<=x&&x<=47979||47981<=x&&x<=48007||48009<=x&&x<=48035||48037<=x&&x<=48063||48065<=x&&x<=48091||48093<=x&&x<=48119||48121<=x&&x<=48147||48149<=x&&x<=48175||48177<=x&&x<=48203||48205<=x&&x<=48231||48233<=x&&x<=48259||48261<=x&&x<=48287||48289<=x&&x<=48315||48317<=x&&x<=48343||48345<=x&&x<=48371||48373<=x&&x<=48399||48401<=x&&x<=48427||48429<=x&&x<=48455||48457<=x&&x<=48483||48485<=x&&x<=48511||48513<=x&&x<=48539||48541<=x&&x<=48567||48569<=x&&x<=48595||48597<=x&&x<=48623||48625<=x&&x<=48651||48653<=x&&x<=48679||48681<=x&&x<=48707||48709<=x&&x<=48735||48737<=x&&x<=48763||48765<=x&&x<=48791||48793<=x&&x<=48819||48821<=x&&x<=48847||48849<=x&&x<=48875||48877<=x&&x<=48903||48905<=x&&x<=48931||48933<=x&&x<=48959||48961<=x&&x<=48987||48989<=x&&x<=49015||49017<=x&&x<=49043||49045<=x&&x<=49071||49073<=x&&x<=49099||49101<=x&&x<=49127||49129<=x&&x<=49155||49157<=x&&x<=49183||49185<=x&&x<=49211||49213<=x&&x<=49239||49241<=x&&x<=49267||49269<=x&&x<=49295||49297<=x&&x<=49323||49325<=x&&x<=49351||49353<=x&&x<=49379||49381<=x&&x<=49407||49409<=x&&x<=49435||49437<=x&&x<=49463||49465<=x&&x<=49491||49493<=x&&x<=49519||49521<=x&&x<=49547||49549<=x&&x<=49575||49577<=x&&x<=49603||49605<=x&&x<=49631||49633<=x&&x<=49659||49661<=x&&x<=49687||49689<=x&&x<=49715||49717<=x&&x<=49743||49745<=x&&x<=49771||49773<=x&&x<=49799||49801<=x&&x<=49827||49829<=x&&x<=49855||49857<=x&&x<=49883||49885<=x&&x<=49911||49913<=x&&x<=49939||49941<=x&&x<=49967||49969<=x&&x<=49995||49997<=x&&x<=50023||50025<=x&&x<=50051||50053<=x&&x<=50079||50081<=x&&x<=50107||50109<=x&&x<=50135||50137<=x&&x<=50163||50165<=x&&x<=50191||50193<=x&&x<=50219||50221<=x&&x<=50247||50249<=x&&x<=50275||50277<=x&&x<=50303||50305<=x&&x<=50331||50333<=x&&x<=50359||50361<=x&&x<=50387||50389<=x&&x<=50415||50417<=x&&x<=50443||50445<=x&&x<=50471||50473<=x&&x<=50499||50501<=x&&x<=50527||50529<=x&&x<=50555||50557<=x&&x<=50583||50585<=x&&x<=50611||50613<=x&&x<=50639||50641<=x&&x<=50667||50669<=x&&x<=50695||50697<=x&&x<=50723||50725<=x&&x<=50751||50753<=x&&x<=50779||50781<=x&&x<=50807||50809<=x&&x<=50835||50837<=x&&x<=50863||50865<=x&&x<=50891||50893<=x&&x<=50919||50921<=x&&x<=50947||50949<=x&&x<=50975||50977<=x&&x<=51003||51005<=x&&x<=51031||51033<=x&&x<=51059||51061<=x&&x<=51087||51089<=x&&x<=51115||51117<=x&&x<=51143||51145<=x&&x<=51171||51173<=x&&x<=51199||51201<=x&&x<=51227||51229<=x&&x<=51255||51257<=x&&x<=51283||51285<=x&&x<=51311||51313<=x&&x<=51339||51341<=x&&x<=51367||51369<=x&&x<=51395||51397<=x&&x<=51423||51425<=x&&x<=51451||51453<=x&&x<=51479||51481<=x&&x<=51507||51509<=x&&x<=51535||51537<=x&&x<=51563||51565<=x&&x<=51591||51593<=x&&x<=51619||51621<=x&&x<=51647||51649<=x&&x<=51675||51677<=x&&x<=51703||51705<=x&&x<=51731||51733<=x&&x<=51759||51761<=x&&x<=51787||51789<=x&&x<=51815||51817<=x&&x<=51843||51845<=x&&x<=51871||51873<=x&&x<=51899||51901<=x&&x<=51927||51929<=x&&x<=51955||51957<=x&&x<=51983||51985<=x&&x<=52011||52013<=x&&x<=52039||52041<=x&&x<=52067||52069<=x&&x<=52095||52097<=x&&x<=52123||52125<=x&&x<=52151||52153<=x&&x<=52179||52181<=x&&x<=52207||52209<=x&&x<=52235||52237<=x&&x<=52263||52265<=x&&x<=52291||52293<=x&&x<=52319||52321<=x&&x<=52347||52349<=x&&x<=52375||52377<=x&&x<=52403||52405<=x&&x<=52431||52433<=x&&x<=52459||52461<=x&&x<=52487||52489<=x&&x<=52515||52517<=x&&x<=52543||52545<=x&&x<=52571||52573<=x&&x<=52599||52601<=x&&x<=52627||52629<=x&&x<=52655||52657<=x&&x<=52683||52685<=x&&x<=52711||52713<=x&&x<=52739||52741<=x&&x<=52767||52769<=x&&x<=52795||52797<=x&&x<=52823||52825<=x&&x<=52851||52853<=x&&x<=52879||52881<=x&&x<=52907||52909<=x&&x<=52935||52937<=x&&x<=52963||52965<=x&&x<=52991||52993<=x&&x<=53019||53021<=x&&x<=53047||53049<=x&&x<=53075||53077<=x&&x<=53103||53105<=x&&x<=53131||53133<=x&&x<=53159||53161<=x&&x<=53187||53189<=x&&x<=53215||53217<=x&&x<=53243||53245<=x&&x<=53271||53273<=x&&x<=53299||53301<=x&&x<=53327||53329<=x&&x<=53355||53357<=x&&x<=53383||53385<=x&&x<=53411||53413<=x&&x<=53439||53441<=x&&x<=53467||53469<=x&&x<=53495||53497<=x&&x<=53523||53525<=x&&x<=53551||53553<=x&&x<=53579||53581<=x&&x<=53607||53609<=x&&x<=53635||53637<=x&&x<=53663||53665<=x&&x<=53691||53693<=x&&x<=53719||53721<=x&&x<=53747||53749<=x&&x<=53775||53777<=x&&x<=53803||53805<=x&&x<=53831||53833<=x&&x<=53859||53861<=x&&x<=53887||53889<=x&&x<=53915||53917<=x&&x<=53943||53945<=x&&x<=53971||53973<=x&&x<=53999||54001<=x&&x<=54027||54029<=x&&x<=54055||54057<=x&&x<=54083||54085<=x&&x<=54111||54113<=x&&x<=54139||54141<=x&&x<=54167||54169<=x&&x<=54195||54197<=x&&x<=54223||54225<=x&&x<=54251||54253<=x&&x<=54279||54281<=x&&x<=54307||54309<=x&&x<=54335||54337<=x&&x<=54363||54365<=x&&x<=54391||54393<=x&&x<=54419||54421<=x&&x<=54447||54449<=x&&x<=54475||54477<=x&&x<=54503||54505<=x&&x<=54531||54533<=x&&x<=54559||54561<=x&&x<=54587||54589<=x&&x<=54615||54617<=x&&x<=54643||54645<=x&&x<=54671||54673<=x&&x<=54699||54701<=x&&x<=54727||54729<=x&&x<=54755||54757<=x&&x<=54783||54785<=x&&x<=54811||54813<=x&&x<=54839||54841<=x&&x<=54867||54869<=x&&x<=54895||54897<=x&&x<=54923||54925<=x&&x<=54951||54953<=x&&x<=54979||54981<=x&&x<=55007||55009<=x&&x<=55035||55037<=x&&x<=55063||55065<=x&&x<=55091||55093<=x&&x<=55119||55121<=x&&x<=55147||55149<=x&&x<=55175||55177<=x&&x<=55203?u:x==9757||x==9977||9994<=x&&x<=9997||x==127877||127938<=x&&x<=127940||x==127943||127946<=x&&x<=127948||128066<=x&&x<=128067||128070<=x&&x<=128080||x==128110||128112<=x&&x<=128120||x==128124||128129<=x&&x<=128131||128133<=x&&x<=128135||x==128170||128372<=x&&x<=128373||x==128378||x==128400||128405<=x&&x<=128406||128581<=x&&x<=128583||128587<=x&&x<=128591||x==128675||128692<=x&&x<=128694||x==128704||x==128716||129304<=x&&x<=129308||129310<=x&&x<=129311||x==129318||129328<=x&&x<=129337||129341<=x&&x<=129342||129489<=x&&x<=129501?b:127995<=x&&x<=127999?_:x==8205?o:x==9792||x==9794||9877<=x&&x<=9878||x==9992||x==10084||x==127752||x==127806||x==127859||x==127891||x==127908||x==127912||x==127979||x==127981||x==128139||128187<=x&&x<=128188||x==128295||x==128300||x==128488||x==128640||x==128658?g0:128102<=x&&x<=128105?V:B}return this}typeof e!="undefined"&&e.exports&&(e.exports=mt)});var jt={};Hx(jt,{nativeToUnicode:()=>Tt,unicodeToNative:()=>St,version:()=>Ot});var z=t0(px(),1),vx=t0(bx(),1);function _t(t){if(t.includes(".")){let r=t.lastIndexOf(".");if(!t.slice(0,r).includes("."))return t.slice(0,r);for(let n=r-1;n--;)if(t[n]===".")return t.slice(n+1,r)}return null}var p0=_t;function h0(t,r){let n={now:!1};function C(i,E,g,a){let D=(0,z.default)(i),s,u=$({depth:-1,path:""},g);if(u.depth+=1,Array.isArray(D))for(let B=0,y=D.length;B<y&&!a.now;B++){let b=u.path?`${u.path}.${B}`:`${B}`;D[B]!==void 0?(u.parent=(0,z.default)(D),u.parentType="array",u.parentKey=p0(b),s=C(E(D[B],void 0,k($({},u),{path:b}),a),E,k($({},u),{path:b}),a),Number.isNaN(s)&&B<D.length?(D.splice(B,1),B-=1):D[B]=s):D.splice(B,1)}else if((0,vx.default)(D))for(let B in D){if(a.now&&B!=null)break;let y=u.path?`${u.path}.${B}`:B;u.depth===0&&B!=null&&(u.topmostKey=B),u.parent=(0,z.default)(D),u.parentType="object",u.parentKey=p0(y),s=C(E(B,D[B],k($({},u),{path:y}),a),E,k($({},u),{path:y}),a),Number.isNaN(s)?delete D[B]:D[B]=s}return D}return C(t,r,{},n)}var wx=t0(_x(),1);var mx="5.0.11";var Ot=mx;function Ox(t,r,n){function C(D){return!(!["string","number"].includes(typeof D)||typeof D=="string"&&!/^\d*$/.test(D)||typeof D=="number"&&(!Number.isInteger(D)||D<0))}function i(D,s){let u=0,B=0;for(let y=0,b=D.length;y<b;y++){if(B+=D[y].length,s>=u&&s<B)return y;u+=D[y].length}throw new Error(`string-convert-indexes: [THROW_ID_05] the "indexes" value, ${n}, is not covered by graphemes length!`)}function E(D,s){if(s>=D.length)throw new Error(`string-convert-indexes: [THROW_ID_06] the index to convert, ${s}, is not covered by graphemes length!`);return D.slice(0,s).join("").length}if(typeof r!="string"||!r)throw new TypeError(`string-convert-indexes: [THROW_ID_01] 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 a=new wx.default().splitGraphemes(r);if(["string","number"].includes(typeof n)){if(C(n))return t==="u"?typeof n=="string"?String(E(a,+n)):E(a,+n):typeof n=="string"?String(i(a,+n)):i(a,+n);throw new Error(`string-convert-indexes: [THROW_ID_02] the second input argument, "indexes" is not suitable to describe string index - it was given as ${JSON.stringify(n,null,4)} (${typeof n})`)}else{if(n&&typeof n=="object")return t==="u"?h0(n,(D,s,u)=>{let B=s!==void 0?s:D;if(["string","number"].includes(typeof B)){if(C(B))return typeof B=="string"?String(E(a,+B)):E(a,+B);throw new Error(`string-convert-indexes: [THROW_ID_03] bad value was encountered, ${JSON.stringify(B,null,4)}, its path is ${u.path}`)}return B}):h0(n,(D,s,u)=>{let B=s!==void 0?s:D;if(["string","number"].includes(typeof B)){if(C(B))return typeof B=="string"?String(i(a,+B)):i(a,+B);throw new Error(`string-convert-indexes: [THROW_ID_04] bad value was encountered, ${JSON.stringify(B,null,4)}, its path is ${u.path}`)}return B});throw new Error(`string-convert-indexes: [THROW_ID_07] the first input argument, a source string should be a string but it was given as ${r}, type ${typeof r}`)}}function Tt(t,r){return Ox("n",t,r)}function St(t,r){return Ox("u",t,r)}return Lx(jt);})();
|
|
19
12
|
/**
|
|
20
13
|
* @name ast-monkey-traverse
|
|
21
14
|
* @fileoverview Utility library to traverse AST
|
|
22
|
-
* @version 3.0.
|
|
15
|
+
* @version 3.0.11
|
|
23
16
|
* @author Roy Revelt, Codsen Ltd
|
|
24
17
|
* @license MIT
|
|
25
18
|
* {@link https://codsen.com/os/ast-monkey-traverse/}
|
|
26
|
-
*/function d(t,e){return function t(e,r,o,i){const u=n(e);let c;const a={depth:-1,path:"",...o};if(a.depth+=1,Array.isArray(u))for(let e=0,o=u.length;e<o&&!i.now;e++){const o=a.path?`${a.path}.${e}`:`${e}`;void 0!==u[e]?(a.parent=n(u),a.parentType="array",a.parentKey=h(o),c=t(r(u[e],void 0,{...a,path:o},i),r,{...a,path:o},i),Number.isNaN(c)&&e<u.length?(u.splice(e,1),e-=1):u[e]=c):u.splice(e,1)}else if(p(u))for(const e in u){if(i.now&&null!=e)break;const o=a.path?`${a.path}.${e}`:e;0===a.depth&&null!=e&&(a.topmostKey=e),a.parent=n(u),a.parentType="object",a.parentKey=h(o),c=t(r(e,u[e],{...a,path:o},i),r,{...a,path:o},i),Number.isNaN(c)?delete u[e]:u[e]=c}return u}(t,e,{},{now:!1})}var y={exports:{}};!function(t){t.exports&&(t.exports=function(){var t=3,e=4,r=12,n=13,o=16,i=17;function u(t,e){void 0===e&&(e=0);var r=t.charCodeAt(e);if(55296<=r&&r<=56319&&e<t.length-1){var n=r;return 56320<=(o=t.charCodeAt(e+1))&&o<=57343?1024*(n-55296)+(o-56320)+65536:n}if(56320<=r&&r<=57343&&e>=1){var o=r;return 55296<=(n=t.charCodeAt(e-1))&&n<=56319?1024*(n-55296)+(o-56320)+65536:o}return r}function c(u,c,a){var f=[u].concat(c).concat([a]),s=f[f.length-2],l=a,p=f.lastIndexOf(14);if(p>1&&f.slice(1,p).every((function(e){return e==t}))&&-1==[t,n,i].indexOf(u))return 2;var h=f.lastIndexOf(e);if(h>0&&f.slice(1,h).every((function(t){return t==e}))&&-1==[r,e].indexOf(s))return f.filter((function(t){return t==e})).length%2==1?3:4;if(0==s&&1==l)return 0;if(2==s||0==s||1==s)return 14==l&&c.every((function(e){return e==t}))?2:1;if(2==l||0==l||1==l)return 1;if(6==s&&(6==l||7==l||9==l||10==l))return 0;if(!(9!=s&&7!=s||7!=l&&8!=l))return 0;if((10==s||8==s)&&8==l)return 0;if(l==t||15==l)return 0;if(5==l)return 0;if(s==r)return 0;var d=-1!=f.indexOf(t)?f.lastIndexOf(t)-1:f.length-2;return-1!=[n,i].indexOf(f[d])&&f.slice(d+1,-1).every((function(e){return e==t}))&&14==l||15==s&&-1!=[o,i].indexOf(l)?0:-1!=c.indexOf(e)?2:s==e&&l==e?0:1}function a(u){return 1536<=u&&u<=1541||1757==u||1807==u||2274==u||3406==u||69821==u||70082<=u&&u<=70083||72250==u||72326<=u&&u<=72329||73030==u?r:13==u?0:10==u?1:0<=u&&u<=9||11<=u&&u<=12||14<=u&&u<=31||127<=u&&u<=159||173==u||1564==u||6158==u||8203==u||8206<=u&&u<=8207||8232==u||8233==u||8234<=u&&u<=8238||8288<=u&&u<=8292||8293==u||8294<=u&&u<=8303||55296<=u&&u<=57343||65279==u||65520<=u&&u<=65528||65529<=u&&u<=65531||113824<=u&&u<=113827||119155<=u&&u<=119162||917504==u||917505==u||917506<=u&&u<=917535||917632<=u&&u<=917759||918e3<=u&&u<=921599?2:768<=u&&u<=879||1155<=u&&u<=1159||1160<=u&&u<=1161||1425<=u&&u<=1469||1471==u||1473<=u&&u<=1474||1476<=u&&u<=1477||1479==u||1552<=u&&u<=1562||1611<=u&&u<=1631||1648==u||1750<=u&&u<=1756||1759<=u&&u<=1764||1767<=u&&u<=1768||1770<=u&&u<=1773||1809==u||1840<=u&&u<=1866||1958<=u&&u<=1968||2027<=u&&u<=2035||2070<=u&&u<=2073||2075<=u&&u<=2083||2085<=u&&u<=2087||2089<=u&&u<=2093||2137<=u&&u<=2139||2260<=u&&u<=2273||2275<=u&&u<=2306||2362==u||2364==u||2369<=u&&u<=2376||2381==u||2385<=u&&u<=2391||2402<=u&&u<=2403||2433==u||2492==u||2494==u||2497<=u&&u<=2500||2509==u||2519==u||2530<=u&&u<=2531||2561<=u&&u<=2562||2620==u||2625<=u&&u<=2626||2631<=u&&u<=2632||2635<=u&&u<=2637||2641==u||2672<=u&&u<=2673||2677==u||2689<=u&&u<=2690||2748==u||2753<=u&&u<=2757||2759<=u&&u<=2760||2765==u||2786<=u&&u<=2787||2810<=u&&u<=2815||2817==u||2876==u||2878==u||2879==u||2881<=u&&u<=2884||2893==u||2902==u||2903==u||2914<=u&&u<=2915||2946==u||3006==u||3008==u||3021==u||3031==u||3072==u||3134<=u&&u<=3136||3142<=u&&u<=3144||3146<=u&&u<=3149||3157<=u&&u<=3158||3170<=u&&u<=3171||3201==u||3260==u||3263==u||3266==u||3270==u||3276<=u&&u<=3277||3285<=u&&u<=3286||3298<=u&&u<=3299||3328<=u&&u<=3329||3387<=u&&u<=3388||3390==u||3393<=u&&u<=3396||3405==u||3415==u||3426<=u&&u<=3427||3530==u||3535==u||3538<=u&&u<=3540||3542==u||3551==u||3633==u||3636<=u&&u<=3642||3655<=u&&u<=3662||3761==u||3764<=u&&u<=3769||3771<=u&&u<=3772||3784<=u&&u<=3789||3864<=u&&u<=3865||3893==u||3895==u||3897==u||3953<=u&&u<=3966||3968<=u&&u<=3972||3974<=u&&u<=3975||3981<=u&&u<=3991||3993<=u&&u<=4028||4038==u||4141<=u&&u<=4144||4146<=u&&u<=4151||4153<=u&&u<=4154||4157<=u&&u<=4158||4184<=u&&u<=4185||4190<=u&&u<=4192||4209<=u&&u<=4212||4226==u||4229<=u&&u<=4230||4237==u||4253==u||4957<=u&&u<=4959||5906<=u&&u<=5908||5938<=u&&u<=5940||5970<=u&&u<=5971||6002<=u&&u<=6003||6068<=u&&u<=6069||6071<=u&&u<=6077||6086==u||6089<=u&&u<=6099||6109==u||6155<=u&&u<=6157||6277<=u&&u<=6278||6313==u||6432<=u&&u<=6434||6439<=u&&u<=6440||6450==u||6457<=u&&u<=6459||6679<=u&&u<=6680||6683==u||6742==u||6744<=u&&u<=6750||6752==u||6754==u||6757<=u&&u<=6764||6771<=u&&u<=6780||6783==u||6832<=u&&u<=6845||6846==u||6912<=u&&u<=6915||6964==u||6966<=u&&u<=6970||6972==u||6978==u||7019<=u&&u<=7027||7040<=u&&u<=7041||7074<=u&&u<=7077||7080<=u&&u<=7081||7083<=u&&u<=7085||7142==u||7144<=u&&u<=7145||7149==u||7151<=u&&u<=7153||7212<=u&&u<=7219||7222<=u&&u<=7223||7376<=u&&u<=7378||7380<=u&&u<=7392||7394<=u&&u<=7400||7405==u||7412==u||7416<=u&&u<=7417||7616<=u&&u<=7673||7675<=u&&u<=7679||8204==u||8400<=u&&u<=8412||8413<=u&&u<=8416||8417==u||8418<=u&&u<=8420||8421<=u&&u<=8432||11503<=u&&u<=11505||11647==u||11744<=u&&u<=11775||12330<=u&&u<=12333||12334<=u&&u<=12335||12441<=u&&u<=12442||42607==u||42608<=u&&u<=42610||42612<=u&&u<=42621||42654<=u&&u<=42655||42736<=u&&u<=42737||43010==u||43014==u||43019==u||43045<=u&&u<=43046||43204<=u&&u<=43205||43232<=u&&u<=43249||43302<=u&&u<=43309||43335<=u&&u<=43345||43392<=u&&u<=43394||43443==u||43446<=u&&u<=43449||43452==u||43493==u||43561<=u&&u<=43566||43569<=u&&u<=43570||43573<=u&&u<=43574||43587==u||43596==u||43644==u||43696==u||43698<=u&&u<=43700||43703<=u&&u<=43704||43710<=u&&u<=43711||43713==u||43756<=u&&u<=43757||43766==u||44005==u||44008==u||44013==u||64286==u||65024<=u&&u<=65039||65056<=u&&u<=65071||65438<=u&&u<=65439||66045==u||66272==u||66422<=u&&u<=66426||68097<=u&&u<=68099||68101<=u&&u<=68102||68108<=u&&u<=68111||68152<=u&&u<=68154||68159==u||68325<=u&&u<=68326||69633==u||69688<=u&&u<=69702||69759<=u&&u<=69761||69811<=u&&u<=69814||69817<=u&&u<=69818||69888<=u&&u<=69890||69927<=u&&u<=69931||69933<=u&&u<=69940||70003==u||70016<=u&&u<=70017||70070<=u&&u<=70078||70090<=u&&u<=70092||70191<=u&&u<=70193||70196==u||70198<=u&&u<=70199||70206==u||70367==u||70371<=u&&u<=70378||70400<=u&&u<=70401||70460==u||70462==u||70464==u||70487==u||70502<=u&&u<=70508||70512<=u&&u<=70516||70712<=u&&u<=70719||70722<=u&&u<=70724||70726==u||70832==u||70835<=u&&u<=70840||70842==u||70845==u||70847<=u&&u<=70848||70850<=u&&u<=70851||71087==u||71090<=u&&u<=71093||71100<=u&&u<=71101||71103<=u&&u<=71104||71132<=u&&u<=71133||71219<=u&&u<=71226||71229==u||71231<=u&&u<=71232||71339==u||71341==u||71344<=u&&u<=71349||71351==u||71453<=u&&u<=71455||71458<=u&&u<=71461||71463<=u&&u<=71467||72193<=u&&u<=72198||72201<=u&&u<=72202||72243<=u&&u<=72248||72251<=u&&u<=72254||72263==u||72273<=u&&u<=72278||72281<=u&&u<=72283||72330<=u&&u<=72342||72344<=u&&u<=72345||72752<=u&&u<=72758||72760<=u&&u<=72765||72767==u||72850<=u&&u<=72871||72874<=u&&u<=72880||72882<=u&&u<=72883||72885<=u&&u<=72886||73009<=u&&u<=73014||73018==u||73020<=u&&u<=73021||73023<=u&&u<=73029||73031==u||92912<=u&&u<=92916||92976<=u&&u<=92982||94095<=u&&u<=94098||113821<=u&&u<=113822||119141==u||119143<=u&&u<=119145||119150<=u&&u<=119154||119163<=u&&u<=119170||119173<=u&&u<=119179||119210<=u&&u<=119213||119362<=u&&u<=119364||121344<=u&&u<=121398||121403<=u&&u<=121452||121461==u||121476==u||121499<=u&&u<=121503||121505<=u&&u<=121519||122880<=u&&u<=122886||122888<=u&&u<=122904||122907<=u&&u<=122913||122915<=u&&u<=122916||122918<=u&&u<=122922||125136<=u&&u<=125142||125252<=u&&u<=125258||917536<=u&&u<=917631||917760<=u&&u<=917999?t:127462<=u&&u<=127487?e:2307==u||2363==u||2366<=u&&u<=2368||2377<=u&&u<=2380||2382<=u&&u<=2383||2434<=u&&u<=2435||2495<=u&&u<=2496||2503<=u&&u<=2504||2507<=u&&u<=2508||2563==u||2622<=u&&u<=2624||2691==u||2750<=u&&u<=2752||2761==u||2763<=u&&u<=2764||2818<=u&&u<=2819||2880==u||2887<=u&&u<=2888||2891<=u&&u<=2892||3007==u||3009<=u&&u<=3010||3014<=u&&u<=3016||3018<=u&&u<=3020||3073<=u&&u<=3075||3137<=u&&u<=3140||3202<=u&&u<=3203||3262==u||3264<=u&&u<=3265||3267<=u&&u<=3268||3271<=u&&u<=3272||3274<=u&&u<=3275||3330<=u&&u<=3331||3391<=u&&u<=3392||3398<=u&&u<=3400||3402<=u&&u<=3404||3458<=u&&u<=3459||3536<=u&&u<=3537||3544<=u&&u<=3550||3570<=u&&u<=3571||3635==u||3763==u||3902<=u&&u<=3903||3967==u||4145==u||4155<=u&&u<=4156||4182<=u&&u<=4183||4228==u||6070==u||6078<=u&&u<=6085||6087<=u&&u<=6088||6435<=u&&u<=6438||6441<=u&&u<=6443||6448<=u&&u<=6449||6451<=u&&u<=6456||6681<=u&&u<=6682||6741==u||6743==u||6765<=u&&u<=6770||6916==u||6965==u||6971==u||6973<=u&&u<=6977||6979<=u&&u<=6980||7042==u||7073==u||7078<=u&&u<=7079||7082==u||7143==u||7146<=u&&u<=7148||7150==u||7154<=u&&u<=7155||7204<=u&&u<=7211||7220<=u&&u<=7221||7393==u||7410<=u&&u<=7411||7415==u||43043<=u&&u<=43044||43047==u||43136<=u&&u<=43137||43188<=u&&u<=43203||43346<=u&&u<=43347||43395==u||43444<=u&&u<=43445||43450<=u&&u<=43451||43453<=u&&u<=43456||43567<=u&&u<=43568||43571<=u&&u<=43572||43597==u||43755==u||43758<=u&&u<=43759||43765==u||44003<=u&&u<=44004||44006<=u&&u<=44007||44009<=u&&u<=44010||44012==u||69632==u||69634==u||69762==u||69808<=u&&u<=69810||69815<=u&&u<=69816||69932==u||70018==u||70067<=u&&u<=70069||70079<=u&&u<=70080||70188<=u&&u<=70190||70194<=u&&u<=70195||70197==u||70368<=u&&u<=70370||70402<=u&&u<=70403||70463==u||70465<=u&&u<=70468||70471<=u&&u<=70472||70475<=u&&u<=70477||70498<=u&&u<=70499||70709<=u&&u<=70711||70720<=u&&u<=70721||70725==u||70833<=u&&u<=70834||70841==u||70843<=u&&u<=70844||70846==u||70849==u||71088<=u&&u<=71089||71096<=u&&u<=71099||71102==u||71216<=u&&u<=71218||71227<=u&&u<=71228||71230==u||71340==u||71342<=u&&u<=71343||71350==u||71456<=u&&u<=71457||71462==u||72199<=u&&u<=72200||72249==u||72279<=u&&u<=72280||72343==u||72751==u||72766==u||72873==u||72881==u||72884==u||94033<=u&&u<=94078||119142==u||119149==u?5:4352<=u&&u<=4447||43360<=u&&u<=43388?6:4448<=u&&u<=4519||55216<=u&&u<=55238?7:4520<=u&&u<=4607||55243<=u&&u<=55291?8:44032==u||44060==u||44088==u||44116==u||44144==u||44172==u||44200==u||44228==u||44256==u||44284==u||44312==u||44340==u||44368==u||44396==u||44424==u||44452==u||44480==u||44508==u||44536==u||44564==u||44592==u||44620==u||44648==u||44676==u||44704==u||44732==u||44760==u||44788==u||44816==u||44844==u||44872==u||44900==u||44928==u||44956==u||44984==u||45012==u||45040==u||45068==u||45096==u||45124==u||45152==u||45180==u||45208==u||45236==u||45264==u||45292==u||45320==u||45348==u||45376==u||45404==u||45432==u||45460==u||45488==u||45516==u||45544==u||45572==u||45600==u||45628==u||45656==u||45684==u||45712==u||45740==u||45768==u||45796==u||45824==u||45852==u||45880==u||45908==u||45936==u||45964==u||45992==u||46020==u||46048==u||46076==u||46104==u||46132==u||46160==u||46188==u||46216==u||46244==u||46272==u||46300==u||46328==u||46356==u||46384==u||46412==u||46440==u||46468==u||46496==u||46524==u||46552==u||46580==u||46608==u||46636==u||46664==u||46692==u||46720==u||46748==u||46776==u||46804==u||46832==u||46860==u||46888==u||46916==u||46944==u||46972==u||47e3==u||47028==u||47056==u||47084==u||47112==u||47140==u||47168==u||47196==u||47224==u||47252==u||47280==u||47308==u||47336==u||47364==u||47392==u||47420==u||47448==u||47476==u||47504==u||47532==u||47560==u||47588==u||47616==u||47644==u||47672==u||47700==u||47728==u||47756==u||47784==u||47812==u||47840==u||47868==u||47896==u||47924==u||47952==u||47980==u||48008==u||48036==u||48064==u||48092==u||48120==u||48148==u||48176==u||48204==u||48232==u||48260==u||48288==u||48316==u||48344==u||48372==u||48400==u||48428==u||48456==u||48484==u||48512==u||48540==u||48568==u||48596==u||48624==u||48652==u||48680==u||48708==u||48736==u||48764==u||48792==u||48820==u||48848==u||48876==u||48904==u||48932==u||48960==u||48988==u||49016==u||49044==u||49072==u||49100==u||49128==u||49156==u||49184==u||49212==u||49240==u||49268==u||49296==u||49324==u||49352==u||49380==u||49408==u||49436==u||49464==u||49492==u||49520==u||49548==u||49576==u||49604==u||49632==u||49660==u||49688==u||49716==u||49744==u||49772==u||49800==u||49828==u||49856==u||49884==u||49912==u||49940==u||49968==u||49996==u||50024==u||50052==u||50080==u||50108==u||50136==u||50164==u||50192==u||50220==u||50248==u||50276==u||50304==u||50332==u||50360==u||50388==u||50416==u||50444==u||50472==u||50500==u||50528==u||50556==u||50584==u||50612==u||50640==u||50668==u||50696==u||50724==u||50752==u||50780==u||50808==u||50836==u||50864==u||50892==u||50920==u||50948==u||50976==u||51004==u||51032==u||51060==u||51088==u||51116==u||51144==u||51172==u||51200==u||51228==u||51256==u||51284==u||51312==u||51340==u||51368==u||51396==u||51424==u||51452==u||51480==u||51508==u||51536==u||51564==u||51592==u||51620==u||51648==u||51676==u||51704==u||51732==u||51760==u||51788==u||51816==u||51844==u||51872==u||51900==u||51928==u||51956==u||51984==u||52012==u||52040==u||52068==u||52096==u||52124==u||52152==u||52180==u||52208==u||52236==u||52264==u||52292==u||52320==u||52348==u||52376==u||52404==u||52432==u||52460==u||52488==u||52516==u||52544==u||52572==u||52600==u||52628==u||52656==u||52684==u||52712==u||52740==u||52768==u||52796==u||52824==u||52852==u||52880==u||52908==u||52936==u||52964==u||52992==u||53020==u||53048==u||53076==u||53104==u||53132==u||53160==u||53188==u||53216==u||53244==u||53272==u||53300==u||53328==u||53356==u||53384==u||53412==u||53440==u||53468==u||53496==u||53524==u||53552==u||53580==u||53608==u||53636==u||53664==u||53692==u||53720==u||53748==u||53776==u||53804==u||53832==u||53860==u||53888==u||53916==u||53944==u||53972==u||54e3==u||54028==u||54056==u||54084==u||54112==u||54140==u||54168==u||54196==u||54224==u||54252==u||54280==u||54308==u||54336==u||54364==u||54392==u||54420==u||54448==u||54476==u||54504==u||54532==u||54560==u||54588==u||54616==u||54644==u||54672==u||54700==u||54728==u||54756==u||54784==u||54812==u||54840==u||54868==u||54896==u||54924==u||54952==u||54980==u||55008==u||55036==u||55064==u||55092==u||55120==u||55148==u||55176==u?9:44033<=u&&u<=44059||44061<=u&&u<=44087||44089<=u&&u<=44115||44117<=u&&u<=44143||44145<=u&&u<=44171||44173<=u&&u<=44199||44201<=u&&u<=44227||44229<=u&&u<=44255||44257<=u&&u<=44283||44285<=u&&u<=44311||44313<=u&&u<=44339||44341<=u&&u<=44367||44369<=u&&u<=44395||44397<=u&&u<=44423||44425<=u&&u<=44451||44453<=u&&u<=44479||44481<=u&&u<=44507||44509<=u&&u<=44535||44537<=u&&u<=44563||44565<=u&&u<=44591||44593<=u&&u<=44619||44621<=u&&u<=44647||44649<=u&&u<=44675||44677<=u&&u<=44703||44705<=u&&u<=44731||44733<=u&&u<=44759||44761<=u&&u<=44787||44789<=u&&u<=44815||44817<=u&&u<=44843||44845<=u&&u<=44871||44873<=u&&u<=44899||44901<=u&&u<=44927||44929<=u&&u<=44955||44957<=u&&u<=44983||44985<=u&&u<=45011||45013<=u&&u<=45039||45041<=u&&u<=45067||45069<=u&&u<=45095||45097<=u&&u<=45123||45125<=u&&u<=45151||45153<=u&&u<=45179||45181<=u&&u<=45207||45209<=u&&u<=45235||45237<=u&&u<=45263||45265<=u&&u<=45291||45293<=u&&u<=45319||45321<=u&&u<=45347||45349<=u&&u<=45375||45377<=u&&u<=45403||45405<=u&&u<=45431||45433<=u&&u<=45459||45461<=u&&u<=45487||45489<=u&&u<=45515||45517<=u&&u<=45543||45545<=u&&u<=45571||45573<=u&&u<=45599||45601<=u&&u<=45627||45629<=u&&u<=45655||45657<=u&&u<=45683||45685<=u&&u<=45711||45713<=u&&u<=45739||45741<=u&&u<=45767||45769<=u&&u<=45795||45797<=u&&u<=45823||45825<=u&&u<=45851||45853<=u&&u<=45879||45881<=u&&u<=45907||45909<=u&&u<=45935||45937<=u&&u<=45963||45965<=u&&u<=45991||45993<=u&&u<=46019||46021<=u&&u<=46047||46049<=u&&u<=46075||46077<=u&&u<=46103||46105<=u&&u<=46131||46133<=u&&u<=46159||46161<=u&&u<=46187||46189<=u&&u<=46215||46217<=u&&u<=46243||46245<=u&&u<=46271||46273<=u&&u<=46299||46301<=u&&u<=46327||46329<=u&&u<=46355||46357<=u&&u<=46383||46385<=u&&u<=46411||46413<=u&&u<=46439||46441<=u&&u<=46467||46469<=u&&u<=46495||46497<=u&&u<=46523||46525<=u&&u<=46551||46553<=u&&u<=46579||46581<=u&&u<=46607||46609<=u&&u<=46635||46637<=u&&u<=46663||46665<=u&&u<=46691||46693<=u&&u<=46719||46721<=u&&u<=46747||46749<=u&&u<=46775||46777<=u&&u<=46803||46805<=u&&u<=46831||46833<=u&&u<=46859||46861<=u&&u<=46887||46889<=u&&u<=46915||46917<=u&&u<=46943||46945<=u&&u<=46971||46973<=u&&u<=46999||47001<=u&&u<=47027||47029<=u&&u<=47055||47057<=u&&u<=47083||47085<=u&&u<=47111||47113<=u&&u<=47139||47141<=u&&u<=47167||47169<=u&&u<=47195||47197<=u&&u<=47223||47225<=u&&u<=47251||47253<=u&&u<=47279||47281<=u&&u<=47307||47309<=u&&u<=47335||47337<=u&&u<=47363||47365<=u&&u<=47391||47393<=u&&u<=47419||47421<=u&&u<=47447||47449<=u&&u<=47475||47477<=u&&u<=47503||47505<=u&&u<=47531||47533<=u&&u<=47559||47561<=u&&u<=47587||47589<=u&&u<=47615||47617<=u&&u<=47643||47645<=u&&u<=47671||47673<=u&&u<=47699||47701<=u&&u<=47727||47729<=u&&u<=47755||47757<=u&&u<=47783||47785<=u&&u<=47811||47813<=u&&u<=47839||47841<=u&&u<=47867||47869<=u&&u<=47895||47897<=u&&u<=47923||47925<=u&&u<=47951||47953<=u&&u<=47979||47981<=u&&u<=48007||48009<=u&&u<=48035||48037<=u&&u<=48063||48065<=u&&u<=48091||48093<=u&&u<=48119||48121<=u&&u<=48147||48149<=u&&u<=48175||48177<=u&&u<=48203||48205<=u&&u<=48231||48233<=u&&u<=48259||48261<=u&&u<=48287||48289<=u&&u<=48315||48317<=u&&u<=48343||48345<=u&&u<=48371||48373<=u&&u<=48399||48401<=u&&u<=48427||48429<=u&&u<=48455||48457<=u&&u<=48483||48485<=u&&u<=48511||48513<=u&&u<=48539||48541<=u&&u<=48567||48569<=u&&u<=48595||48597<=u&&u<=48623||48625<=u&&u<=48651||48653<=u&&u<=48679||48681<=u&&u<=48707||48709<=u&&u<=48735||48737<=u&&u<=48763||48765<=u&&u<=48791||48793<=u&&u<=48819||48821<=u&&u<=48847||48849<=u&&u<=48875||48877<=u&&u<=48903||48905<=u&&u<=48931||48933<=u&&u<=48959||48961<=u&&u<=48987||48989<=u&&u<=49015||49017<=u&&u<=49043||49045<=u&&u<=49071||49073<=u&&u<=49099||49101<=u&&u<=49127||49129<=u&&u<=49155||49157<=u&&u<=49183||49185<=u&&u<=49211||49213<=u&&u<=49239||49241<=u&&u<=49267||49269<=u&&u<=49295||49297<=u&&u<=49323||49325<=u&&u<=49351||49353<=u&&u<=49379||49381<=u&&u<=49407||49409<=u&&u<=49435||49437<=u&&u<=49463||49465<=u&&u<=49491||49493<=u&&u<=49519||49521<=u&&u<=49547||49549<=u&&u<=49575||49577<=u&&u<=49603||49605<=u&&u<=49631||49633<=u&&u<=49659||49661<=u&&u<=49687||49689<=u&&u<=49715||49717<=u&&u<=49743||49745<=u&&u<=49771||49773<=u&&u<=49799||49801<=u&&u<=49827||49829<=u&&u<=49855||49857<=u&&u<=49883||49885<=u&&u<=49911||49913<=u&&u<=49939||49941<=u&&u<=49967||49969<=u&&u<=49995||49997<=u&&u<=50023||50025<=u&&u<=50051||50053<=u&&u<=50079||50081<=u&&u<=50107||50109<=u&&u<=50135||50137<=u&&u<=50163||50165<=u&&u<=50191||50193<=u&&u<=50219||50221<=u&&u<=50247||50249<=u&&u<=50275||50277<=u&&u<=50303||50305<=u&&u<=50331||50333<=u&&u<=50359||50361<=u&&u<=50387||50389<=u&&u<=50415||50417<=u&&u<=50443||50445<=u&&u<=50471||50473<=u&&u<=50499||50501<=u&&u<=50527||50529<=u&&u<=50555||50557<=u&&u<=50583||50585<=u&&u<=50611||50613<=u&&u<=50639||50641<=u&&u<=50667||50669<=u&&u<=50695||50697<=u&&u<=50723||50725<=u&&u<=50751||50753<=u&&u<=50779||50781<=u&&u<=50807||50809<=u&&u<=50835||50837<=u&&u<=50863||50865<=u&&u<=50891||50893<=u&&u<=50919||50921<=u&&u<=50947||50949<=u&&u<=50975||50977<=u&&u<=51003||51005<=u&&u<=51031||51033<=u&&u<=51059||51061<=u&&u<=51087||51089<=u&&u<=51115||51117<=u&&u<=51143||51145<=u&&u<=51171||51173<=u&&u<=51199||51201<=u&&u<=51227||51229<=u&&u<=51255||51257<=u&&u<=51283||51285<=u&&u<=51311||51313<=u&&u<=51339||51341<=u&&u<=51367||51369<=u&&u<=51395||51397<=u&&u<=51423||51425<=u&&u<=51451||51453<=u&&u<=51479||51481<=u&&u<=51507||51509<=u&&u<=51535||51537<=u&&u<=51563||51565<=u&&u<=51591||51593<=u&&u<=51619||51621<=u&&u<=51647||51649<=u&&u<=51675||51677<=u&&u<=51703||51705<=u&&u<=51731||51733<=u&&u<=51759||51761<=u&&u<=51787||51789<=u&&u<=51815||51817<=u&&u<=51843||51845<=u&&u<=51871||51873<=u&&u<=51899||51901<=u&&u<=51927||51929<=u&&u<=51955||51957<=u&&u<=51983||51985<=u&&u<=52011||52013<=u&&u<=52039||52041<=u&&u<=52067||52069<=u&&u<=52095||52097<=u&&u<=52123||52125<=u&&u<=52151||52153<=u&&u<=52179||52181<=u&&u<=52207||52209<=u&&u<=52235||52237<=u&&u<=52263||52265<=u&&u<=52291||52293<=u&&u<=52319||52321<=u&&u<=52347||52349<=u&&u<=52375||52377<=u&&u<=52403||52405<=u&&u<=52431||52433<=u&&u<=52459||52461<=u&&u<=52487||52489<=u&&u<=52515||52517<=u&&u<=52543||52545<=u&&u<=52571||52573<=u&&u<=52599||52601<=u&&u<=52627||52629<=u&&u<=52655||52657<=u&&u<=52683||52685<=u&&u<=52711||52713<=u&&u<=52739||52741<=u&&u<=52767||52769<=u&&u<=52795||52797<=u&&u<=52823||52825<=u&&u<=52851||52853<=u&&u<=52879||52881<=u&&u<=52907||52909<=u&&u<=52935||52937<=u&&u<=52963||52965<=u&&u<=52991||52993<=u&&u<=53019||53021<=u&&u<=53047||53049<=u&&u<=53075||53077<=u&&u<=53103||53105<=u&&u<=53131||53133<=u&&u<=53159||53161<=u&&u<=53187||53189<=u&&u<=53215||53217<=u&&u<=53243||53245<=u&&u<=53271||53273<=u&&u<=53299||53301<=u&&u<=53327||53329<=u&&u<=53355||53357<=u&&u<=53383||53385<=u&&u<=53411||53413<=u&&u<=53439||53441<=u&&u<=53467||53469<=u&&u<=53495||53497<=u&&u<=53523||53525<=u&&u<=53551||53553<=u&&u<=53579||53581<=u&&u<=53607||53609<=u&&u<=53635||53637<=u&&u<=53663||53665<=u&&u<=53691||53693<=u&&u<=53719||53721<=u&&u<=53747||53749<=u&&u<=53775||53777<=u&&u<=53803||53805<=u&&u<=53831||53833<=u&&u<=53859||53861<=u&&u<=53887||53889<=u&&u<=53915||53917<=u&&u<=53943||53945<=u&&u<=53971||53973<=u&&u<=53999||54001<=u&&u<=54027||54029<=u&&u<=54055||54057<=u&&u<=54083||54085<=u&&u<=54111||54113<=u&&u<=54139||54141<=u&&u<=54167||54169<=u&&u<=54195||54197<=u&&u<=54223||54225<=u&&u<=54251||54253<=u&&u<=54279||54281<=u&&u<=54307||54309<=u&&u<=54335||54337<=u&&u<=54363||54365<=u&&u<=54391||54393<=u&&u<=54419||54421<=u&&u<=54447||54449<=u&&u<=54475||54477<=u&&u<=54503||54505<=u&&u<=54531||54533<=u&&u<=54559||54561<=u&&u<=54587||54589<=u&&u<=54615||54617<=u&&u<=54643||54645<=u&&u<=54671||54673<=u&&u<=54699||54701<=u&&u<=54727||54729<=u&&u<=54755||54757<=u&&u<=54783||54785<=u&&u<=54811||54813<=u&&u<=54839||54841<=u&&u<=54867||54869<=u&&u<=54895||54897<=u&&u<=54923||54925<=u&&u<=54951||54953<=u&&u<=54979||54981<=u&&u<=55007||55009<=u&&u<=55035||55037<=u&&u<=55063||55065<=u&&u<=55091||55093<=u&&u<=55119||55121<=u&&u<=55147||55149<=u&&u<=55175||55177<=u&&u<=55203?10:9757==u||9977==u||9994<=u&&u<=9997||127877==u||127938<=u&&u<=127940||127943==u||127946<=u&&u<=127948||128066<=u&&u<=128067||128070<=u&&u<=128080||128110==u||128112<=u&&u<=128120||128124==u||128129<=u&&u<=128131||128133<=u&&u<=128135||128170==u||128372<=u&&u<=128373||128378==u||128400==u||128405<=u&&u<=128406||128581<=u&&u<=128583||128587<=u&&u<=128591||128675==u||128692<=u&&u<=128694||128704==u||128716==u||129304<=u&&u<=129308||129310<=u&&u<=129311||129318==u||129328<=u&&u<=129337||129341<=u&&u<=129342||129489<=u&&u<=129501?n:127995<=u&&u<=127999?14:8205==u?15:9792==u||9794==u||9877<=u&&u<=9878||9992==u||10084==u||127752==u||127806==u||127859==u||127891==u||127908==u||127912==u||127979==u||127981==u||128139==u||128187<=u&&u<=128188||128295==u||128300==u||128488==u||128640==u||128658==u?o:128102<=u&&u<=128105?i:11}return this.nextBreak=function(t,e){if(void 0===e&&(e=0),e<0)return 0;if(e>=t.length-1)return t.length;for(var r,n,o=a(u(t,e)),i=[],f=e+1;f<t.length;f++)if(!(55296<=(r=t).charCodeAt(n=f-1)&&r.charCodeAt(n)<=56319&&56320<=r.charCodeAt(n+1)&&r.charCodeAt(n+1)<=57343)){var s=a(u(t,f));if(c(o,i,s))return f;i.push(s)}return t.length},this.splitGraphemes=function(t){for(var e,r=[],n=0;(e=this.nextBreak(t,n))<t.length;)r.push(t.slice(n,e)),n=e;return n<t.length&&r.push(t.slice(n)),r},this.iterateGraphemes=function(t){var e=0,r={next:function(){var r,n;return(n=this.nextBreak(t,e))<t.length?(r=t.slice(e,n),e=n,{value:r,done:!1}):e<t.length?(r=t.slice(e),e=t.length,{value:r,done:!1}):{value:void 0,done:!0}}.bind(this)};return"undefined"!=typeof Symbol&&Symbol.iterator&&(r[Symbol.iterator]=function(){return r}),r},this.countGraphemes=function(t){for(var e,r=0,n=0;(e=this.nextBreak(t,n))<t.length;)n=e,r++;return n<t.length&&r++,r},this})}(y);var v=y.exports;function g(t,e,r){function n(t){return!(!["string","number"].includes(typeof t)||"string"==typeof t&&!/^\d*$/.test(t)||"number"==typeof t&&(!Number.isInteger(t)||t<0))}function o(t,e){let n=0,o=0;for(let r=0,i=t.length;r<i;r++){if(o+=t[r].length,e>=n&&e<o)return r;n+=t[r].length}throw new Error(`string-convert-indexes: [THROW_ID_05] the "indexes" value, ${r}, is not covered by graphemes length!`)}function i(t,e){if(e>=t.length)throw new Error(`string-convert-indexes: [THROW_ID_06] the index to convert, ${e}, is not covered by graphemes length!`);return t.slice(0,e).join("").length}if("string"!=typeof e||!e)throw new TypeError(`string-convert-indexes: [THROW_ID_01] the first input argument, input string, must be a non-zero-length string! Currently it's: ${typeof e}, equal to:\n${e}`);if(0===r)return 0;if("0"===r)return"0";const u=(new v).splitGraphemes(e);if(["string","number"].includes(typeof r)){if(n(r))return"u"===t?"string"==typeof r?String(i(u,+r)):i(u,+r):"string"==typeof r?String(o(u,+r)):o(u,+r);throw new Error(`string-convert-indexes: [THROW_ID_02] the second input argument, "indexes" is not suitable to describe string index - it was given as ${JSON.stringify(r,null,4)} (${typeof r})`)}if(r&&"object"==typeof r)return d(r,"u"===t?(t,e,r)=>{const o=void 0!==e?e:t;if(["string","number"].includes(typeof o)){if(n(o))return"string"==typeof o?String(i(u,+o)):i(u,+o);throw new Error(`string-convert-indexes: [THROW_ID_03] bad value was encountered, ${JSON.stringify(o,null,4)}, its path is ${r.path}`)}return o}:(t,e,r)=>{const i=void 0!==e?e:t;if(["string","number"].includes(typeof i)){if(n(i))return"string"==typeof i?String(o(u,+i)):o(u,+i);throw new Error(`string-convert-indexes: [THROW_ID_04] bad value was encountered, ${JSON.stringify(i,null,4)}, its path is ${r.path}`)}return i});throw new Error(`string-convert-indexes: [THROW_ID_07] the first input argument, a source string should be a string but it was given as ${e}, type ${typeof e}`)}t.nativeToUnicode=function(t,e){return g("n",t,e)},t.unicodeToNative=function(t,e){return g("u",t,e)},t.version="5.0.5",Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* @name ast-monkey-util
|
|
22
|
+
* @fileoverview Utility library of AST helper functions
|
|
23
|
+
* @version 2.0.11
|
|
24
|
+
* @author Roy Revelt, Codsen Ltd
|
|
25
|
+
* @license MIT
|
|
26
|
+
* {@link https://codsen.com/os/ast-monkey-util/}
|
|
27
|
+
*/
|
package/examples/_quickTake.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "string-convert-indexes",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.11",
|
|
4
4
|
"description": "Convert between native JS string character indexes and grapheme-count-based indexes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astral",
|
|
@@ -32,39 +32,30 @@
|
|
|
32
32
|
},
|
|
33
33
|
"types": "types/index.d.ts",
|
|
34
34
|
"scripts": {
|
|
35
|
-
"build": "
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"tap": "tap",
|
|
50
|
-
"pretest": "npm run build",
|
|
51
|
-
"test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format",
|
|
52
|
-
"test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
|
|
53
|
-
"tsc": "tsc",
|
|
54
|
-
"unittest": "tap --no-only --output-file=testStats.md --reporter=terse && tsc -p tsconfig.json --noEmit && npm run clean_cov && npm run perf"
|
|
35
|
+
"build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
36
|
+
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
|
|
37
|
+
"dts": "rollup -c && yarn run prettier 'types/index.d.ts' --write",
|
|
38
|
+
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
39
|
+
"lect": "node '../../ops/lect/lect.js'",
|
|
40
|
+
"letspublish": "yarn publish || :",
|
|
41
|
+
"lint": "eslint . --fix",
|
|
42
|
+
"perf": "node perf/check.js",
|
|
43
|
+
"prepare": "echo 'ready'",
|
|
44
|
+
"prettier": "prettier",
|
|
45
|
+
"prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
|
|
46
|
+
"pretest": "yarn run lect && yarn run build",
|
|
47
|
+
"test": "c8 yarn run unit && yarn run examples && yarn run lint",
|
|
48
|
+
"unit": "uvu test"
|
|
55
49
|
},
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"--no-warnings",
|
|
64
|
-
"--experimental-loader",
|
|
65
|
-
"@istanbuljs/esm-loader-hook"
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
52
|
+
},
|
|
53
|
+
"c8": {
|
|
54
|
+
"check-coverage": true,
|
|
55
|
+
"exclude": [
|
|
56
|
+
"**/test/**/*.*"
|
|
66
57
|
],
|
|
67
|
-
"
|
|
58
|
+
"lines": 100
|
|
68
59
|
},
|
|
69
60
|
"lect": {
|
|
70
61
|
"licence": {
|
|
@@ -72,55 +63,10 @@
|
|
|
72
63
|
""
|
|
73
64
|
]
|
|
74
65
|
},
|
|
75
|
-
"
|
|
76
|
-
"various": {
|
|
77
|
-
"devDependencies": []
|
|
78
|
-
}
|
|
66
|
+
"various": {}
|
|
79
67
|
},
|
|
80
68
|
"dependencies": {
|
|
81
|
-
"
|
|
82
|
-
"ast-monkey-traverse": "^3.0.5",
|
|
69
|
+
"ast-monkey-traverse": "^3.0.11",
|
|
83
70
|
"grapheme-splitter": "^1.0.4"
|
|
84
|
-
},
|
|
85
|
-
"devDependencies": {
|
|
86
|
-
"@babel/cli": "^7.16.0",
|
|
87
|
-
"@babel/core": "^7.16.0",
|
|
88
|
-
"@babel/node": "^7.16.0",
|
|
89
|
-
"@babel/plugin-external-helpers": "^7.16.0",
|
|
90
|
-
"@babel/plugin-proposal-class-properties": "^7.16.0",
|
|
91
|
-
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
|
92
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
|
|
93
|
-
"@babel/plugin-proposal-optional-chaining": "^7.16.0",
|
|
94
|
-
"@babel/plugin-transform-runtime": "^7.16.0",
|
|
95
|
-
"@babel/preset-env": "^7.16.0",
|
|
96
|
-
"@babel/preset-typescript": "^7.16.0",
|
|
97
|
-
"@babel/register": "^7.16.0",
|
|
98
|
-
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
99
|
-
"@rollup/plugin-babel": "^5.3.0",
|
|
100
|
-
"@rollup/plugin-commonjs": "^21.0.1",
|
|
101
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
102
|
-
"@rollup/plugin-node-resolve": "^13.0.6",
|
|
103
|
-
"@rollup/plugin-strip": "^2.1.0",
|
|
104
|
-
"@rollup/plugin-typescript": "^8.3.0",
|
|
105
|
-
"@types/node": "^16.11.6",
|
|
106
|
-
"@types/tap": "^15.0.5",
|
|
107
|
-
"@typescript-eslint/eslint-plugin": "^5.3.0",
|
|
108
|
-
"@typescript-eslint/parser": "^5.3.0",
|
|
109
|
-
"core-js": "^3.19.1",
|
|
110
|
-
"cross-env": "^7.0.3",
|
|
111
|
-
"eslint": "^8.2.0",
|
|
112
|
-
"lect": "^0.18.5",
|
|
113
|
-
"rollup": "^2.59.0",
|
|
114
|
-
"rollup-plugin-ascii": "^0.0.3",
|
|
115
|
-
"rollup-plugin-banner": "^0.2.1",
|
|
116
|
-
"rollup-plugin-cleanup": "^3.2.1",
|
|
117
|
-
"rollup-plugin-dts": "^4.0.1",
|
|
118
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
119
|
-
"tap": "^15.0.10",
|
|
120
|
-
"tslib": "^2.3.1",
|
|
121
|
-
"typescript": "^4.4.4"
|
|
122
|
-
},
|
|
123
|
-
"engines": {
|
|
124
|
-
"node": ">=12"
|
|
125
71
|
}
|
|
126
72
|
}
|
package/types/index.d.ts
CHANGED
|
File without changes
|
package/examples/api.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"_quickTake.js":{"title":"Quick Take","content":"import { strict as assert } from \"assert\";\nimport {\n nativeToUnicode,\n unicodeToNative,\n} from \"string-convert-indexes\";\n\n// CONVERTING NATIVE JS INDEXES TO UNICODE-CHAR-COUNT-BASED\n// 𝌆 - \\uD834\\uDF06\n\n// at index 1, we have low surrogate, that's still grapheme index zero\nassert.equal(nativeToUnicode(\"\\uD834\\uDF06aa\", \"1\"), \"0\");\n// notice it's retained as string. The same type as input is retained!\n\n// at index 2, we have first letter a - that's second index, counting graphemes\nassert.equal(nativeToUnicode(\"\\uD834\\uDF06aa\", 3), 2);\n\n// convert many indexes at once - any nested data structure is fine:\nassert.deepEqual(nativeToUnicode(\"\\uD834\\uDF06aa\", [1, 0, 2, 3]), [0, 0, 1, 2]);\n\n// numbers from an AST-like complex structure are still picked out and converted:\nassert.deepEqual(nativeToUnicode(\"\\uD834\\uDF06aa\", [1, \"0\", [[[2]]], 3]), [\n 0, // notice matching type is retained\n \"0\", // notice matching type is retained\n [[[1]]],\n 2,\n]);\n\n// CONVERTING UNICODE-CHAR-COUNT-BASED TO NATIVE JS INDEXES\n// 𝌆 - \\uD834\\uDF06\n\nassert.deepEqual(unicodeToNative(\"\\uD834\\uDF06aa\", [0, 1, 2]), [0, 2, 3]);\n\nassert.deepEqual(unicodeToNative(\"\\uD834\\uDF06aa\", [1, 0, 2]), [2, 0, 3]);\n\nassert.throws(() => unicodeToNative(\"\\uD834\\uDF06aa\", [1, 0, 2, 3]));\n// throws an error!\n// that's because there's no character (counting Unicode characters) with index 3\n// we have only three Unicode characters, so indexes go only up until 2"}}
|