json-variables 12.0.0 → 12.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -6
- package/package.json +19 -19
- package/dist/json-variables.esm.js +0 -16
- package/dist/json-variables.umd.js +0 -150
package/CHANGELOG.md
CHANGED
|
@@ -3,17 +3,13 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
### Features
|
|
9
|
-
|
|
10
|
-
- drop Node v12 support; minimum version requirement now is v14.18 and above ([c8049e8](https://github.com/codsen/codsen/commit/c8049e82a5844d3f72587740f1cc74e3c9020d22))
|
|
6
|
+
## 12.0.0 (2022-12-01)
|
|
11
7
|
|
|
12
8
|
### BREAKING CHANGES
|
|
13
9
|
|
|
14
10
|
- Minimum supported Node version is v14.18; we're dropping v12 support
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
## 11.1.0 (2022-08-12)
|
|
17
13
|
|
|
18
14
|
### Features
|
|
19
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "json-variables",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.1",
|
|
4
4
|
"description": "Resolves custom-marked, cross-referenced paths in parsed JSON",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"comb",
|
|
@@ -41,22 +41,22 @@
|
|
|
41
41
|
},
|
|
42
42
|
"types": "types/index.d.ts",
|
|
43
43
|
"scripts": {
|
|
44
|
-
"build": "node '../../ops/scripts/esbuild.js' &&
|
|
44
|
+
"build": "node '../../ops/scripts/esbuild.js' && npm run dts",
|
|
45
45
|
"cjs-off": "exit 0",
|
|
46
46
|
"cjs-on": "exit 0",
|
|
47
|
-
"dev": "DEV=true node '../../ops/scripts/esbuild.js' &&
|
|
48
|
-
"devtest": "c8
|
|
49
|
-
"dts": "rollup -c &&
|
|
47
|
+
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
|
|
48
|
+
"devtest": "c8 npm run unit && npm run examples && npm run lint",
|
|
49
|
+
"dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --loglevel 'silent'",
|
|
50
50
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
51
|
-
"lect": "node '../../ops/lect/lect.js' &&
|
|
52
|
-
"letspublish": "
|
|
51
|
+
"lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
|
|
52
|
+
"letspublish": "npm publish || :",
|
|
53
53
|
"lint": "eslint . --ext .js --ext .ts --fix",
|
|
54
54
|
"perf": "node perf/check.js",
|
|
55
|
-
"
|
|
55
|
+
"prep": "echo 'ready'",
|
|
56
56
|
"prettier": "prettier",
|
|
57
|
-
"prettier:format": "prettier --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern",
|
|
58
|
-
"pretest": "
|
|
59
|
-
"test": "
|
|
57
|
+
"prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --loglevel 'silent'",
|
|
58
|
+
"pretest": "npm run lect && npm run build",
|
|
59
|
+
"test": "npm run devtest",
|
|
60
60
|
"unit": "uvu test"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
@@ -78,15 +78,15 @@
|
|
|
78
78
|
"various": {}
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"arrayiffy-if-string": "^5.0.
|
|
82
|
-
"ast-get-values-by-key": "^5.0.
|
|
83
|
-
"ast-monkey-traverse": "^4.0.
|
|
81
|
+
"arrayiffy-if-string": "^5.0.1",
|
|
82
|
+
"ast-get-values-by-key": "^5.0.1",
|
|
83
|
+
"ast-monkey-traverse": "^4.0.1",
|
|
84
84
|
"matcher": "^5.0.0",
|
|
85
85
|
"object-path": "^0.11.8",
|
|
86
|
-
"ranges-apply": "^7.0.
|
|
87
|
-
"ranges-push": "^7.0.
|
|
88
|
-
"string-find-heads-tails": "^6.0.
|
|
89
|
-
"string-match-left-right": "^9.0.
|
|
90
|
-
"string-remove-duplicate-heads-tails": "^7.0.
|
|
86
|
+
"ranges-apply": "^7.0.1",
|
|
87
|
+
"ranges-push": "^7.0.1",
|
|
88
|
+
"string-find-heads-tails": "^6.0.1",
|
|
89
|
+
"string-match-left-right": "^9.0.1",
|
|
90
|
+
"string-remove-duplicate-heads-tails": "^7.0.1"
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @name json-variables
|
|
3
|
-
* @fileoverview Resolves custom-marked, cross-referenced paths in parsed JSON
|
|
4
|
-
* @version 12.0.0
|
|
5
|
-
* @author Roy Revelt, Codsen Ltd
|
|
6
|
-
* @license MIT
|
|
7
|
-
* {@link https://codsen.com/os/json-variables/}
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import{traverse as C}from"ast-monkey-traverse";import{isMatch as x}from"matcher";import h from"object-path";import{arrayiffy as F}from"arrayiffy-if-string";import{strFindHeadsTails as I}from"string-find-heads-tails";import{getByKey as _}from"ast-get-values-by-key";import{Ranges as B}from"ranges-push";import{rApply as A}from"ranges-apply";import{remDup as L}from"string-remove-duplicate-heads-tails";import{matchLeftIncl as U,matchRightIncl as M}from"string-match-left-right";var j="12.0.0";var he=j,q=Object.prototype.hasOwnProperty,K={heads:"%%_",tails:"_%%",headsNoWrap:"%%-",tailsNoWrap:"-%%",lookForDataContainers:!0,dataContainerIdentifierTails:"_data",wrapHeadsWith:"",wrapTailsWith:"",dontWrapVars:[],preventDoubleWrapping:!0,wrapGlobalFlipSwitch:!0,noSingleMarkers:!1,resolveToBoolIfAnyValuesContainBool:!0,resolveToFalseIfAnyValuesContainBool:!0,throwWhenNonStringInsertedInString:!1,allowUnresolved:!1};function g(e){return typeof e=="string"}function G(e){return typeof e=="number"}function O(e){return typeof e=="boolean"}function N(e){return e===null}function V(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function z(e){return e!=null}function u(e){return g(e)?e.trim():e}function Y(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=0,r=e.length;t<r;t++)if(e[t]===".")return e.slice(0,t)}return e}function Q(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=0,r=e.length;t<r;t++)if(e[t]===".")return e.slice(t+1)}return e}function J(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(0,t)}return e}function P(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(t+1)}return e}function T(e,t){return typeof e!="string"||!e.trim()?!1:!!(e.includes(t.heads)||e.includes(t.tails)||g(t.headsNoWrap)&&t.headsNoWrap.length&&e.includes(t.headsNoWrap)||g(t.tailsNoWrap)&&t.tailsNoWrap.length&&e.includes(t.tailsNoWrap))}function X(e,t,r){let o,i;return typeof e=="string"&&e.length&&M(e,0,t,{trimBeforeMatching:!0,cb:(n,a,l)=>(o=l,!0)})&&U(e,e.length-1,r,{trimBeforeMatching:!0,cb:(n,a,l)=>(i=(l||0)+1,!0)})?e.slice(o,i):e}function H(e,t,r=!1,o,i,n){if(t.wrapHeadsWith||(t.wrapHeadsWith=""),t.wrapTailsWith||(t.wrapTailsWith=""),g(e)&&!r&&t.wrapGlobalFlipSwitch&&!t.dontWrapVars.some(a=>x(n,a))&&(!t.preventDoubleWrapping||t.preventDoubleWrapping&&g(e)&&!e.includes(t.wrapHeadsWith)&&!e.includes(t.wrapTailsWith)))return`${t.wrapHeadsWith}${e}${t.wrapTailsWith}`;if(r){if(!g(e))return e;let a=L(e,{heads:t.wrapHeadsWith,tails:t.wrapTailsWith});return g(a)?X(a,t.wrapHeadsWith,t.wrapTailsWith):a}return e}function Z(e,t,r,o){let i;if(r.indexOf(".")!==-1){let n=r,a=!0;if(o.lookForDataContainers&&typeof o.dataContainerIdentifierTails=="string"&&o.dataContainerIdentifierTails.length&&!n.endsWith(o.dataContainerIdentifierTails)){let l=h.get(e,n+o.dataContainerIdentifierTails);V(l)&&h.get(l,t)&&(i=h.get(l,t),a=!1)}for(;a&&n.indexOf(".")!==-1;){if(n=J(n),P(n)===t)throw new Error(`json-variables/findValues(): [THROW_ID_20] While trying to resolve: "${t}" at path "${r}", we encountered a closed loop. The parent key "${P(n)}" is called the same as the variable "${t}" we're looking for.`);if(o.lookForDataContainers&&typeof o.dataContainerIdentifierTails=="string"&&o.dataContainerIdentifierTails.length&&!n.endsWith(o.dataContainerIdentifierTails)){let l=h.get(e,n+o.dataContainerIdentifierTails);V(l)&&h.get(l,t)&&(i=h.get(l,t),a=!1)}if(i===void 0){let l=h.get(e,n);V(l)&&h.get(l,t)&&(i=h.get(l,t),a=!1)}}}if(i===void 0){let n=h.get(e,t);n!==void 0&&(i=n)}if(i===void 0)if(t.indexOf(".")===-1){let n=_(e,t);if(n.length){for(let a=0,l=n.length;a<l;a++)if(g(n[a].val)||O(n[a].val)||N(n[a].val)){i=n[a].val;break}else if(G(n[a].val)){i=String(n[a].val);break}else if(Array.isArray(n[a].val)){i=n[a].val.join("");break}}}else{let n=_(e,Y(t));if(n.length)for(let a=0,l=n.length;a<l;a++){let y=h.get(n[a].val,Q(t));y&&g(y)&&(i=y)}}return i}function R(e,t,r,o,i=[]){if(i.includes(r)){let c="";if(i.length>1){let w=` \u2192
|
|
11
|
-
`;c=i.reduce((D,b,S)=>D+(S===0?"":w)+(b===r?"\u{1F4A5} ":" ")+b,` Here's the path we travelled up until we hit the recursion:
|
|
12
|
-
|
|
13
|
-
`),c+=`${w}\u{1F4A5} ${r}`}throw new Error(`json-variables/resolveString(): [THROW_ID_19] While trying to resolve: "${t}" at path "${r}", we encountered a closed loop, the key is referencing itself."${c}`)}let n={},a=Array.from(i);a.push(r);let l=new B;function y(c,w,D){for(let b=0,S=c.length;b<S;b++){let f=c[b],p=t.slice(f.headsEndAt,f.tailsStartAt);if(p.length===0)l.push(f.headsStartAt,f.tailsEndAt);else if(q.call(n,p)&&g(n[p]))l.push(f.headsStartAt,f.tailsEndAt,n[p]);else{let s=Z(e,p.trim(),r,o);if(s===void 0)if(o.allowUnresolved===!0)s="";else if(typeof o.allowUnresolved=="string")s=o.allowUnresolved;else throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_18] We couldn't find the value to resolve the variable ${t.slice(f.headsEndAt,f.tailsStartAt)}. We're at path: "${r}".`);if(!D&&o.throwWhenNonStringInsertedInString&&!g(s))throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ${t.slice(f.headsEndAt,f.tailsStartAt)} at path ${r}, it resolved into a non-string value, ${JSON.stringify(s,null,4)}. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").`);if(O(s)){if(o.resolveToBoolIfAnyValuesContainBool)return l.wipe(),o.resolveToFalseIfAnyValuesContainBool?!1:s;s=""}else{if(N(s)&&D)return l.wipe(),s;Array.isArray(s)?s=String(s.join("")):N(s)?s="":s=String(s)}let v=r.includes(".")?`${J(r)}.${p}`:p;if(T(s,o)){let m=H(R(e,s,v,o,a),o,w,a,v,p.trim());typeof m=="string"&&l.push(f.headsStartAt,f.tailsEndAt,m)}else{n[p]=s;let m=H(s,o,w,a,v,p.trim());typeof m=="string"&&l.push(f.headsStartAt,f.tailsEndAt,m)}}}}let d;try{d=I(t,o.heads,o.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(c){throw new Error(`json-variables/resolveString(): [THROW_ID_17] While trying to resolve string: "${t}" at path ${r}, something wrong with heads and tails was detected! Here's the internal error message:
|
|
14
|
-
${c}`)}let W=!1;d.length===1&&A(t,[[d[0].headsStartAt,d[0].tailsEndAt]]).trim()===""&&(W=!0);let $=y(d,!1,W);if(typeof $=="boolean"||$===null)return $;try{d=I(t,o.headsNoWrap,o.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(c){throw new Error(`json-variables/resolveString(): [THROW_ID_22] While trying to resolve string: "${t}" at path ${r}, something wrong with no-wrap heads and no-wrap tails was detected! Here's the internal error message:
|
|
15
|
-
${c}`)}d.length===1&&A(t,[[d[0].headsStartAt,d[0].tailsEndAt]]).trim()===""&&(W=!0);let E=y(d,!0,W);return O(E)||N(E)?E:l?.current()?A(t,l.current()):t}function de(e,t){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_01] Alas! Inputs are missing!");if(!V(e))throw new TypeError(`json-variables/jVar(): [THROW_ID_02] Alas! The input must be a plain object! Currently it's: ${Array.isArray(e)?"array":typeof e}`);if(t&&!V(t))throw new TypeError(`json-variables/jVar(): [THROW_ID_03] Alas! An Optional Options Object must be a plain object! Currently it's: ${Array.isArray(t)?"array":typeof t}`);let r={...K,...t};r.dontWrapVars?Array.isArray(r.dontWrapVars)||(r.dontWrapVars=F(r.dontWrapVars)):r.dontWrapVars=[];let o,i;if(r.dontWrapVars.length&&!r.dontWrapVars.every((a,l)=>g(a)?!0:(o=a,i=l,!1)))throw new Error(`json-variables/jVar(): [THROW_ID_05] Alas! All variable names set in resolvedOpts.dontWrapVars should be of a string type. Computer detected a value "${o}" at index ${i}, which is not string but ${Array.isArray(o)?"array":typeof o}!`);if(r.heads==="")throw new Error("json-variables/jVar(): [THROW_ID_06] Alas! resolvedOpts.heads are empty!");if(r.tails==="")throw new Error("json-variables/jVar(): [THROW_ID_07] Alas! resolvedOpts.tails are empty!");if(r.lookForDataContainers&&r.dataContainerIdentifierTails==="")throw new Error("json-variables/jVar(): [THROW_ID_08] Alas! resolvedOpts.dataContainerIdentifierTails is empty!");if(r.heads===r.tails)throw new Error("json-variables/jVar(): [THROW_ID_09] Alas! resolvedOpts.heads and resolvedOpts.tails can't be equal!");if(r.heads===r.headsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_10] Alas! resolvedOpts.heads and resolvedOpts.headsNoWrap can't be equal!");if(r.tails===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_11] Alas! resolvedOpts.tails and resolvedOpts.tailsNoWrap can't be equal!");if(r.headsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_12] Alas! resolvedOpts.headsNoWrap is an empty string!");if(r.tailsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_13] Alas! resolvedOpts.tailsNoWrap is an empty string!");if(r.headsNoWrap===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_14] Alas! resolvedOpts.headsNoWrap and resolvedOpts.tailsNoWrap can't be equal!");let n;return C(e,(a,l,y)=>{if(z(l)&&T(a,r))throw new Error(`json-variables/jVar(): [THROW_ID_15] Alas! Object keys can't contain variables!
|
|
16
|
-
Please check the following key: ${a}`);if(l!==void 0?n=l:n=a,n==="")return n;if(r.heads.length&&u(n)===u(r.heads)||r.tails.length&&u(n)===u(r.tails)||r.headsNoWrap.length&&u(n)===u(r.headsNoWrap)||r.tailsNoWrap.length&&u(n)===u(r.tailsNoWrap)){if(!r.noSingleMarkers)return n;throw new Error(`json-variables/jVar(): [THROW_ID_16] Alas! While processing the input, we stumbled upon ${u(n)} which is equal to ${u(n)===u(r.heads)?"heads":""}${u(n)===u(r.tails)?"tails":""}${g(r.headsNoWrap)&&u(n)===u(r.headsNoWrap)?"headsNoWrap":""}${g(r.tailsNoWrap)&&u(n)===u(r.tailsNoWrap)?"tailsNoWrap":""}. If you wouldn't have set resolvedOpts.noSingleMarkers to "true" this error would not happen and computer would have left the current element (${u(n)}) alone`)}return g(n)&&T(n,r)?R(e,n,y.path,r):n})}export{K as defaults,de as jVar,he as version};
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @name json-variables
|
|
3
|
-
* @fileoverview Resolves custom-marked, cross-referenced paths in parsed JSON
|
|
4
|
-
* @version 12.0.0
|
|
5
|
-
* @author Roy Revelt, Codsen Ltd
|
|
6
|
-
* @license MIT
|
|
7
|
-
* {@link https://codsen.com/os/json-variables/}
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
"use strict";var jsonVariables=(()=>{var sr=Object.create;var q=Object.defineProperty,or=Object.defineProperties,lr=Object.getOwnPropertyDescriptor,fr=Object.getOwnPropertyDescriptors,ur=Object.getOwnPropertyNames,Ke=Object.getOwnPropertySymbols,gr=Object.getPrototypeOf,Ue=Object.prototype.hasOwnProperty,cr=Object.prototype.propertyIsEnumerable;var me=(e,t,r)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t)=>{for(var r in t||(t={}))Ue.call(t,r)&&me(e,r,t[r]);if(Ke)for(var r of Ke(t))cr.call(t,r)&&me(e,r,t[r]);return e},K=(e,t)=>or(e,fr(t));var we=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hr=(e,t)=>{for(var r in t)q(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of ur(t))!Ue.call(e,l)&&l!==r&&q(e,l,{get:()=>t[l],enumerable:!(i=lr(t,l))||i.enumerable});return e};var U=(e,t,r)=>(r=e!=null?sr(gr(e)):{},Ge(t||!e||!e.__esModule?q(r,"default",{value:e,enumerable:!0}):r,e)),pr=e=>Ge(q({},"__esModule",{value:!0}),e);var be=(e,t,r)=>(me(e,typeof t!="symbol"?t+"":t,r),r);var je=we((G,P)=>{var dr=200,st="__lodash_hash_undefined__",ot=9007199254740991,Ee="[object Arguments]",yr="[object Array]",lt="[object Boolean]",ft="[object Date]",mr="[object Error]",Se="[object Function]",ut="[object GeneratorFunction]",te="[object Map]",gt="[object Number]",We="[object Object]",ze="[object Promise]",ct="[object RegExp]",re="[object Set]",ht="[object String]",pt="[object Symbol]",$e="[object WeakMap]",dt="[object ArrayBuffer]",ne="[object DataView]",yt="[object Float32Array]",mt="[object Float64Array]",wt="[object Int8Array]",bt="[object Int16Array]",Tt="[object Int32Array]",$t="[object Uint8Array]",Ot="[object Uint8ClampedArray]",vt="[object Uint16Array]",_t="[object Uint32Array]",wr=/[\\^$.*+?()[\]{}|]/g,br=/\w*$/,Tr=/^\[object .+?Constructor\]$/,$r=/^(?:0|[1-9]\d*)$/,O={};O[Ee]=O[yr]=O[dt]=O[ne]=O[lt]=O[ft]=O[yt]=O[mt]=O[wt]=O[bt]=O[Tt]=O[te]=O[gt]=O[We]=O[ct]=O[re]=O[ht]=O[pt]=O[$t]=O[Ot]=O[vt]=O[_t]=!0;O[mr]=O[Se]=O[$e]=!1;var Or=typeof global=="object"&&global&&global.Object===Object&&global,vr=typeof self=="object"&&self&&self.Object===Object&&self,N=Or||vr||Function("return this")(),At=typeof G=="object"&&G&&!G.nodeType&&G,Ye=At&&typeof P=="object"&&P&&!P.nodeType&&P,_r=Ye&&Ye.exports===At;function Ar(e,t){return e.set(t[0],t[1]),e}function Ir(e,t){return e.add(t),e}function Er(e,t){for(var r=-1,i=e?e.length:0;++r<i&&t(e[r],r,e)!==!1;);return e}function Sr(e,t){for(var r=-1,i=t.length,l=e.length;++r<i;)e[l+r]=t[r];return e}function It(e,t,r,i){var l=-1,n=e?e.length:0;for(i&&n&&(r=e[++l]);++l<n;)r=t(r,e[l],l,e);return r}function Wr(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}function Dr(e,t){return e==null?void 0:e[t]}function Et(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Xe(e){var t=-1,r=Array(e.size);return e.forEach(function(i,l){r[++t]=[l,i]}),r}function De(e,t){return function(r){return e(t(r))}}function Ze(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}var Nr=Array.prototype,xr=Function.prototype,ie=Object.prototype,Te=N["__core-js_shared__"],Qe=function(){var e=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),St=xr.toString,R=ie.hasOwnProperty,ae=ie.toString,Rr=RegExp("^"+St.call(R).replace(wr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),et=_r?N.Buffer:void 0,tt=N.Symbol,rt=N.Uint8Array,jr=De(Object.getPrototypeOf,Object),Cr=Object.create,Vr=ie.propertyIsEnumerable,Hr=Nr.splice,nt=Object.getOwnPropertySymbols,Mr=et?et.isBuffer:void 0,Pr=De(Object.keys,Object),Oe=F(N,"DataView"),z=F(N,"Map"),ve=F(N,"Promise"),_e=F(N,"Set"),Ae=F(N,"WeakMap"),Y=F(Object,"create"),Jr=M(Oe),Br=M(z),Fr=M(ve),kr=M(_e),Lr=M(Ae),it=tt?tt.prototype:void 0,at=it?it.valueOf:void 0;function H(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function qr(){this.__data__=Y?Y(null):{}}function Kr(e){return this.has(e)&&delete this.__data__[e]}function Ur(e){var t=this.__data__;if(Y){var r=t[e];return r===st?void 0:r}return R.call(t,e)?t[e]:void 0}function Gr(e){var t=this.__data__;return Y?t[e]!==void 0:R.call(t,e)}function zr(e,t){var r=this.__data__;return r[e]=Y&&t===void 0?st:t,this}H.prototype.clear=qr;H.prototype.delete=Kr;H.prototype.get=Ur;H.prototype.has=Gr;H.prototype.set=zr;function x(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Yr(){this.__data__=[]}function Xr(e){var t=this.__data__,r=se(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():Hr.call(t,r,1),!0}function Zr(e){var t=this.__data__,r=se(t,e);return r<0?void 0:t[r][1]}function Qr(e){return se(this.__data__,e)>-1}function en(e,t){var r=this.__data__,i=se(r,e);return i<0?r.push([e,t]):r[i][1]=t,this}x.prototype.clear=Yr;x.prototype.delete=Xr;x.prototype.get=Zr;x.prototype.has=Qr;x.prototype.set=en;function J(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function tn(){this.__data__={hash:new H,map:new(z||x),string:new H}}function rn(e){return oe(this,e).delete(e)}function nn(e){return oe(this,e).get(e)}function an(e){return oe(this,e).has(e)}function sn(e,t){return oe(this,e).set(e,t),this}J.prototype.clear=tn;J.prototype.delete=rn;J.prototype.get=nn;J.prototype.has=an;J.prototype.set=sn;function B(e){this.__data__=new x(e)}function on(){this.__data__=new x}function ln(e){return this.__data__.delete(e)}function fn(e){return this.__data__.get(e)}function un(e){return this.__data__.has(e)}function gn(e,t){var r=this.__data__;if(r instanceof x){var i=r.__data__;if(!z||i.length<dr-1)return i.push([e,t]),this;r=this.__data__=new J(i)}return r.set(e,t),this}B.prototype.clear=on;B.prototype.delete=ln;B.prototype.get=fn;B.prototype.has=un;B.prototype.set=gn;function cn(e,t){var r=xe(e)||Vn(e)?Wr(e.length,String):[],i=r.length,l=!!i;for(var n in e)(t||R.call(e,n))&&!(l&&(n=="length"||xn(n,i)))&&r.push(n);return r}function Wt(e,t,r){var i=e[t];(!(R.call(e,t)&&Rt(i,r))||r===void 0&&!(t in e))&&(e[t]=r)}function se(e,t){for(var r=e.length;r--;)if(Rt(e[r][0],t))return r;return-1}function hn(e,t){return e&&Dt(t,Re(t),e)}function Ie(e,t,r,i,l,n,o){var a;if(i&&(a=n?i(e,l,n,o):i(e)),a!==void 0)return a;if(!le(e))return e;var g=xe(e);if(g){if(a=Wn(e),!t)return In(e,a)}else{var s=V(e),c=s==Se||s==ut;if(Mn(e))return bn(e,t);if(s==We||s==Ee||c&&!n){if(Et(e))return n?e:{};if(a=Dn(c?{}:e),!t)return En(e,hn(a,e))}else{if(!O[s])return n?e:{};a=Nn(e,s,Ie,t)}}o||(o=new B);var h=o.get(e);if(h)return h;if(o.set(e,a),!g)var T=r?Sn(e):Re(e);return Er(T||e,function(y,u){T&&(u=y,y=e[u]),Wt(a,u,Ie(y,t,r,i,u,e,o))}),a}function pn(e){return le(e)?Cr(e):{}}function dn(e,t,r){var i=t(e);return xe(e)?i:Sr(i,r(e))}function yn(e){return ae.call(e)}function mn(e){if(!le(e)||jn(e))return!1;var t=Ct(e)||Et(e)?Rr:Tr;return t.test(M(e))}function wn(e){if(!xt(e))return Pr(e);var t=[];for(var r in Object(e))R.call(e,r)&&r!="constructor"&&t.push(r);return t}function bn(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function Ne(e){var t=new e.constructor(e.byteLength);return new rt(t).set(new rt(e)),t}function Tn(e,t){var r=t?Ne(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function $n(e,t,r){var i=t?r(Xe(e),!0):Xe(e);return It(i,Ar,new e.constructor)}function On(e){var t=new e.constructor(e.source,br.exec(e));return t.lastIndex=e.lastIndex,t}function vn(e,t,r){var i=t?r(Ze(e),!0):Ze(e);return It(i,Ir,new e.constructor)}function _n(e){return at?Object(at.call(e)):{}}function An(e,t){var r=t?Ne(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function In(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}function Dt(e,t,r,i){r||(r={});for(var l=-1,n=t.length;++l<n;){var o=t[l],a=i?i(r[o],e[o],o,r,e):void 0;Wt(r,o,a===void 0?e[o]:a)}return r}function En(e,t){return Dt(e,Nt(e),t)}function Sn(e){return dn(e,Re,Nt)}function oe(e,t){var r=e.__data__;return Rn(t)?r[typeof t=="string"?"string":"hash"]:r.map}function F(e,t){var r=Dr(e,t);return mn(r)?r:void 0}var Nt=nt?De(nt,Object):Bn,V=yn;(Oe&&V(new Oe(new ArrayBuffer(1)))!=ne||z&&V(new z)!=te||ve&&V(ve.resolve())!=ze||_e&&V(new _e)!=re||Ae&&V(new Ae)!=$e)&&(V=function(e){var t=ae.call(e),r=t==We?e.constructor:void 0,i=r?M(r):void 0;if(i)switch(i){case Jr:return ne;case Br:return te;case Fr:return ze;case kr:return re;case Lr:return $e}return t});function Wn(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&R.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Dn(e){return typeof e.constructor=="function"&&!xt(e)?pn(jr(e)):{}}function Nn(e,t,r,i){var l=e.constructor;switch(t){case dt:return Ne(e);case lt:case ft:return new l(+e);case ne:return Tn(e,i);case yt:case mt:case wt:case bt:case Tt:case $t:case Ot:case vt:case _t:return An(e,i);case te:return $n(e,i,r);case gt:case ht:return new l(e);case ct:return On(e);case re:return vn(e,i,r);case pt:return _n(e)}}function xn(e,t){return t=t==null?ot:t,!!t&&(typeof e=="number"||$r.test(e))&&e>-1&&e%1==0&&e<t}function Rn(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function jn(e){return!!Qe&&Qe in e}function xt(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ie;return e===r}function M(e){if(e!=null){try{return St.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Cn(e){return Ie(e,!0,!0)}function Rt(e,t){return e===t||e!==e&&t!==t}function Vn(e){return Hn(e)&&R.call(e,"callee")&&(!Vr.call(e,"callee")||ae.call(e)==Ee)}var xe=Array.isArray;function jt(e){return e!=null&&Pn(e.length)&&!Ct(e)}function Hn(e){return Jn(e)&&jt(e)}var Mn=Mr||Fn;function Ct(e){var t=le(e)?ae.call(e):"";return t==Se||t==ut}function Pn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ot}function le(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Jn(e){return!!e&&typeof e=="object"}function Re(e){return jt(e)?cn(e):wn(e)}function Bn(){return[]}function Fn(){return!1}P.exports=Cn});var Ce=we((_i,Mt)=>{var kn="[object Object]";function Ln(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function qn(e,t){return function(r){return e(t(r))}}var Kn=Function.prototype,Vt=Object.prototype,Ht=Kn.toString,Un=Vt.hasOwnProperty,Gn=Ht.call(Object),zn=Vt.toString,Yn=qn(Object.getPrototypeOf,Object);function Xn(e){return!!e&&typeof e=="object"}function Zn(e){if(!Xn(e)||zn.call(e)!=kn||Ln(e))return!1;var t=Yn(e);if(t===null)return!0;var r=Un.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Ht.call(r)==Gn}Mt.exports=Zn});var Ft=we((Bt,ce)=>{(function(e,t){"use strict";typeof ce=="object"&&typeof ce.exports=="object"?ce.exports=t():typeof define=="function"&&define.amd?define([],t):e.objectPath=t()})(Bt,function(){"use strict";var e=Object.prototype.toString;function t(c,h){return c==null?!1:Object.prototype.hasOwnProperty.call(c,h)}function r(c){if(!c||n(c)&&c.length===0)return!0;if(typeof c!="string"){for(var h in c)if(t(c,h))return!1;return!0}return!1}function i(c){return e.call(c)}function l(c){return typeof c=="object"&&i(c)==="[object Object]"}var n=Array.isArray||function(c){return e.call(c)==="[object Array]"};function o(c){return typeof c=="boolean"||i(c)==="[object Boolean]"}function a(c){var h=parseInt(c);return h.toString()===c?h:c}function g(c){c=c||{};var h=function(d){return Object.keys(h).reduce(function(f,p){return p==="create"||typeof h[p]=="function"&&(f[p]=h[p].bind(h,d)),f},{})},T;c.includeInheritedProps?T=function(){return!0}:T=function(d,f){return typeof f=="number"&&Array.isArray(d)||t(d,f)};function y(d,f){if(T(d,f))return d[f]}var u;c.includeInheritedProps?u=function(d,f){typeof f!="string"&&typeof f!="number"&&(f=String(f));var p=y(d,f);if(f==="__proto__"||f==="prototype"||f==="constructor"&&typeof p=="function")throw new Error("For security reasons, object's magic properties cannot be set");return p}:u=function(d,f){return y(d,f)};function w(d,f,p,m){if(typeof f=="number"&&(f=[f]),!f||f.length===0)return d;if(typeof f=="string")return w(d,f.split(".").map(a),p,m);var b=f[0],v=u(d,b);return f.length===1?((v===void 0||!m)&&(d[b]=p),v):(v===void 0&&(typeof f[1]=="number"?d[b]=[]:d[b]={}),w(d[b],f.slice(1),p,m))}return h.has=function(d,f){if(typeof f=="number"?f=[f]:typeof f=="string"&&(f=f.split(".")),!f||f.length===0)return!!d;for(var p=0;p<f.length;p++){var m=a(f[p]);if(typeof m=="number"&&n(d)&&m<d.length||(c.includeInheritedProps?m in Object(d):t(d,m)))d=d[m];else return!1}return!0},h.ensureExists=function(d,f,p){return w(d,f,p,!0)},h.set=function(d,f,p,m){return w(d,f,p,m)},h.insert=function(d,f,p,m){var b=h.get(d,f);m=~~m,n(b)||(b=[],h.set(d,f,b)),b.splice(m,0,p)},h.empty=function(d,f){if(!r(f)&&d!=null){var p,m;if(!!(p=h.get(d,f))){if(typeof p=="string")return h.set(d,f,"");if(o(p))return h.set(d,f,!1);if(typeof p=="number")return h.set(d,f,0);if(n(p))p.length=0;else if(l(p))for(m in p)T(p,m)&&delete p[m];else return h.set(d,f,null)}}},h.push=function(d,f){var p=h.get(d,f);n(p)||(p=[],h.set(d,f,p)),p.push.apply(p,Array.prototype.slice.call(arguments,2))},h.coalesce=function(d,f,p){for(var m,b=0,v=f.length;b<v;b++)if((m=h.get(d,f[b]))!==void 0)return m;return p},h.get=function(d,f,p){if(typeof f=="number"&&(f=[f]),!f||f.length===0)return d;if(d==null)return p;if(typeof f=="string")return h.get(d,f.split("."),p);var m=a(f[0]),b=u(d,m);return b===void 0?p:f.length===1?b:h.get(d[m],f.slice(1),p)},h.del=function(f,p){if(typeof p=="number"&&(p=[p]),f==null||r(p))return f;if(typeof p=="string")return h.del(f,p.split("."));var m=a(p[0]);if(u(f,m),!T(f,m))return f;if(p.length===1)n(f)?f.splice(m,1):delete f[m];else return h.del(f[m],p.slice(1));return f},h}var s=g();return s.create=g,s.withInheritedProps=g({includeInheritedProps:!0}),s})});var Oi={};hr(Oi,{defaults:()=>nr,jVar:()=>$i,version:()=>hi});var fe=U(je(),1),Pt=U(Ce(),1);function Qn(e){if(e.includes(".")){let t=e.lastIndexOf(".");if(!e.slice(0,t).includes("."))return e.slice(0,t);for(let r=t-1;r--;)if(e[r]===".")return e.slice(r+1,t)}return null}var Ve=Qn;function ue(e,t){let r={now:!1};function i(l,n,o,a){let g=(0,fe.default)(l),s,c=$({depth:-1,path:""},o);if(c.depth+=1,Array.isArray(g))for(let h=0,T=g.length;h<T&&!a.now;h++){let y=c.path?`${c.path}.${h}`:`${h}`;g[h]!==void 0?(c.parent=(0,fe.default)(g),c.parentType="array",c.parentKey=Ve(y),s=i(n(g[h],void 0,K($({},c),{path:y}),a),n,K($({},c),{path:y}),a),Number.isNaN(s)&&h<g.length?(g.splice(h,1),h-=1):g[h]=s):g.splice(h,1)}else if((0,Pt.default)(g))for(let h in g){if(a.now&&h!=null)break;let T=c.path?`${c.path}.${h}`:h;c.depth===0&&h!=null&&(c.topmostKey=h),c.parent=(0,fe.default)(g),c.parentType="object",c.parentKey=Ve(T),s=i(n(h,g[h],K($({},c),{path:T}),a),n,K($({},c),{path:T}),a),Number.isNaN(s)?delete g[h]:g[h]=s}return g}return i(e,t,{},r)}function He(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Me=new Map,Jt=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(r=>{if(typeof r!="string"){if(typeof r>"u")return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof r}' in the array`)}return!0})},ei=(e,t)=>{t=$({caseSensitive:!1},t);let r=e+JSON.stringify(t);if(Me.has(r))return Me.get(r);let i=e[0]==="!";i&&(e=e.slice(1)),e=He(e).replace(/\\\*/g,"[\\s\\S]*");let l=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return l.negated=i,Me.set(r,l),l},ti=(e,t,r,i)=>{if(e=Jt(e,"inputs"),t=Jt(t,"patterns"),t.length===0)return[];t=t.map(o=>ei(o,r));let{allPatterns:l}=r||{},n=[];for(let o of e){let a,g=[...t].fill(!1);for(let[s,c]of t.entries())if(c.test(o)&&(g[s]=!0,a=!c.negated,!a))break;if(!(a===!1||a===void 0&&t.some(s=>!s.negated)||l&&g.some((s,c)=>!s&&!t[c].negated))&&(n.push(o),i))break}return n};function ge(e,t,r){return ti(e,t,r,!0).length>0}var W=U(Ft(),1);function I(e){return typeof e!="string"?e:e.length?[e]:[]}function kt(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function he(e){return typeof e=="string"}var Lt={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},ri=e=>e+1;function ni(e,t,r,i,l=!1,n=ri){let o=typeof r=="function"?r():r;if(+t<0&&l&&o==="EOL")return o;let a=$($({},Lt),i);if(t>=e.length&&!l)return!1;let g=l?1:r.length,s=0,c=!1,h=!1,T=!1,y=a.maxMismatches,u=t,w=!1,d=!1,f=!1;function p(){return s===1&&y<a.maxMismatches-1}for(;e[u];){let m=n(u);if(a.trimBeforeMatching&&e[u].trim()===""){if(!e[m]&&l&&r==="EOL")return!0;u=n(u);continue}if(a&&!a.i&&a.trimCharsBeforeMatching&&a.trimCharsBeforeMatching.includes(e[u])||(a==null?void 0:a.i)&&a.trimCharsBeforeMatching&&a.trimCharsBeforeMatching.map(v=>v.toLowerCase()).includes(e[u].toLowerCase())){if(l&&r==="EOL"&&!e[m])return!0;u=n(u);continue}let b=m>u?r[r.length-g]:r[g-1];if(!a.i&&e[u]===b||a.i&&e[u].toLowerCase()===b.toLowerCase()){if(w||(w=!0),T||(T=!0),g===r.length){if(d=!0,y!==a.maxMismatches)return!1}else g===1&&(f=!0);if(g-=1,s++,p())return!1;if(!g)return s!==r.length||y===a.maxMismatches||!c?u:!1}else if(!c&&!s&&(c=!0),a.maxMismatches&&y&&u){y-=1;for(let v=0;v<=y;v++){let E=m>u?r[r.length-g+1+v]:r[g-2-v],ye=e[n(u)];if(E&&(!a.i&&e[u]===E||a.i&&e[u].toLowerCase()===E.toLowerCase())&&(!a.firstMustMatch||g!==r.length)){if(s++,p())return!1;g-=2,w=!0;break}else if(ye&&E&&(!a.i&&ye===E||a.i&&ye.toLowerCase()===E.toLowerCase())&&(!a.firstMustMatch||g!==r.length)){if(!s&&!a.hungry)return!1;g-=1,w=!0;break}else if(E===void 0&&y>=0&&w&&(!a.firstMustMatch||d)&&(!a.lastMustMatch||f))return u}w||(h=u)}else return u===0&&g===1&&!a.lastMustMatch&&T?0:!1;if(h!==!1&&h!==u&&(h=!1),g<1)return u;u=n(u)}if(g>0)return l&&o==="EOL"?!0:a&&a.maxMismatches>=g&&T?h||0:!1}function qt(e,t,r,i,l){var c,h;if(kt(l)&&Object.prototype.hasOwnProperty.call(l,"trimBeforeMatching")&&l&&typeof l.trimBeforeMatching!="boolean")throw new Error(`string-match-left-right/${e}(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!${Array.isArray(l.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);let n=$($({},Lt),l);if(typeof n.trimCharsBeforeMatching=="string"&&(n.trimCharsBeforeMatching=I(n.trimCharsBeforeMatching)),n.trimCharsBeforeMatching=n.trimCharsBeforeMatching.map(T=>he(T)?T:String(T)),!he(t)||!t.length)return!1;if(!Number.isInteger(r)||r<0)throw new Error(`string-match-left-right/${e}(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ${typeof r}, equal to:
|
|
11
|
-
${JSON.stringify(r,null,4)}`);let o,a;if(he(i))o=[i];else if(Array.isArray(i))o=i;else if(!i)o=i;else if(typeof i=="function")o=[],o.push(i);else throw new Error(`string-match-left-right/${e}(): [THROW_ID_05] the third argument, whatToMatch, is neither string nor array of strings! It's ${typeof i}, equal to:
|
|
12
|
-
${JSON.stringify(i,null,4)}`);if(l&&!kt(l))throw new Error(`string-match-left-right/${e}(): [THROW_ID_06] the fourth argument, options object, should be a plain object. Currently it's of a type "${typeof l}", and equal to:
|
|
13
|
-
${JSON.stringify(l,null,4)}`);let g=0,s="";if((n==null?void 0:n.trimCharsBeforeMatching)&&n.trimCharsBeforeMatching.some((T,y)=>T.length>1?(g=y,s=T,!0):!1))throw new Error(`string-match-left-right/${e}(): [THROW_ID_07] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ${g} is longer than 1 character, ${s.length} (equals to ${s}). Please split it into separate characters and put into array as separate elements.`);if(!o||!Array.isArray(o)||Array.isArray(o)&&!o.length||Array.isArray(o)&&o.length===1&&he(o[0])&&!o[0].trim()){if(typeof n.cb=="function"){let y,u=r;if((e==="matchLeftIncl"||e==="matchRight")&&(u+=1),e[5]==="L")for(let p=u;p--;){let m=t[p];if((!n.trimBeforeMatching||n.trimBeforeMatching&&m!==void 0&&m.trim())&&(!((c=n.trimCharsBeforeMatching)!=null&&c.length)||m!==void 0&&!n.trimCharsBeforeMatching.includes(m))){y=p;break}}else if(e.startsWith("matchRight"))for(let p=u;p<t.length;p++){let m=t[p];if((!n.trimBeforeMatching||n.trimBeforeMatching&&m.trim())&&(!((h=n.trimCharsBeforeMatching)!=null&&h.length)||!n.trimCharsBeforeMatching.includes(m))){y=p;break}}if(y===void 0)return!1;let w=t[y],d=y+1,f="";return d&&d>0&&(f=t.slice(0,d)),e[5]==="L"||y&&y>0&&(f=t.slice(y)),n.cb(w,f,y)}let T="";throw l||(T=" More so, the whole options object, the fourth input argument, is missing!"),new Error(`string-match-left-right/${e}(): [THROW_ID_08] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!${T}`)}for(let T=0,y=o.length;T<y;T++){a=typeof o[T]=="function";let u=o[T],w,d,f="",p=r;e==="matchRight"?p+=1:e==="matchLeft"&&(p-=1);let m=ni(t,p,u,n,a,b=>e[5]==="L"?b-1:b+1);if(m&&a&&typeof u=="function"&&u()==="EOL")return u()&&(n.cb?n.cb(w,f,d):!0)?u():!1;if(Number.isInteger(m)&&(d=e.startsWith("matchLeft")?m-1:m+1,e[5]==="L"?f=t.slice(0,m):f=t.slice(d)),d<0&&(d=void 0),t[d]&&(w=t[d]),Number.isInteger(m)&&(n.cb?n.cb(w,f,d):!0))return u}return!1}function k(e,t,r,i){return qt("matchLeftIncl",e,t,r,i)}function S(e,t,r,i){return qt("matchRightIncl",e,t,r,i)}function ii(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function D(e){return typeof e=="string"}var Kt={fromIndex:0,throwWhenSomethingWrongIsDetected:!0,allowWholeValueToBeOnlyHeadsOrTails:!0,source:"string-find-heads-tails",matchHeadsAndTailsStrictlyInPairsByTheirOrder:!1,relaxedAPI:!1};function Pe(e,t,r,i){if(i&&!ii(i))throw new TypeError(`string-find-heads-tails: [THROW_ID_01] the fourth input argument, an Optional Options Object, must be a plain object! Currently it's equal to: ${i} (type: ${typeof i})`);let l=$($({},Kt),i);if(typeof l.fromIndex=="string"&&/^\d*$/.test(l.fromIndex))l.fromIndex=Number(l.fromIndex);else if(!Number.isInteger(l.fromIndex)||l.fromIndex<0)throw new TypeError(`${l.source} [THROW_ID_18] the fourth input argument must be a natural number or zero! Currently it's: ${l.fromIndex}`);if(!D(e)||e.length===0){if(l.relaxedAPI)return[];throw new TypeError(`string-find-heads-tails: [THROW_ID_02] the first input argument, input string, must be a non-zero-length string! Currently it's: ${typeof e}, equal to: ${e}`)}let n,o;if(typeof t!="string"&&!Array.isArray(t)){if(l.relaxedAPI)return[];throw new TypeError(`string-find-heads-tails: [THROW_ID_03] the second input argument, heads, must be either a string or an array of strings! Currently it's: ${typeof t}, equal to:
|
|
14
|
-
${JSON.stringify(t,null,4)}`)}else if(typeof t=="string")if(t.length===0){if(l.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_04] the second input argument, heads, must be a non-empty string! Currently it's empty.")}else t=I(t);else if(Array.isArray(t))if(t.length===0){if(l.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_05] the second input argument, heads, must be a non-empty array and contain at least one string! Currently it's empty.")}else if(t.every((u,w)=>(n=u,o=w,D(u)))){if(!t.every((u,w)=>(o=w,D(u)&&u.length&&u.trim()!=="")))if(l.relaxedAPI){if(t=t.filter(u=>D(u)&&u.length),t.length===0)return[]}else throw new TypeError(`string-find-heads-tails: [THROW_ID_07] the second input argument, heads, should not contain empty strings! For example, there's one detected at index ${o} of heads array:
|
|
15
|
-
${JSON.stringify(t,null,4)}.`)}else if(l.relaxedAPI){if(t=t.filter(u=>D(u)&&u.length),t.length===0)return[]}else throw new TypeError(`string-find-heads-tails: [THROW_ID_06] the second input argument, heads, contains non-string elements! For example, element at ${o}th index is ${typeof n}, equal to:
|
|
16
|
-
${JSON.stringify(n,null,4)}. Whole heads array looks like:
|
|
17
|
-
${JSON.stringify(t,null,4)}`);if(typeof r!="string"&&!Array.isArray(r)){if(l.relaxedAPI)return[];throw new TypeError(`string-find-heads-tails: [THROW_ID_08] the third input argument, tails, must be either a string or an array of strings! Currently it's: ${typeof r}, equal to:
|
|
18
|
-
${JSON.stringify(r,null,4)}`)}else if(typeof r=="string")if(r.length===0){if(l.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_09] the third input argument, tails, must be a non-empty string! Currently it's empty.")}else r=I(r);else if(Array.isArray(r))if(r.length===0){if(l.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_10] the third input argument, tails, must be a non-empty array and contain at least one string! Currently it's empty.")}else if(r.every((u,w)=>(n=u,o=w,D(u)))){if(!r.every((u,w)=>(o=w,D(u)&&u.length&&u.trim()!=="")))if(l.relaxedAPI){if(r=r.filter(u=>D(u)&&u.length),r.length===0)return[]}else throw new TypeError(`string-find-heads-tails: [THROW_ID_12] the third input argument, tails, should not contain empty strings! For example, there's one detected at index ${o}. Whole tails array is equal to:
|
|
19
|
-
${JSON.stringify(r,null,4)}`)}else if(l.relaxedAPI){if(r=r.filter(u=>D(u)&&u.length),r.length===0)return[]}else throw new TypeError(`string-find-heads-tails: [THROW_ID_11] the third input argument, tails, contains non-string elements! For example, element at ${o}th index is ${typeof n}, equal to:
|
|
20
|
-
${JSON.stringify(n,null,4)}. Whole tails array is equal to:
|
|
21
|
-
${JSON.stringify(r,null,4)}`);let a=l.source===Kt.source;if(l.throwWhenSomethingWrongIsDetected&&!l.allowWholeValueToBeOnlyHeadsOrTails){if(I(t).includes(e))throw new Error(`${l.source}${a?": [THROW_ID_16]":""} the whole input string can't be equal to ${D(t)?"":"one of "}heads (${e})!`);if(I(r).includes(e))throw new Error(`${l.source}${a?": [THROW_ID_17]":""} the whole input string can't be equal to ${D(r)?"":"one of "}tails (${e})!`)}let g=t.concat(r).map(u=>u.charAt(0)).reduce((u,w)=>w.charCodeAt(0)>u[1]?[u[0],w.charCodeAt(0)]:w.charCodeAt(0)<u[0]?[w.charCodeAt(0),u[1]]:u,[t[0].charCodeAt(0),t[0].charCodeAt(0)]),s=[],c=!1,h={},T="",y;for(let u=l.fromIndex,w=e.length;u<w;u++){let d=e[u].charCodeAt(0);if(d<=g[1]&&d>=g[0]){let f=S(e,u,t);if(f&&l.matchHeadsAndTailsStrictlyInPairsByTheirOrder){for(let m=t.length;m--;)if(t[m]===f){y=m;break}}if(typeof f=="string")if(c){if(l.throwWhenSomethingWrongIsDetected)throw new TypeError(`${l.source}${a?": [THROW_ID_19]":""} When processing "${e}", we found heads (${e.slice(u,u+f.length)}) starting at character with index number "${u}" and there was another set of heads before it! Generally speaking, there should be "heads-tails-heads-tails", not "heads-heads-tails"!
|
|
22
|
-
We're talking about the area of the code:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
--------------------------------------starts
|
|
26
|
-
${e.slice(Math.max(u-200,0),u)}
|
|
27
|
-
${`\x1B[${33}m------->\x1B[${39}m`} ${`\x1B[${31}m${e.slice(u,u+f.length)}\x1B[${39}m`} \x1B[${33}m<-------\x1B[${39}m
|
|
28
|
-
${e.slice(u+f.length,Math.min(w,u+200))}
|
|
29
|
-
--------------------------------------ends
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
To turn off this error being thrown, set resolvedOpts.throwWhenSomethingWrongIsDetected to Boolean false.`)}else{h={},h.headsStartAt=u,h.headsEndAt=u+f.length,c=!0,u+=f.length-1,T&&(T="");continue}let p=S(e,u,r);if(c&&p&&l.matchHeadsAndTailsStrictlyInPairsByTheirOrder&&y!==void 0&&r[y]!==void 0&&r[y]!==p){let m;for(let b=r.length;b--;)if(r[b]===p){m=b;break}throw new TypeError(`${l.source}${a?": [THROW_ID_20]":""} When processing "${e}", we had "resolvedOpts.matchHeadsAndTailsStrictlyInPairsByTheirOrder" on. We found heads (${t[y]}) but the tails the followed it were not of the same index, ${y} (${r[y]}) but ${m} (${p}).`)}if(typeof p=="string")if(c){h.tailsStartAt=u,h.tailsEndAt=u+p.length,s.push(h),h={},c=!1,u+=p.length-1;continue}else l.throwWhenSomethingWrongIsDetected&&(T=`${l.source}${a?": [THROW_ID_21]":""} When processing "${e}", we found tails (${e.slice(u,u+p.length)}) starting at character with index number "${u}" but there were no heads preceding it. That's very naughty!`)}if(l.throwWhenSomethingWrongIsDetected&&u===w-1){if(Object.keys(h).length!==0)throw new TypeError(`${l.source}${a?": [THROW_ID_22]":""} When processing "${e}", we reached the end of the string and yet didn't find any tails (${JSON.stringify(r,null,4)}) to match the last detected heads (${e.slice(h.headsStartAt,h.headsEndAt)})!`);if(T)throw new Error(T)}}return s}var Je=U(je(),1);function Be(e,t,r){let i;r!==void 0&&(i=Array.isArray(r)?(0,Je.default)(r):[(0,Je.default)(r)]);let l=[],n=ue(e,(o,a,g)=>{let s=a!==void 0?a:o;if(a!==void 0&&ge(o,t,{caseSensitive:!0})){if(i===void 0)l.push({val:a,path:g.path});else if(i.length)return i.shift()}return s});return i===void 0?l:n}function pe(e,t=1){let r="\xA0";function i(n){return Array.from(n).reverse().join("")}function l(n,o,a){let g=a?`
|
|
33
|
-
`:"\r",s=a?"\r":`
|
|
34
|
-
`;if(!n)return n;let c=0,h=0,T="";for(let y=0,u=n.length;y<u;y++)(n[y]===g||n[y]===s&&n[y-1]!==g)&&h++,`\r
|
|
35
|
-
`.includes(n[y])||n[y]===r?(c=0,n[y]===r?T+=n[y]:n[y]===g?h<=o&&(T+=n[y],n[y+1]===s&&(T+=n[y+1],y++)):n[y]===s&&(n==null?void 0:n[y-1])!==g&&h<=o&&(T+=n[y])):(c++,!n[y+1]&&!h&&(T+=" "));return T}if(typeof e=="string"&&e.length){let n=1;typeof+t=="number"&&Number.isInteger(+t)&&+t>=0&&(n=+t);let o="",a="";if(!e.trim())o=e;else if(!e[0].trim()){for(let g=0,s=e.length;g<s;g++)if(e[g].trim()){o=e.slice(0,g);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===r)){for(let g=e.length;g--;)if(e[g].trim()){a=e.slice(g+1);break}}return`${l(o,n,!1)}${e.trim()}${i(l(i(a),n,!0))}`}return e}var ai={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Ut(e,t){if(!Array.isArray(e)||!e.length)return e;let r=$($({},ai),t),i,l;if(r.strictlyTwoElementsInRangeArrays&&!e.every((a,g)=>!Array.isArray(a)||a.length!==2?(i=g,l=a.length,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${i}th range (${JSON.stringify(e[i],null,4)}) has not two but ${l} elements!`);if(!e.every((a,g)=>!Array.isArray(a)||!Number.isInteger(a[0])||a[0]<0||!Number.isInteger(a[1])||a[1]<0?(i=g,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${i}th range (${JSON.stringify(e[i],null,4)}) does not consist of only natural numbers!`);let n=e.length**2,o=0;return Array.from(e).sort((a,g)=>(r.progressFn&&(o+=1,r.progressFn(Math.floor(o*100/n))),a[0]===g[0]?a[1]<g[1]?-1:a[1]>g[1]?1:0:a[0]<g[0]?-1:1))}var Gt={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function si(e,t){function r(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let i;if(t)if(r(t)){if(i=$($({},Gt),t),i.progressFn&&r(i.progressFn)&&!Object.keys(i.progressFn).length)i.progressFn=null;else if(i.progressFn&&typeof i.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "${typeof i.progressFn}", equal to ${JSON.stringify(i.progressFn,null,4)}`);if(![1,2,"1","2"].includes(i.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "${typeof i.mergeType}", equal to ${JSON.stringify(i.mergeType,null,4)}`);if(typeof i.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof i.joinRangesThatTouchEdges}", equal to ${JSON.stringify(i.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
|
|
36
|
-
${JSON.stringify(t,null,4)} (type ${typeof t})`);else i=$({},Gt);let l=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),n,o,a;i.progressFn?n=Ut(l,{progressFn:s=>{a=Math.floor(s/5),a!==o&&(o=a,i.progressFn(a))}}):n=Ut(l);let g=n.length-1;for(let s=g;s>0;s--)i.progressFn&&(a=Math.floor((1-s/g)*78)+21,a!==o&&a>o&&(o=a,i.progressFn(a))),(n[s][0]<=n[s-1][0]||!i.joinRangesThatTouchEdges&&n[s][0]<n[s-1][1]||i.joinRangesThatTouchEdges&&n[s][0]<=n[s-1][1])&&(n[s-1][0]=Math.min(n[s][0],n[s-1][0]),n[s-1][1]=Math.max(n[s][1],n[s-1][1]),n[s][2]!==void 0&&(n[s-1][0]>=n[s][0]||n[s-1][1]<=n[s][1])&&n[s-1][2]!==null&&(n[s][2]===null&&n[s-1][2]!==null?n[s-1][2]=null:n[s-1][2]!=null?+i.mergeType==2&&n[s-1][0]===n[s][0]?n[s-1][2]=n[s][2]:n[s-1][2]+=n[s][2]:n[s-1][2]=n[s][2]),n.splice(s,1),s=n.length);return n.length?n:null}function j(e){return e!=null}function C(e){return Number.isInteger(e)&&e>=0}function X(e){return typeof e=="string"}var oi={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},Z=class{constructor(e){be(this,"ranges");be(this,"opts");let t=$($({},oi),e);if(t.mergeType&&t.mergeType!==1&&t.mergeType!==2)if(X(t.mergeType)&&t.mergeType.trim()==="1")t.mergeType=1;else if(X(t.mergeType)&&t.mergeType.trim()==="2")t.mergeType=2;else throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof t.mergeType}", equal to ${JSON.stringify(t.mergeType,null,4)}`);this.opts=t,this.ranges=[]}add(e,t,r){var n;if(e==null&&t==null)return;if(j(e)&&!j(t)){if(Array.isArray(e)){if(e.length){if(e.some(o=>Array.isArray(o))){e.forEach(o=>{Array.isArray(o)&&this.add(...o)});return}e.length&&C(+e[0])&&C(+e[1])&&this.add(...e)}return}throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(e,null,0)}) but second-one, "to" is not (${JSON.stringify(t,null,0)})`)}else if(!j(e)&&j(t))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(t,null,0)}) but first-one, "from" is not (${JSON.stringify(e,null,0)})`);let i=+e,l=+t;if(C(r)&&(r=String(r)),C(i)&&C(l)){if(j(r)&&!X(r)&&!C(r))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof r}, equal to:
|
|
37
|
-
${JSON.stringify(r,null,4)}`);if(j(this.ranges)&&Array.isArray(this.last())&&i===this.last()[1]){if(this.last()[1]=l,this.last()[2],this.last()[2]!==null&&j(r)){let o=this.last()[2]&&this.last()[2].length&&(!((n=this.opts)!=null&&n.mergeType)||this.opts.mergeType===1)?`${this.last()[2]}${r}`:r;this.opts.limitToBeAddedWhitespace&&(o=pe(o,this.opts.limitLinebreaksCount)),X(o)&&!o.length||(this.last()[2]=o)}}else{this.ranges||(this.ranges=[]);let o=r!==void 0&&!(X(r)&&!r.length)?[i,l,r&&this.opts.limitToBeAddedWhitespace?pe(r,this.opts.limitLinebreaksCount):r]:[i,l];this.ranges.push(o)}}else throw C(i)&&i>=0?new TypeError(`ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it's of a type "${typeof l}" equal to: ${JSON.stringify(l,null,4)}`):new TypeError(`ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it's of a type "${typeof i}" equal to: ${JSON.stringify(i,null,4)}`)}push(e,t,r){this.add(e,t,r)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=si(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>j(e[2])?[e[0],e[1],pe(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}wipe(){this.ranges=[]}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&C(e[0][0]))this.ranges=Array.from(e);else throw new Error(`ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ${JSON.stringify(e[0],null,4)} should be an array and its first element should be an integer, a string index.`);else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var li={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Fe(e,t){if(!Array.isArray(e)||!e.length)return e;let r=$($({},li),t),i,l;if(r.strictlyTwoElementsInRangeArrays&&!e.every((a,g)=>!Array.isArray(a)||a.length!==2?(i=g,l=a.length,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${i}th range (${JSON.stringify(e[i],null,4)}) has not two but ${l} elements!`);if(!e.every((a,g)=>!Array.isArray(a)||!Number.isInteger(a[0])||a[0]<0||!Number.isInteger(a[1])||a[1]<0?(i=g,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${i}th range (${JSON.stringify(e[i],null,4)}) does not consist of only natural numbers!`);let n=e.length**2,o=0;return Array.from(e).sort((a,g)=>(r.progressFn&&(o+=1,r.progressFn(Math.floor(o*100/n))),a[0]===g[0]?a[1]<g[1]?-1:a[1]>g[1]?1:0:a[0]<g[0]?-1:1))}var zt={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Yt(e,t){function r(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let i;if(t)if(r(t)){if(i=$($({},zt),t),i.progressFn&&r(i.progressFn)&&!Object.keys(i.progressFn).length)i.progressFn=null;else if(i.progressFn&&typeof i.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof i.progressFn}", equal to ${JSON.stringify(i.progressFn,null,4)}`);if(![1,2,"1","2"].includes(i.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof i.mergeType}", equal to ${JSON.stringify(i.mergeType,null,4)}`);if(typeof i.joinRangesThatTouchEdges!="boolean")throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof i.joinRangesThatTouchEdges}", equal to ${JSON.stringify(i.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
|
|
38
|
-
${JSON.stringify(t,null,4)} (type ${typeof t})`);else i=$({},zt);let l=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),n,o,a;i.progressFn?n=Fe(l,{progressFn:s=>{a=Math.floor(s/5),a!==o&&(o=a,i.progressFn(a))}}):n=Fe(l);let g=n.length-1;for(let s=g;s>0;s--)i.progressFn&&(a=Math.floor((1-s/g)*78)+21,a!==o&&a>o&&(o=a,i.progressFn(a))),(n[s][0]<=n[s-1][0]||!i.joinRangesThatTouchEdges&&n[s][0]<n[s-1][1]||i.joinRangesThatTouchEdges&&n[s][0]<=n[s-1][1])&&(n[s-1][0]=Math.min(n[s][0],n[s-1][0]),n[s-1][1]=Math.max(n[s][1],n[s-1][1]),n[s][2]!==void 0&&(n[s-1][0]>=n[s][0]||n[s-1][1]<=n[s][1])&&n[s-1][2]!==null&&(n[s][2]===null&&n[s-1][2]!==null?n[s-1][2]=null:n[s-1][2]!=null?+i.mergeType==2&&n[s-1][0]===n[s][0]?n[s-1][2]=n[s][2]:n[s-1][2]+=n[s][2]:n[s-1][2]=n[s][2]),n.splice(s,1),s=n.length);return n.length?n:null}var fi=!0,ke="Invariant failed";function Xt(e,t){if(!e){if(fi)throw new Error(ke);var r=typeof t=="function"?t():t,i=r?"".concat(ke,": ").concat(r):ke;throw new Error(i)}}function L(e,t,r){let i=0,l=0;if(arguments.length===0)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError(`ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(t&&!Array.isArray(t))throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof t}, equal to: ${JSON.stringify(t,null,4)}`);if(r&&typeof r!="function")throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof r}, equal to: ${JSON.stringify(r,null,4)}`);if(!t||!t.filter(c=>c).length)return e;let n;Array.isArray(t)&&Number.isInteger(t[0])&&Number.isInteger(t[1])?n=[Array.from(t)]:n=Array.from(t);let o=n.length,a=0;n.filter(c=>c).forEach((c,h)=>{if(r&&(i=Math.floor(a/o*10),i!==l&&(l=i,r(i))),!Array.isArray(c))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${h}th element not an array: ${JSON.stringify(c,null,4)}, which is ${typeof c}`);if(!Number.isInteger(c[0])){if(!Number.isInteger(+c[0])||+c[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${h}th element, array ${JSON.stringify(c,null,0)}. Its first element is not an integer, string index, but ${typeof c[0]}, equal to: ${JSON.stringify(c[0],null,4)}.`);n[h][0]=+n[h][0]}if(!Number.isInteger(c[1])){if(!Number.isInteger(+c[1])||+c[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${h}th element, array ${JSON.stringify(c,null,0)}. Its second element is not an integer, string index, but ${typeof c[1]}, equal to: ${JSON.stringify(c[1],null,4)}.`);n[h][1]=+n[h][1]}a+=1});let g=Yt(n,{progressFn:c=>{r&&(i=10+Math.floor(c/10),i!==l&&(l=i,r(i)))}});Xt(g);let s=g.length;if(s>0){let c=e.slice(g[s-1][1]);e=g.reduce((h,T,y,u)=>{r&&(i=20+Math.floor(y/s*80),i!==l&&(l=i,r(i)));let w=y===0?0:u[y-1][1],d=u[y][0];return`${h}${e.slice(w,d)}${u[y][2]||""}`},""),e+=c}return e}var Zt=U(Ce(),1);var ui={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function Q(e,t){if(typeof e!="string")throw new Error(`string-trim-spaces-only: [THROW_ID_01] input must be string! It was given as ${typeof e}, equal to:
|
|
39
|
-
${JSON.stringify(e,null,4)}`);let r=$($({},ui),t);function i(o){return r.classicTrim&&!o.trim()||!r.classicTrim&&(r.space&&o===" "||r.cr&&o==="\r"||r.lf&&o===`
|
|
40
|
-
`||r.tab&&o===" "||r.nbsp&&o==="\xA0")}let l,n;if(e.length){if(i(e[0]))for(let o=0,a=e.length;o<a;o++){if(!i(e[o])){l=o;break}if(o===e.length-1)return{res:"",ranges:[[0,e.length]]}}if(i(e[e.length-1])){for(let o=e.length;o--;)if(!i(e[o])){n=o+1;break}}return l?n?{res:e.slice(l,n),ranges:[[0,l],[n,e.length]]}:{res:e.slice(l),ranges:[[0,l]]}:n?{res:e.slice(0,n),ranges:[[n,e.length]]}:{res:e,ranges:[]}}return{res:"",ranges:[]}}var gi={heads:["{{"],tails:["}}"]};function Qt(e,t){let r=Object.prototype.hasOwnProperty;if(e===void 0)throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_01] The input is missing!");if(typeof e!="string")return e;if(t&&!(0,Zt.default)(t))throw new Error(`string-remove-duplicate-heads-tails: [THROW_ID_03] The given options are not a plain object but ${typeof t}!`);let i=$({},t);if(i&&r.call(i,"heads"))if(I(i.heads).every(w=>typeof w=="string"||Array.isArray(w)))typeof i.heads=="string"&&(i.heads=I(i.heads));else throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_04] The resolvedOpts.heads contains elements which are not string-type!");if(i&&r.call(i,"tails"))if(I(i.tails).every(w=>typeof w=="string"||Array.isArray(w)))typeof i.tails=="string"&&(i.tails=I(i.tails));else throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_05] The resolvedOpts.tails contains elements which are not string-type!");let l=Q(e).res;if(l.length===0)return e;e=l;let n=$($({},gi),i);n.heads=n.heads.map(w=>w.trim()),n.tails=n.tails.map(w=>w.trim());let o=!1,a=!1,g=new Z({limitToBeAddedWhitespace:!0}),s=new Z({limitToBeAddedWhitespace:!0}),c=!0,h=!0,T="";function y(w,d){let f;return S(w,0,d.heads,{trimBeforeMatching:!0,cb:(p,m,b)=>(f=b,!0)})&&S(w,f,d.tails,{trimBeforeMatching:!0,cb:(p,m,b)=>(f=b,!0)})?w.slice(f):w}for(;e!==y(e,n);)e=Q(y(e,n)).res;function u(w,d){let f;return!k(w,w.length-1,d.tails,{trimBeforeMatching:!0,cb:(p,m,b)=>(f=b,!0)})||!f?w:k(w,f,d.heads,{trimBeforeMatching:!0,cb:(p,m,b)=>(f=b,!0)})?w.slice(0,f+1):w}for(;e!==u(e,n);)e=Q(u(e,n)).res;if(!n.heads.length||!S(e,0,n.heads,{trimBeforeMatching:!0})||!n.tails.length||!k(e,e.length-1,n.tails,{trimBeforeMatching:!0}))return Q(e).res;for(let w=0,d=e.length;w<d;w++)if(e[w].trim()!==""){let f;if(S(e,w,n.heads,{trimBeforeMatching:!0,cb:(p,m,b)=>(f=b,!0)})&&f){h=!0,c&&(c=!0);let p;S(e,f,n.tails,{trimBeforeMatching:!0,cb:(m,b,v)=>(p=v,!0)})&&g.push(w,p),s.current()&&o&&T!=="tails"&&g.push(s.current()),o||s.current()&&(g.push(s.current()),s.wipe()),s.push(w,f),T="heads",w=f-1;continue}if(S(e,w,n.tails,{trimBeforeMatching:!0,cb:(p,m,b)=>(f=Number.isInteger(b)?b:e.length,!0)})&&f){h=!0,c?(T==="heads"&&s.wipe(),c=!1):s.push(w,f),T="tails",w=f-1;continue}c&&(c=!0),h&&!o?(o=!0,h=!1):h&&!a?(a=!0,c=!0,h=!1,T==="heads"&&s.wipe()):h&&a&&s.wipe()}return s.current()&&g.push(s.current()),g.current()?L(e,g.current()).trim():e.trim()}var er="12.0.0";var hi=er,pi=Object.prototype.hasOwnProperty,nr={heads:"%%_",tails:"_%%",headsNoWrap:"%%-",tailsNoWrap:"-%%",lookForDataContainers:!0,dataContainerIdentifierTails:"_data",wrapHeadsWith:"",wrapTailsWith:"",dontWrapVars:[],preventDoubleWrapping:!0,wrapGlobalFlipSwitch:!0,noSingleMarkers:!1,resolveToBoolIfAnyValuesContainBool:!0,resolveToFalseIfAnyValuesContainBool:!0,throwWhenNonStringInsertedInString:!1,allowUnresolved:!1};function A(e){return typeof e=="string"}function di(e){return typeof e=="number"}function Le(e){return typeof e=="boolean"}function de(e){return e===null}function ee(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function yi(e){return e!=null}function _(e){return A(e)?e.trim():e}function mi(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=0,r=e.length;t<r;t++)if(e[t]===".")return e.slice(0,t)}return e}function wi(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=0,r=e.length;t<r;t++)if(e[t]===".")return e.slice(t+1)}return e}function ir(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(0,t)}return e}function tr(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(t+1)}return e}function qe(e,t){return typeof e!="string"||!e.trim()?!1:!!(e.includes(t.heads)||e.includes(t.tails)||A(t.headsNoWrap)&&t.headsNoWrap.length&&e.includes(t.headsNoWrap)||A(t.tailsNoWrap)&&t.tailsNoWrap.length&&e.includes(t.tailsNoWrap))}function bi(e,t,r){let i,l;return typeof e=="string"&&e.length&&S(e,0,t,{trimBeforeMatching:!0,cb:(n,o,a)=>(i=a,!0)})&&k(e,e.length-1,r,{trimBeforeMatching:!0,cb:(n,o,a)=>(l=(a||0)+1,!0)})?e.slice(i,l):e}function rr(e,t,r=!1,i,l,n){if(t.wrapHeadsWith||(t.wrapHeadsWith=""),t.wrapTailsWith||(t.wrapTailsWith=""),A(e)&&!r&&t.wrapGlobalFlipSwitch&&!t.dontWrapVars.some(o=>ge(n,o))&&(!t.preventDoubleWrapping||t.preventDoubleWrapping&&A(e)&&!e.includes(t.wrapHeadsWith)&&!e.includes(t.wrapTailsWith)))return`${t.wrapHeadsWith}${e}${t.wrapTailsWith}`;if(r){if(!A(e))return e;let o=Qt(e,{heads:t.wrapHeadsWith,tails:t.wrapTailsWith});return A(o)?bi(o,t.wrapHeadsWith,t.wrapTailsWith):o}return e}function Ti(e,t,r,i){let l;if(r.indexOf(".")!==-1){let n=r,o=!0;if(i.lookForDataContainers&&typeof i.dataContainerIdentifierTails=="string"&&i.dataContainerIdentifierTails.length&&!n.endsWith(i.dataContainerIdentifierTails)){let a=W.default.get(e,n+i.dataContainerIdentifierTails);ee(a)&&W.default.get(a,t)&&(l=W.default.get(a,t),o=!1)}for(;o&&n.indexOf(".")!==-1;){if(n=ir(n),tr(n)===t)throw new Error(`json-variables/findValues(): [THROW_ID_20] While trying to resolve: "${t}" at path "${r}", we encountered a closed loop. The parent key "${tr(n)}" is called the same as the variable "${t}" we're looking for.`);if(i.lookForDataContainers&&typeof i.dataContainerIdentifierTails=="string"&&i.dataContainerIdentifierTails.length&&!n.endsWith(i.dataContainerIdentifierTails)){let a=W.default.get(e,n+i.dataContainerIdentifierTails);ee(a)&&W.default.get(a,t)&&(l=W.default.get(a,t),o=!1)}if(l===void 0){let a=W.default.get(e,n);ee(a)&&W.default.get(a,t)&&(l=W.default.get(a,t),o=!1)}}}if(l===void 0){let n=W.default.get(e,t);n!==void 0&&(l=n)}if(l===void 0)if(t.indexOf(".")===-1){let n=Be(e,t);if(n.length){for(let o=0,a=n.length;o<a;o++)if(A(n[o].val)||Le(n[o].val)||de(n[o].val)){l=n[o].val;break}else if(di(n[o].val)){l=String(n[o].val);break}else if(Array.isArray(n[o].val)){l=n[o].val.join("");break}}}else{let n=Be(e,mi(t));if(n.length)for(let o=0,a=n.length;o<a;o++){let g=W.default.get(n[o].val,wi(t));g&&A(g)&&(l=g)}}return l}function ar(e,t,r,i,l=[]){if(l.includes(r)){let y="";if(l.length>1){let u=` \u2192
|
|
41
|
-
`;y=l.reduce((w,d,f)=>w+(f===0?"":u)+(d===r?"\u{1F4A5} ":" ")+d,` Here's the path we travelled up until we hit the recursion:
|
|
42
|
-
|
|
43
|
-
`),y+=`${u}\u{1F4A5} ${r}`}throw new Error(`json-variables/resolveString(): [THROW_ID_19] While trying to resolve: "${t}" at path "${r}", we encountered a closed loop, the key is referencing itself."${y}`)}let n={},o=Array.from(l);o.push(r);let a=new Z;function g(y,u,w){for(let d=0,f=y.length;d<f;d++){let p=y[d],m=t.slice(p.headsEndAt,p.tailsStartAt);if(m.length===0)a.push(p.headsStartAt,p.tailsEndAt);else if(pi.call(n,m)&&A(n[m]))a.push(p.headsStartAt,p.tailsEndAt,n[m]);else{let b=Ti(e,m.trim(),r,i);if(b===void 0)if(i.allowUnresolved===!0)b="";else if(typeof i.allowUnresolved=="string")b=i.allowUnresolved;else throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_18] We couldn't find the value to resolve the variable ${t.slice(p.headsEndAt,p.tailsStartAt)}. We're at path: "${r}".`);if(!w&&i.throwWhenNonStringInsertedInString&&!A(b))throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ${t.slice(p.headsEndAt,p.tailsStartAt)} at path ${r}, it resolved into a non-string value, ${JSON.stringify(b,null,4)}. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").`);if(Le(b)){if(i.resolveToBoolIfAnyValuesContainBool)return a.wipe(),i.resolveToFalseIfAnyValuesContainBool?!1:b;b=""}else{if(de(b)&&w)return a.wipe(),b;Array.isArray(b)?b=String(b.join("")):de(b)?b="":b=String(b)}let v=r.includes(".")?`${ir(r)}.${m}`:m;if(qe(b,i)){let E=rr(ar(e,b,v,i,o),i,u,o,v,m.trim());typeof E=="string"&&a.push(p.headsStartAt,p.tailsEndAt,E)}else{n[m]=b;let E=rr(b,i,u,o,v,m.trim());typeof E=="string"&&a.push(p.headsStartAt,p.tailsEndAt,E)}}}}let s;try{s=Pe(t,i.heads,i.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(y){throw new Error(`json-variables/resolveString(): [THROW_ID_17] While trying to resolve string: "${t}" at path ${r}, something wrong with heads and tails was detected! Here's the internal error message:
|
|
44
|
-
${y}`)}let c=!1;s.length===1&&L(t,[[s[0].headsStartAt,s[0].tailsEndAt]]).trim()===""&&(c=!0);let h=g(s,!1,c);if(typeof h=="boolean"||h===null)return h;try{s=Pe(t,i.headsNoWrap,i.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(y){throw new Error(`json-variables/resolveString(): [THROW_ID_22] While trying to resolve string: "${t}" at path ${r}, something wrong with no-wrap heads and no-wrap tails was detected! Here's the internal error message:
|
|
45
|
-
${y}`)}s.length===1&&L(t,[[s[0].headsStartAt,s[0].tailsEndAt]]).trim()===""&&(c=!0);let T=g(s,!0,c);return Le(T)||de(T)?T:a!=null&&a.current()?L(t,a.current()):t}function $i(e,t){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_01] Alas! Inputs are missing!");if(!ee(e))throw new TypeError(`json-variables/jVar(): [THROW_ID_02] Alas! The input must be a plain object! Currently it's: ${Array.isArray(e)?"array":typeof e}`);if(t&&!ee(t))throw new TypeError(`json-variables/jVar(): [THROW_ID_03] Alas! An Optional Options Object must be a plain object! Currently it's: ${Array.isArray(t)?"array":typeof t}`);let r=$($({},nr),t);r.dontWrapVars?Array.isArray(r.dontWrapVars)||(r.dontWrapVars=I(r.dontWrapVars)):r.dontWrapVars=[];let i,l;if(r.dontWrapVars.length&&!r.dontWrapVars.every((o,a)=>A(o)?!0:(i=o,l=a,!1)))throw new Error(`json-variables/jVar(): [THROW_ID_05] Alas! All variable names set in resolvedOpts.dontWrapVars should be of a string type. Computer detected a value "${i}" at index ${l}, which is not string but ${Array.isArray(i)?"array":typeof i}!`);if(r.heads==="")throw new Error("json-variables/jVar(): [THROW_ID_06] Alas! resolvedOpts.heads are empty!");if(r.tails==="")throw new Error("json-variables/jVar(): [THROW_ID_07] Alas! resolvedOpts.tails are empty!");if(r.lookForDataContainers&&r.dataContainerIdentifierTails==="")throw new Error("json-variables/jVar(): [THROW_ID_08] Alas! resolvedOpts.dataContainerIdentifierTails is empty!");if(r.heads===r.tails)throw new Error("json-variables/jVar(): [THROW_ID_09] Alas! resolvedOpts.heads and resolvedOpts.tails can't be equal!");if(r.heads===r.headsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_10] Alas! resolvedOpts.heads and resolvedOpts.headsNoWrap can't be equal!");if(r.tails===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_11] Alas! resolvedOpts.tails and resolvedOpts.tailsNoWrap can't be equal!");if(r.headsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_12] Alas! resolvedOpts.headsNoWrap is an empty string!");if(r.tailsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_13] Alas! resolvedOpts.tailsNoWrap is an empty string!");if(r.headsNoWrap===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_14] Alas! resolvedOpts.headsNoWrap and resolvedOpts.tailsNoWrap can't be equal!");let n;return ue(e,(o,a,g)=>{if(yi(a)&&qe(o,r))throw new Error(`json-variables/jVar(): [THROW_ID_15] Alas! Object keys can't contain variables!
|
|
46
|
-
Please check the following key: ${o}`);if(a!==void 0?n=a:n=o,n==="")return n;if(r.heads.length&&_(n)===_(r.heads)||r.tails.length&&_(n)===_(r.tails)||r.headsNoWrap.length&&_(n)===_(r.headsNoWrap)||r.tailsNoWrap.length&&_(n)===_(r.tailsNoWrap)){if(!r.noSingleMarkers)return n;throw new Error(`json-variables/jVar(): [THROW_ID_16] Alas! While processing the input, we stumbled upon ${_(n)} which is equal to ${_(n)===_(r.heads)?"heads":""}${_(n)===_(r.tails)?"tails":""}${A(r.headsNoWrap)&&_(n)===_(r.headsNoWrap)?"headsNoWrap":""}${A(r.tailsNoWrap)&&_(n)===_(r.tailsNoWrap)?"tailsNoWrap":""}. If you wouldn't have set resolvedOpts.noSingleMarkers to "true" this error would not happen and computer would have left the current element (${_(n)}) alone`)}return A(n)&&qe(n,r)?ar(e,n,g.path,r):n})}return pr(Oi);})();
|
|
47
|
-
/**
|
|
48
|
-
* @name arrayiffy-if-string
|
|
49
|
-
* @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
|
|
50
|
-
* @version 5.0.0
|
|
51
|
-
* @author Roy Revelt, Codsen Ltd
|
|
52
|
-
* @license MIT
|
|
53
|
-
* {@link https://codsen.com/os/arrayiffy-if-string/}
|
|
54
|
-
*/
|
|
55
|
-
/**
|
|
56
|
-
* @name ast-get-values-by-key
|
|
57
|
-
* @fileoverview Extract values and paths from AST by keys OR set them by keys
|
|
58
|
-
* @version 5.0.0
|
|
59
|
-
* @author Roy Revelt, Codsen Ltd
|
|
60
|
-
* @license MIT
|
|
61
|
-
* {@link https://codsen.com/os/ast-get-values-by-key/}
|
|
62
|
-
*/
|
|
63
|
-
/**
|
|
64
|
-
* @name ast-monkey-traverse
|
|
65
|
-
* @fileoverview Utility library to traverse AST
|
|
66
|
-
* @version 4.0.0
|
|
67
|
-
* @author Roy Revelt, Codsen Ltd
|
|
68
|
-
* @license MIT
|
|
69
|
-
* {@link https://codsen.com/os/ast-monkey-traverse/}
|
|
70
|
-
*/
|
|
71
|
-
/**
|
|
72
|
-
* @name ast-monkey-util
|
|
73
|
-
* @fileoverview Utility library of AST helper functions
|
|
74
|
-
* @version 3.0.0
|
|
75
|
-
* @author Roy Revelt, Codsen Ltd
|
|
76
|
-
* @license MIT
|
|
77
|
-
* {@link https://codsen.com/os/ast-monkey-util/}
|
|
78
|
-
*/
|
|
79
|
-
/**
|
|
80
|
-
* @name ranges-apply
|
|
81
|
-
* @fileoverview Take an array of string index ranges, delete/replace the string according to them
|
|
82
|
-
* @version 7.0.0
|
|
83
|
-
* @author Roy Revelt, Codsen Ltd
|
|
84
|
-
* @license MIT
|
|
85
|
-
* {@link https://codsen.com/os/ranges-apply/}
|
|
86
|
-
*/
|
|
87
|
-
/**
|
|
88
|
-
* @name ranges-merge
|
|
89
|
-
* @fileoverview Merge and sort string index ranges
|
|
90
|
-
* @version 9.0.0
|
|
91
|
-
* @author Roy Revelt, Codsen Ltd
|
|
92
|
-
* @license MIT
|
|
93
|
-
* {@link https://codsen.com/os/ranges-merge/}
|
|
94
|
-
*/
|
|
95
|
-
/**
|
|
96
|
-
* @name ranges-push
|
|
97
|
-
* @fileoverview Gather string index ranges
|
|
98
|
-
* @version 7.0.0
|
|
99
|
-
* @author Roy Revelt, Codsen Ltd
|
|
100
|
-
* @license MIT
|
|
101
|
-
* {@link https://codsen.com/os/ranges-push/}
|
|
102
|
-
*/
|
|
103
|
-
/**
|
|
104
|
-
* @name ranges-sort
|
|
105
|
-
* @fileoverview Sort string index ranges
|
|
106
|
-
* @version 6.0.0
|
|
107
|
-
* @author Roy Revelt, Codsen Ltd
|
|
108
|
-
* @license MIT
|
|
109
|
-
* {@link https://codsen.com/os/ranges-sort/}
|
|
110
|
-
*/
|
|
111
|
-
/**
|
|
112
|
-
* @name string-collapse-leading-whitespace
|
|
113
|
-
* @fileoverview Collapse the leading and trailing whitespace of a string
|
|
114
|
-
* @version 7.0.0
|
|
115
|
-
* @author Roy Revelt, Codsen Ltd
|
|
116
|
-
* @license MIT
|
|
117
|
-
* {@link https://codsen.com/os/string-collapse-leading-whitespace/}
|
|
118
|
-
*/
|
|
119
|
-
/**
|
|
120
|
-
* @name string-find-heads-tails
|
|
121
|
-
* @fileoverview Finds where are arbitrary templating marker heads and tails located
|
|
122
|
-
* @version 6.0.0
|
|
123
|
-
* @author Roy Revelt, Codsen Ltd
|
|
124
|
-
* @license MIT
|
|
125
|
-
* {@link https://codsen.com/os/string-find-heads-tails/}
|
|
126
|
-
*/
|
|
127
|
-
/**
|
|
128
|
-
* @name string-match-left-right
|
|
129
|
-
* @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
|
|
130
|
-
* @version 9.0.0
|
|
131
|
-
* @author Roy Revelt, Codsen Ltd
|
|
132
|
-
* @license MIT
|
|
133
|
-
* {@link https://codsen.com/os/string-match-left-right/}
|
|
134
|
-
*/
|
|
135
|
-
/**
|
|
136
|
-
* @name string-remove-duplicate-heads-tails
|
|
137
|
-
* @fileoverview Detect and (recursively) remove head and tail wrappings around the input string
|
|
138
|
-
* @version 7.0.0
|
|
139
|
-
* @author Roy Revelt, Codsen Ltd
|
|
140
|
-
* @license MIT
|
|
141
|
-
* {@link https://codsen.com/os/string-remove-duplicate-heads-tails/}
|
|
142
|
-
*/
|
|
143
|
-
/**
|
|
144
|
-
* @name string-trim-spaces-only
|
|
145
|
-
* @fileoverview Like String.trim() but you can choose granularly what to trim
|
|
146
|
-
* @version 5.0.0
|
|
147
|
-
* @author Roy Revelt, Codsen Ltd
|
|
148
|
-
* @license MIT
|
|
149
|
-
* {@link https://codsen.com/os/string-trim-spaces-only/}
|
|
150
|
-
*/
|