json-variables 12.0.19 → 12.0.23
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 +1 -1
- package/dist/json-variables.esm.js +2 -2
- package/dist/json-variables.umd.js +41 -41
- package/package.json +12 -12
- package/types/index.d.ts +2 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2010-
|
|
3
|
+
Copyright (c) 2010-2025 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
|
@@ -64,6 +64,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
64
64
|
|
|
65
65
|
MIT License.
|
|
66
66
|
|
|
67
|
-
Copyright © 2010-
|
|
67
|
+
Copyright © 2010-2025 Roy Revelt and other contributors.
|
|
68
68
|
|
|
69
69
|
<p align="center"><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"></p>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name json-variables
|
|
3
3
|
* @fileoverview Resolves custom-marked, cross-referenced paths in parsed JSON
|
|
4
|
-
* @version 12.0.
|
|
4
|
+
* @version 12.0.23
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/json-variables/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{matchLeftIncl as k,matchRightIncl as x}from"string-match-left-right";import{remDup as F}from"string-remove-duplicate-heads-tails";import{strFindHeadsTails as I}from"string-find-heads-tails";import{getByKey as _}from"ast-get-values-by-key";import{arrayiffy as B}from"arrayiffy-if-string";import{traverse as L}from"ast-monkey-traverse";import{rApply as O}from"ranges-apply";import h from"object-path";import{Ranges as U}from"ranges-push";import{isMatch as M}from"matcher";import{isPlainObject as w,existy as q,isBool as A,isNull as N,isStr as o,isNum as K}from"codsen-utils";var j="12.0.
|
|
10
|
+
import{matchLeftIncl as k,matchRightIncl as x}from"string-match-left-right";import{remDup as F}from"string-remove-duplicate-heads-tails";import{strFindHeadsTails as I}from"string-find-heads-tails";import{getByKey as _}from"ast-get-values-by-key";import{arrayiffy as B}from"arrayiffy-if-string";import{traverse as L}from"ast-monkey-traverse";import{rApply as O}from"ranges-apply";import h from"object-path";import{Ranges as U}from"ranges-push";import{isMatch as M}from"matcher";import{isPlainObject as w,existy as q,isBool as A,isNull as N,isStr as o,isNum as K}from"codsen-utils";var j="12.0.23";var ce=j,G=Object.prototype.hasOwnProperty,z={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(r){return o(r)?r.trim():r}function Y(r){if(o(r)&&r.length&&r.indexOf(".")!==-1){for(let e=0,t=r.length;e<t;e++)if(r[e]===".")return r.slice(0,e)}return r}function Q(r){if(o(r)&&r.length&&r.indexOf(".")!==-1){for(let e=0,t=r.length;e<t;e++)if(r[e]===".")return r.slice(e+1)}return r}function J(r){if(o(r)&&r.length&&r.indexOf(".")!==-1){for(let e=r.length;e--;)if(r[e]===".")return r.slice(0,e)}return r}function P(r){if(o(r)&&r.length&&r.indexOf(".")!==-1){for(let e=r.length;e--;)if(r[e]===".")return r.slice(e+1)}return r}function T(r,e){return!o(r)||!r.trim()?!1:!!(r.includes(e.heads)||r.includes(e.tails)||o(e.headsNoWrap)&&e.headsNoWrap.length&&r.includes(e.headsNoWrap)||o(e.tailsNoWrap)&&e.tailsNoWrap.length&&r.includes(e.tailsNoWrap))}function X(r,e,t){let l,s;return o(r)&&r.length&&x(r,0,e,{trimBeforeMatching:!0,cb:(n,a,i)=>(l=i,!0)})&&k(r,r.length-1,t,{trimBeforeMatching:!0,cb:(n,a,i)=>(s=(i||0)+1,!0)})?r.slice(l,s):r}function H(r,e,t=!1,l,s,n){if(e.wrapHeadsWith||(e.wrapHeadsWith=""),e.wrapTailsWith||(e.wrapTailsWith=""),o(r)&&!t&&e.wrapGlobalFlipSwitch&&!e.dontWrapVars.some(a=>M(n,a))&&(!e.preventDoubleWrapping||e.preventDoubleWrapping&&o(r)&&!r.includes(e.wrapHeadsWith)&&!r.includes(e.wrapTailsWith)))return`${e.wrapHeadsWith}${r}${e.wrapTailsWith}`;if(t){if(!o(r))return r;let a=F(r,{heads:e.wrapHeadsWith,tails:e.wrapTailsWith});return o(a)?X(a,e.wrapHeadsWith,e.wrapTailsWith):a}return r}function Z(r,e,t,l){let s;if(t.indexOf(".")!==-1){let n=t,a=!0;if(l.lookForDataContainers&&o(l.dataContainerIdentifierTails)&&l.dataContainerIdentifierTails.length&&!n.endsWith(l.dataContainerIdentifierTails)){let i=h.get(r,n+l.dataContainerIdentifierTails);w(i)&&h.get(i,e)&&(s=h.get(i,e),a=!1)}for(;a&&n.indexOf(".")!==-1;){if(n=J(n),P(n)===e)throw new Error(`json-variables/findValues(): [THROW_ID_20] While trying to resolve: "${e}" at path "${t}", we encountered a closed loop. The parent key "${P(n)}" is called the same as the variable "${e}" we're looking for.`);if(l.lookForDataContainers&&o(l.dataContainerIdentifierTails)&&l.dataContainerIdentifierTails.length&&!n.endsWith(l.dataContainerIdentifierTails)){let i=h.get(r,n+l.dataContainerIdentifierTails);w(i)&&h.get(i,e)&&(s=h.get(i,e),a=!1)}if(s===void 0){let i=h.get(r,n);w(i)&&h.get(i,e)&&(s=h.get(i,e),a=!1)}}}if(s===void 0){let n=h.get(r,e);n!==void 0&&(s=n)}if(s===void 0)if(e.indexOf(".")===-1){let n=_(r,e);if(n.length){for(let a=0,i=n.length;a<i;a++)if(o(n[a].val)||A(n[a].val)||N(n[a].val)){s=n[a].val;break}else if(K(n[a].val)){s=String(n[a].val);break}else if(Array.isArray(n[a].val)){s=n[a].val.join("");break}}}else{let n=_(r,Y(e));if(n.length)for(let a=0,i=n.length;a<i;a++){let m=h.get(n[a].val,Q(e));m&&o(m)&&(s=m)}}return s}function R(r,e,t,l,s=[]){if(s.includes(t)){let c="";if(s.length>1){let y=` \u2192
|
|
11
11
|
`;c=s.reduce((D,b,S)=>D+(S===0?"":y)+(b===t?"\u{1F4A5} ":" ")+b,` Here's the path we travelled up until we hit the recursion:
|
|
12
12
|
|
|
13
13
|
`),c+=`${y}\u{1F4A5} ${t}`}throw new Error(`json-variables/resolveString(): [THROW_ID_19] While trying to resolve: "${e}" at path "${t}", we encountered a closed loop, the key is referencing itself."${c}`)}let n={},a=Array.from(s);a.push(t);let i=new U;function m(c,y,D){for(let b=0,S=c.length;b<S;b++){let f=c[b],p=e.slice(f.headsEndAt,f.tailsStartAt);if(p.length===0)i.push(f.headsStartAt,f.tailsEndAt);else if(G.call(n,p)&&o(n[p]))i.push(f.headsStartAt,f.tailsEndAt,n[p]);else{let u=Z(r,p.trim(),t,l);if(u===void 0)if(l.allowUnresolved===!0)u="";else if(o(l.allowUnresolved))u=l.allowUnresolved;else throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_18] We couldn't find the value to resolve the variable ${e.slice(f.headsEndAt,f.tailsStartAt)}. We're at path: "${t}".`);if(!D&&l.throwWhenNonStringInsertedInString&&!o(u))throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ${e.slice(f.headsEndAt,f.tailsStartAt)} at path ${t}, it resolved into a non-string value, ${JSON.stringify(u,null,4)}. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").`);if(A(u)){if(l.resolveToBoolIfAnyValuesContainBool)return i.wipe(),l.resolveToFalseIfAnyValuesContainBool?!1:u;u=""}else{if(N(u)&&D)return i.wipe(),u;Array.isArray(u)?u=String(u.join("")):N(u)?u="":u=String(u)}let v=t.includes(".")?`${J(t)}.${p}`:p;if(T(u,l)){let V=H(R(r,u,v,l,a),l,y,a,v,p.trim());o(V)&&i.push(f.headsStartAt,f.tailsEndAt,V)}else{n[p]=u;let V=H(u,l,y,a,v,p.trim());o(V)&&i.push(f.headsStartAt,f.tailsEndAt,V)}}}}let d;try{d=I(e,l.heads,l.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(c){throw new Error(`json-variables/resolveString(): [THROW_ID_17] While trying to resolve string: "${e}" at path ${t}, something wrong with heads and tails was detected! Here's the internal error message:
|
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name json-variables
|
|
3
3
|
* @fileoverview Resolves custom-marked, cross-referenced paths in parsed JSON
|
|
4
|
-
* @version 12.0.
|
|
4
|
+
* @version 12.0.23
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/json-variables/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var jsonVariables=(()=>{var Ve=Object.create;var M=Object.defineProperty,Ce=Object.defineProperties,He=Object.getOwnPropertyDescriptor,Me=Object.getOwnPropertyDescriptors,je=Object.getOwnPropertyNames,ae=Object.getOwnPropertySymbols,Be=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable;var Q=(e,r,n)=>r in e?M(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,T=(e,r)=>{for(var n in r||(r={}))oe.call(r,n)&&Q(e,n,r[n]);if(ae)for(var n of ae(r))Pe.call(r,n)&&Q(e,n,r[n]);return e},j=(e,r)=>Ce(e,Me(r));var le=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Je=(e,r)=>{for(var n in r)M(e,n,{get:r[n],enumerable:!0})},fe=(e,r,n,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of je(r))!oe.call(e,l)&&l!==n&&M(e,l,{get:()=>r[l],enumerable:!(a=He(r,l))||a.enumerable});return e};var F=(e,r,n)=>(n=e!=null?Ve(Be(e)):{},fe(r||!e||!e.__esModule?M(n,"default",{value:e,enumerable:!0}):n,e)),Fe=e=>fe(M({},"__esModule",{value:!0}),e);var Z=(e,r,n)=>(Q(e,typeof r!="symbol"?r+"":r,n),n);var L=le((cr,ue)=>{"use strict";ue.exports=Le;function R(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function Le(e){if(e=e||{},e.circles)return ke(e);return e.proto?a:n;function r(l,t){for(var o=Object.keys(l),s=new Array(o.length),u=0;u<o.length;u++){var i=o[u],g=l[i];typeof g!="object"||g===null?s[i]=g:g instanceof Date?s[i]=new Date(g):ArrayBuffer.isView(g)?s[i]=R(g):s[i]=t(g)}return s}function n(l){if(typeof l!="object"||l===null)return l;if(l instanceof Date)return new Date(l);if(Array.isArray(l))return r(l,n);if(l instanceof Map)return new Map(r(Array.from(l),n));if(l instanceof Set)return new Set(r(Array.from(l),n));var t={};for(var o in l)if(Object.hasOwnProperty.call(l,o)!==!1){var s=l[o];typeof s!="object"||s===null?t[o]=s:s instanceof Date?t[o]=new Date(s):s instanceof Map?t[o]=new Map(r(Array.from(s),n)):s instanceof Set?t[o]=new Set(r(Array.from(s),n)):ArrayBuffer.isView(s)?t[o]=R(s):t[o]=n(s)}return t}function a(l){if(typeof l!="object"||l===null)return l;if(l instanceof Date)return new Date(l);if(Array.isArray(l))return r(l,a);if(l instanceof Map)return new Map(r(Array.from(l),a));if(l instanceof Set)return new Set(r(Array.from(l),a));var t={};for(var o in l){var s=l[o];typeof s!="object"||s===null?t[o]=s:s instanceof Date?t[o]=new Date(s):s instanceof Map?t[o]=new Map(r(Array.from(s),a)):s instanceof Set?t[o]=new Set(r(Array.from(s),a)):ArrayBuffer.isView(s)?t[o]=R(s):t[o]=a(s)}return t}}function ke(e){var r=[],n=[];return e.proto?t:l;function a(o,s){for(var u=Object.keys(o),i=new Array(u.length),g=0;g<u.length;g++){var c=u[g],A=o[c];if(typeof A!="object"||A===null)i[c]=A;else if(A instanceof Date)i[c]=new Date(A);else if(ArrayBuffer.isView(A))i[c]=R(A);else{var y=r.indexOf(A);y!==-1?i[c]=n[y]:i[c]=s(A)}}return i}function l(o){if(typeof o!="object"||o===null)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return a(o,l);if(o instanceof Map)return new Map(a(Array.from(o),l));if(o instanceof Set)return new Set(a(Array.from(o),l));var s={};r.push(o),n.push(s);for(var u in o)if(Object.hasOwnProperty.call(o,u)!==!1){var i=o[u];if(typeof i!="object"||i===null)s[u]=i;else if(i instanceof Date)s[u]=new Date(i);else if(i instanceof Map)s[u]=new Map(a(Array.from(i),l));else if(i instanceof Set)s[u]=new Set(a(Array.from(i),l));else if(ArrayBuffer.isView(i))s[u]=R(i);else{var g=r.indexOf(i);g!==-1?s[u]=n[g]:s[u]=l(i)}}return r.pop(),n.pop(),s}function t(o){if(typeof o!="object"||o===null)return o;if(o instanceof Date)return new Date(o);if(Array.isArray(o))return a(o,t);if(o instanceof Map)return new Map(a(Array.from(o),t));if(o instanceof Set)return new Set(a(Array.from(o),t));var s={};r.push(o),n.push(s);for(var u in o){var i=o[u];if(typeof i!="object"||i===null)s[u]=i;else if(i instanceof Date)s[u]=new Date(i);else if(i instanceof Map)s[u]=new Map(a(Array.from(i),t));else if(i instanceof Set)s[u]=new Set(a(Array.from(i),t));else if(ArrayBuffer.isView(i))s[u]=R(i);else{var g=r.indexOf(i);g!==-1?s[u]=n[g]:s[u]=t(i)}}return r.pop(),n.pop(),s}}});var Se=le((Ie,z)=>{(function(e,r){"use strict";typeof z=="object"&&typeof z.exports=="object"?z.exports=r():typeof define=="function"&&define.amd?define([],r):e.objectPath=r()})(Ie,function(){"use strict";var e=Object.prototype.toString;function r(g,c){return g==null?!1:Object.prototype.hasOwnProperty.call(g,c)}function n(g){if(!g||t(g)&&g.length===0)return!0;if(typeof g!="string"){for(var c in g)if(r(g,c))return!1;return!0}return!1}function a(g){return e.call(g)}function l(g){return typeof g=="object"&&a(g)==="[object Object]"}var t=Array.isArray||function(g){return e.call(g)==="[object Array]"};function o(g){return typeof g=="boolean"||a(g)==="[object Boolean]"}function s(g){var c=parseInt(g);return c.toString()===g?c:g}function u(g){g=g||{};var c=function(d){return Object.keys(c).reduce(function(f,p){return p==="create"||typeof c[p]=="function"&&(f[p]=c[p].bind(c,d)),f},{})},A;g.includeInheritedProps?A=function(){return!0}:A=function(d,f){return typeof f=="number"&&Array.isArray(d)||r(d,f)};function y(d,f){if(A(d,f))return d[f]}var h;g.includeInheritedProps?h=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}:h=function(d,f){return y(d,f)};function m(d,f,p,b){if(typeof f=="number"&&(f=[f]),!f||f.length===0)return d;if(typeof f=="string")return m(d,f.split(".").map(s),p,b);var w=f[0],O=h(d,w);return f.length===1?((O===void 0||!b)&&(d[w]=p),O):(O===void 0&&(typeof f[1]=="number"?d[w]=[]:d[w]={}),m(d[w],f.slice(1),p,b))}return c.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 b=s(f[p]);if(typeof b=="number"&&t(d)&&b<d.length||(g.includeInheritedProps?b in Object(d):r(d,b)))d=d[b];else return!1}return!0},c.ensureExists=function(d,f,p){return m(d,f,p,!0)},c.set=function(d,f,p,b){return m(d,f,p,b)},c.insert=function(d,f,p,b){var w=c.get(d,f);b=~~b,t(w)||(w=[],c.set(d,f,w)),w.splice(b,0,p)},c.empty=function(d,f){if(!n(f)&&d!=null){var p,b;if(p=c.get(d,f)){if(typeof p=="string")return c.set(d,f,"");if(o(p))return c.set(d,f,!1);if(typeof p=="number")return c.set(d,f,0);if(t(p))p.length=0;else if(l(p))for(b in p)A(p,b)&&delete p[b];else return c.set(d,f,null)}}},c.push=function(d,f){var p=c.get(d,f);t(p)||(p=[],c.set(d,f,p)),p.push.apply(p,Array.prototype.slice.call(arguments,2))},c.coalesce=function(d,f,p){for(var b,w=0,O=f.length;w<O;w++)if((b=c.get(d,f[w]))!==void 0)return b;return p},c.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 c.get(d,f.split("."),p);var b=s(f[0]),w=h(d,b);return w===void 0?p:f.length===1?w:c.get(d[b],f.slice(1),p)},c.del=function(f,p){if(typeof p=="number"&&(p=[p]),f==null||n(p))return f;if(typeof p=="string")return c.del(f,p.split("."));var b=s(p[0]);if(h(f,b),!A(f,b))return f;if(p.length===1)t(f)?f.splice(b,1):delete f[b];else return c.del(f[b],p.slice(1));return f},c}var i=u();return i.create=u,i.withInheritedProps=u({includeInheritedProps:!0}),i})});var ur={};Je(ur,{defaults:()=>_e,jVar:()=>fr,version:()=>nr});function I(e){return typeof e!="string"?e:e.length?[e]:[]}var ge=F(L(),1);var pr=(0,ge.default)();function E(e){if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function $(e){return typeof e=="string"}function he(e){return Number.isFinite(e)}function _(e){return Number.isSafeInteger(e)&&e>=0}function k(e){return typeof e=="boolean"}function B(e){return e===null}function S(e){return e!=null}function ce(e,r){return E(e)&&$(r)&&r in e}var pe={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},qe=e=>e+1;function Ue(e,r,n,a,l=!1,t=qe){var b;let o=typeof n=="function"?n():n;if(+r<0&&l&&o==="EOL")return o;let s=T(T({},pe),a);if(r>=e.length&&!l)return!1;let u=l?1:n.length,i=0,g=!1,c=!1,A=!1,y=s.maxMismatches,h=r,m=!1,d=!1,f=!1;function p(){return i===1&&y<s.maxMismatches-1}for(;e[h];){let w=t(h);if(s.trimBeforeMatching&&e[h].trim()===""){if(!e[w]&&l&&n==="EOL")return!0;h=t(h);continue}if(s&&!s.i&&((b=s==null?void 0:s.trimCharsBeforeMatching)!=null&&b.includes(e[h]))||s!=null&&s.i&&s.trimCharsBeforeMatching&&s.trimCharsBeforeMatching.map(W=>W.toLowerCase()).includes(e[h].toLowerCase())){if(l&&n==="EOL"&&!e[w])return!0;h=t(h);continue}let O=w>h?n[n.length-u]:n[u-1];if(!s.i&&e[h]===O||s.i&&e[h].toLowerCase()===O.toLowerCase()){if(m||(m=!0),A||(A=!0),u===n.length){if(d=!0,y!==s.maxMismatches)return!1}else u===1&&(f=!0);if(u-=1,i++,p())return!1;if(!u)return i!==n.length||y===s.maxMismatches||!g?h:!1}else if(!g&&!i&&(g=!0),s.maxMismatches&&y&&h){y-=1;for(let W=0;W<=y;W++){let x=w>h?n[n.length-u+1+W]:n[u-2-W],G=e[t(h)];if(x&&(!s.i&&e[h]===x||s.i&&e[h].toLowerCase()===x.toLowerCase())&&(!s.firstMustMatch||u!==n.length)){if(i++,p())return!1;u-=2,m=!0;break}else if(G&&x&&(!s.i&&G===x||s.i&&G.toLowerCase()===x.toLowerCase())&&(!s.firstMustMatch||u!==n.length)){if(!i&&!s.hungry)return!1;u-=1,m=!0;break}else if(x===void 0&&y>=0&&m&&(!s.firstMustMatch||d)&&(!s.lastMustMatch||f))return h}m||(c=h)}else return h===0&&u===1&&!s.lastMustMatch&&A?0:!1;if(c!==!1&&c!==h&&(c=!1),u<1)return h;h=t(h)}if(u>0)return l&&o==="EOL"?!0:s&&s.maxMismatches>=u&&A?c||0:!1}function de(e,r,n,a,l){var g,c,A;if(E(l)&&ce(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 t=T(T({},pe),l);if(typeof t.trimCharsBeforeMatching=="string"&&(t.trimCharsBeforeMatching=I(t.trimCharsBeforeMatching)),t.trimCharsBeforeMatching=t.trimCharsBeforeMatching.map(y=>$(y)?y:String(y)),!$(r)||!r.length)return!1;if(!Number.isInteger(n)||n<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 n}, equal to:
|
|
11
|
-
${JSON.stringify(n,null,4)}`);let o
|
|
12
|
-
${JSON.stringify(
|
|
13
|
-
${JSON.stringify(
|
|
14
|
-
`:"\r",
|
|
15
|
-
`;if(!t)return t;let
|
|
16
|
-
`.includes(t[
|
|
17
|
-
${JSON.stringify(r,null,4)} (type ${typeof r})`);else
|
|
18
|
-
${JSON.stringify(n,null,4)}`);if(
|
|
19
|
-
${JSON.stringify(r,null,4)} (type ${typeof r})`);else
|
|
20
|
-
${JSON.stringify(e,null,4)}`);let n=
|
|
21
|
-
`||n.tab&&
|
|
22
|
-
${JSON.stringify(r,null,4)}`)}else if(
|
|
23
|
-
${JSON.stringify(r,null,4)}.`)}else if(
|
|
10
|
+
"use strict";var jsonVariables=(()=>{var Ve=Object.create;var j=Object.defineProperty,He=Object.defineProperties,Ce=Object.getOwnPropertyDescriptor,je=Object.getOwnPropertyDescriptors,Me=Object.getOwnPropertyNames,ae=Object.getOwnPropertySymbols,Be=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable;var Q=(e,r,n)=>r in e?j(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,O=(e,r)=>{for(var n in r||(r={}))oe.call(r,n)&&Q(e,n,r[n]);if(ae)for(var n of ae(r))Pe.call(r,n)&&Q(e,n,r[n]);return e},M=(e,r)=>He(e,je(r));var le=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Je=(e,r)=>{for(var n in r)j(e,n,{get:r[n],enumerable:!0})},ue=(e,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let f of Me(r))!oe.call(e,f)&&f!==n&&j(e,f,{get:()=>r[f],enumerable:!(i=Ce(r,f))||i.enumerable});return e};var k=(e,r,n)=>(n=e!=null?Ve(Be(e)):{},ue(r||!e||!e.__esModule?j(n,"default",{value:e,enumerable:!0}):n,e)),ke=e=>ue(j({},"__esModule",{value:!0}),e);var Z=(e,r,n)=>Q(e,typeof r!="symbol"?r+"":r,n);var F=le((gr,fe)=>{"use strict";fe.exports=Fe;function R(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function Fe(e){if(e=e||{},e.circles)return Le(e);let r=new Map;if(r.set(Date,s=>new Date(s)),r.set(Map,(s,o)=>new Map(i(Array.from(s),o))),r.set(Set,(s,o)=>new Set(i(Array.from(s),o))),e.constructorHandlers)for(let s of e.constructorHandlers)r.set(s[0],s[1]);let n=null;return e.proto?t:f;function i(s,o){let u=Object.keys(s),l=new Array(u.length);for(let a=0;a<u.length;a++){let c=u[a],$=s[c];typeof $!="object"||$===null?l[c]=$:$.constructor!==Object&&(n=r.get($.constructor))?l[c]=n($,o):ArrayBuffer.isView($)?l[c]=R($):l[c]=o($)}return l}function f(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return i(s,f);if(s.constructor!==Object&&(n=r.get(s.constructor)))return n(s,f);let o={};for(let u in s){if(Object.hasOwnProperty.call(s,u)===!1)continue;let l=s[u];typeof l!="object"||l===null?o[u]=l:l.constructor!==Object&&(n=r.get(l.constructor))?o[u]=n(l,f):ArrayBuffer.isView(l)?o[u]=R(l):o[u]=f(l)}return o}function t(s){if(typeof s!="object"||s===null)return s;if(Array.isArray(s))return i(s,t);if(s.constructor!==Object&&(n=r.get(s.constructor)))return n(s,t);let o={};for(let u in s){let l=s[u];typeof l!="object"||l===null?o[u]=l:l.constructor!==Object&&(n=r.get(l.constructor))?o[u]=n(l,t):ArrayBuffer.isView(l)?o[u]=R(l):o[u]=t(l)}return o}}function Le(e){let r=[],n=[],i=new Map;if(i.set(Date,u=>new Date(u)),i.set(Map,(u,l)=>new Map(t(Array.from(u),l))),i.set(Set,(u,l)=>new Set(t(Array.from(u),l))),e.constructorHandlers)for(let u of e.constructorHandlers)i.set(u[0],u[1]);let f=null;return e.proto?o:s;function t(u,l){let a=Object.keys(u),c=new Array(a.length);for(let $=0;$<a.length;$++){let d=a[$],h=u[d];if(typeof h!="object"||h===null)c[d]=h;else if(h.constructor!==Object&&(f=i.get(h.constructor)))c[d]=f(h,l);else if(ArrayBuffer.isView(h))c[d]=R(h);else{let y=r.indexOf(h);y!==-1?c[d]=n[y]:c[d]=l(h)}}return c}function s(u){if(typeof u!="object"||u===null)return u;if(Array.isArray(u))return t(u,s);if(u.constructor!==Object&&(f=i.get(u.constructor)))return f(u,s);let l={};r.push(u),n.push(l);for(let a in u){if(Object.hasOwnProperty.call(u,a)===!1)continue;let c=u[a];if(typeof c!="object"||c===null)l[a]=c;else if(c.constructor!==Object&&(f=i.get(c.constructor)))l[a]=f(c,s);else if(ArrayBuffer.isView(c))l[a]=R(c);else{let $=r.indexOf(c);$!==-1?l[a]=n[$]:l[a]=s(c)}}return r.pop(),n.pop(),l}function o(u){if(typeof u!="object"||u===null)return u;if(Array.isArray(u))return t(u,o);if(u.constructor!==Object&&(f=i.get(u.constructor)))return f(u,o);let l={};r.push(u),n.push(l);for(let a in u){let c=u[a];if(typeof c!="object"||c===null)l[a]=c;else if(c.constructor!==Object&&(f=i.get(c.constructor)))l[a]=f(c,o);else if(ArrayBuffer.isView(c))l[a]=R(c);else{let $=r.indexOf(c);$!==-1?l[a]=n[$]:l[a]=o(c)}}return r.pop(),n.pop(),l}}});var We=le((Ie,z)=>{(function(e,r){"use strict";typeof z=="object"&&typeof z.exports=="object"?z.exports=r():typeof define=="function"&&define.amd?define([],r):e.objectPath=r()})(Ie,function(){"use strict";var e=Object.prototype.toString;function r(a,c){return a==null?!1:Object.prototype.hasOwnProperty.call(a,c)}function n(a){if(!a||t(a)&&a.length===0)return!0;if(typeof a!="string"){for(var c in a)if(r(a,c))return!1;return!0}return!1}function i(a){return e.call(a)}function f(a){return typeof a=="object"&&i(a)==="[object Object]"}var t=Array.isArray||function(a){return e.call(a)==="[object Array]"};function s(a){return typeof a=="boolean"||i(a)==="[object Boolean]"}function o(a){var c=parseInt(a);return c.toString()===a?c:a}function u(a){a=a||{};var c=function(m){return Object.keys(c).reduce(function(g,p){return p==="create"||typeof c[p]=="function"&&(g[p]=c[p].bind(c,m)),g},{})},$;a.includeInheritedProps?$=function(){return!0}:$=function(m,g){return typeof g=="number"&&Array.isArray(m)||r(m,g)};function d(m,g){if($(m,g))return m[g]}var h;a.includeInheritedProps?h=function(m,g){typeof g!="string"&&typeof g!="number"&&(g=String(g));var p=d(m,g);if(g==="__proto__"||g==="prototype"||g==="constructor"&&typeof p=="function")throw new Error("For security reasons, object's magic properties cannot be set");return p}:h=function(m,g){return d(m,g)};function y(m,g,p,b){if(typeof g=="number"&&(g=[g]),!g||g.length===0)return m;if(typeof g=="string")return y(m,g.split(".").map(o),p,b);var w=g[0],v=h(m,w);return g.length===1?((v===void 0||!b)&&(m[w]=p),v):(v===void 0&&(typeof g[1]=="number"?m[w]=[]:m[w]={}),y(m[w],g.slice(1),p,b))}return c.has=function(m,g){if(typeof g=="number"?g=[g]:typeof g=="string"&&(g=g.split(".")),!g||g.length===0)return!!m;for(var p=0;p<g.length;p++){var b=o(g[p]);if(typeof b=="number"&&t(m)&&b<m.length||(a.includeInheritedProps?b in Object(m):r(m,b)))m=m[b];else return!1}return!0},c.ensureExists=function(m,g,p){return y(m,g,p,!0)},c.set=function(m,g,p,b){return y(m,g,p,b)},c.insert=function(m,g,p,b){var w=c.get(m,g);b=~~b,t(w)||(w=[],c.set(m,g,w)),w.splice(b,0,p)},c.empty=function(m,g){if(!n(g)&&m!=null){var p,b;if(p=c.get(m,g)){if(typeof p=="string")return c.set(m,g,"");if(s(p))return c.set(m,g,!1);if(typeof p=="number")return c.set(m,g,0);if(t(p))p.length=0;else if(f(p))for(b in p)$(p,b)&&delete p[b];else return c.set(m,g,null)}}},c.push=function(m,g){var p=c.get(m,g);t(p)||(p=[],c.set(m,g,p)),p.push.apply(p,Array.prototype.slice.call(arguments,2))},c.coalesce=function(m,g,p){for(var b,w=0,v=g.length;w<v;w++)if((b=c.get(m,g[w]))!==void 0)return b;return p},c.get=function(m,g,p){if(typeof g=="number"&&(g=[g]),!g||g.length===0)return m;if(m==null)return p;if(typeof g=="string")return c.get(m,g.split("."),p);var b=o(g[0]),w=h(m,b);return w===void 0?p:g.length===1?w:c.get(m[b],g.slice(1),p)},c.del=function(g,p){if(typeof p=="number"&&(p=[p]),g==null||n(p))return g;if(typeof p=="string")return c.del(g,p.split("."));var b=o(p[0]);if(h(g,b),!$(g,b))return g;if(p.length===1)t(g)?g.splice(b,1):delete g[b];else return c.del(g[b],p.slice(1));return g},c}var l=u();return l.create=u,l.withInheritedProps=u({includeInheritedProps:!0}),l})});var ur={};Je(ur,{defaults:()=>_e,jVar:()=>lr,version:()=>tr});function I(e){return typeof e!="string"?e:e.length?[e]:[]}var ce=k(F(),1);var hr=(0,ce.default)();function E(e){if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function T(e){return typeof e=="string"}function ge(e){return Number.isFinite(e)}function _(e){return Number.isSafeInteger(e)&&e>=0}function L(e){return typeof e=="boolean"}function B(e){return e===null}function W(e){return e!=null}function he(e,r){return E(e)&&T(r)&&r in e}var pe={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},qe=e=>e+1;function Ue(e,r,n,i,f=!1,t=qe){var b;let s=typeof n=="function"?n():n;if(+r<0&&f&&s==="EOL")return s;let o=O(O({},pe),i);if(r>=e.length&&!f)return!1;let u=f?1:n.length,l=0,a=!1,c=!1,$=!1,d=o.maxMismatches,h=r,y=!1,m=!1,g=!1;function p(){return l===1&&d<o.maxMismatches-1}for(;e[h];){let w=t(h);if(o.trimBeforeMatching&&e[h].trim()===""){if(!e[w]&&f&&n==="EOL")return!0;h=t(h);continue}if(o&&!o.i&&((b=o==null?void 0:o.trimCharsBeforeMatching)!=null&&b.includes(e[h]))||o!=null&&o.i&&o.trimCharsBeforeMatching&&o.trimCharsBeforeMatching.map(S=>S.toLowerCase()).includes(e[h].toLowerCase())){if(f&&n==="EOL"&&!e[w])return!0;h=t(h);continue}let v=w>h?n[n.length-u]:n[u-1];if(!o.i&&e[h]===v||o.i&&e[h].toLowerCase()===v.toLowerCase()){if(y||(y=!0),$||($=!0),u===n.length){if(m=!0,d!==o.maxMismatches)return!1}else u===1&&(g=!0);if(u-=1,l++,p())return!1;if(!u)return l!==n.length||d===o.maxMismatches||!a?h:!1}else if(!a&&!l&&(a=!0),o.maxMismatches&&d&&h){d-=1;for(let S=0;S<=d;S++){let x=w>h?n[n.length-u+1+S]:n[u-2-S],G=e[t(h)];if(x&&(!o.i&&e[h]===x||o.i&&e[h].toLowerCase()===x.toLowerCase())&&(!o.firstMustMatch||u!==n.length)){if(l++,p())return!1;u-=2,y=!0;break}else if(G&&x&&(!o.i&&G===x||o.i&&G.toLowerCase()===x.toLowerCase())&&(!o.firstMustMatch||u!==n.length)){if(!l&&!o.hungry)return!1;u-=1,y=!0;break}else if(x===void 0&&d>=0&&y&&(!o.firstMustMatch||m)&&(!o.lastMustMatch||g))return h}y||(c=h)}else return h===0&&u===1&&!o.lastMustMatch&&$?0:!1;if(c!==!1&&c!==h&&(c=!1),u<1)return h;h=t(h)}if(u>0)return f&&s==="EOL"?!0:o&&o.maxMismatches>=u&&$?c||0:!1}function de(e,r,n,i,f){var a,c,$;if(E(f)&&he(f,"trimBeforeMatching")&&f&&typeof f.trimBeforeMatching!="boolean")throw new Error(`string-match-left-right/${e}(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!${Array.isArray(f.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);let t=O(O({},pe),f);if(typeof t.trimCharsBeforeMatching=="string"&&(t.trimCharsBeforeMatching=I(t.trimCharsBeforeMatching)),t.trimCharsBeforeMatching=t.trimCharsBeforeMatching.map(d=>T(d)?d:String(d)),!T(r)||!r.length)return!1;if(!Number.isInteger(n)||n<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 n}, equal to:
|
|
11
|
+
${JSON.stringify(n,null,4)}`);let s,o;if(T(i))s=[i];else if(Array.isArray(i))s=i;else if(!i)s=i;else if(typeof i=="function")s=[],s.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(f&&!E(f))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 f}", and equal to:
|
|
13
|
+
${JSON.stringify(f,null,4)}`);let u=0,l="";if((a=t==null?void 0:t.trimCharsBeforeMatching)!=null&&a.some((d,h)=>d.length>1?(u=h,l=d,!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 ${u} is longer than 1 character, ${l.length} (equals to ${l}). Please split it into separate characters and put into array as separate elements.`);if(!s||!Array.isArray(s)||Array.isArray(s)&&!s.length||Array.isArray(s)&&s.length===1&&T(s[0])&&!s[0].trim()){if(typeof t.cb=="function"){let h,y=n;if((e==="matchLeftIncl"||e==="matchRight")&&(y+=1),e[5]==="L")for(let b=y;b--;){let w=r[b];if((!t.trimBeforeMatching||t.trimBeforeMatching&&(w!=null&&w.trim()))&&(!((c=t.trimCharsBeforeMatching)!=null&&c.length)||w!==void 0&&!t.trimCharsBeforeMatching.includes(w))){h=b;break}}else if(e.startsWith("matchRight"))for(let b=y;b<r.length;b++){let w=r[b];if((!t.trimBeforeMatching||t.trimBeforeMatching&&w.trim())&&(!(($=t.trimCharsBeforeMatching)!=null&&$.length)||!t.trimCharsBeforeMatching.includes(w))){h=b;break}}if(h===void 0)return!1;let m=r[h],g=h+1,p="";return g&&g>0&&(p=r.slice(0,g)),e[5]==="L"||h&&h>0&&(p=r.slice(h)),t.cb(m,p,h)}let d="";throw f||(d=" 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!${d}`)}for(let d=0,h=s.length;d<h;d++){o=typeof s[d]=="function";let y=s[d],m,g,p="",b=n;e==="matchRight"?b+=1:e==="matchLeft"&&(b-=1);let w=Ue(r,b,y,t,o,v=>e[5]==="L"?v-1:v+1);if(w&&o&&typeof y=="function"&&y()==="EOL")return y()&&(!t.cb||t.cb(m,p,g))?y():!1;if(Number.isInteger(w)&&(g=e.startsWith("matchLeft")?w-1:w+1,e[5]==="L"?p=r.slice(0,w):p=r.slice(g)),g<0&&(g=void 0),r[g]&&(m=r[g]),Number.isInteger(w)&&(!t.cb||t.cb(m,p,g)))return y}return!1}function V(e,r,n,i){return de("matchLeftIncl",e,r,n,i)}function D(e,r,n,i){return de("matchRightIncl",e,r,n,i)}function q(e,r=1){let n="\xA0";function i(t){return Array.from(t).reverse().join("")}function f(t,s,o){let u=o?`
|
|
14
|
+
`:"\r",l=o?"\r":`
|
|
15
|
+
`;if(!t)return t;let a=0,c=0,$="";for(let d=0,h=t.length;d<h;d++)(t[d]===u||t[d]===l&&t[d-1]!==u)&&c++,`\r
|
|
16
|
+
`.includes(t[d])||t[d]===n?(a=0,t[d]===n?$+=t[d]:t[d]===u?c<=s&&($+=t[d],t[d+1]===l&&($+=t[d+1],d++)):t[d]===l&&(t==null?void 0:t[d-1])!==u&&c<=s&&($+=t[d])):(a++,!t[d+1]&&!c&&($+=" "));return $}if(typeof e=="string"&&e.length){let t=1;typeof+r=="number"&&Number.isInteger(+r)&&+r>=0&&(t=+r);let s="",o="";if(!e.trim())s=e;else if(!e[0].trim()){for(let u=0,l=e.length;u<l;u++)if(e[u].trim()){s=e.slice(0,u);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===n)){for(let u=e.length;u--;)if(e[u].trim()){o=e.slice(u+1);break}}return`${f(s,t,!1)}${e.trim()}${i(f(i(o),t,!0))}`}return e}var Ke={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function H(e,r){if(!Array.isArray(e)||!e.length)return e;let n=O(O({},Ke),r),i,f;if(n.strictlyTwoElementsInRangeArrays&&!e.every((o,u)=>!Array.isArray(o)||o.length!==2?(i=u,f=o.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 ${f} elements!`);if(!e.every((o,u)=>!Array.isArray(o)||!Number.isInteger(o[0])||o[0]<0||!Number.isInteger(o[1])||o[1]<0?(i=u,!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 t=e.length**2,s=0;return Array.from(e).sort((o,u)=>(n.progressFn&&(s+=1,n.progressFn(Math.floor(s*100/t))),o[0]===u[0]?o[1]<u[1]?-1:o[1]>u[1]?1:0:o[0]<u[0]?-1:1))}var ye={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function ze(e,r){var l;function n(a){return!!a&&typeof a=="object"&&!Array.isArray(a)}if(!Array.isArray(e)||!e.length)return null;let i;if(r)if(n(r)){if(i=O(O({},ye),r),i.progressFn&&n(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(`ranges-merge: [THROW_ID_03] the second input argument must be a plain object. It was given as:
|
|
17
|
+
${JSON.stringify(r,null,4)} (type ${typeof r})`);else i=O({},ye);let f=e.filter(a=>Array.isArray(a)).map(a=>[...a]).filter(a=>a[2]!==void 0||a[0]!==a[1]),t,s,o;i.progressFn?t=H(f,{progressFn:a=>{o=Math.floor(a/5),o!==s&&(s=o,i.progressFn!=null&&i.progressFn(o))}}):t=H(f);let u=t.length-1;for(let a=u;a>0;a--)i.progressFn&&(o=Math.floor((1-a/u)*78)+21,o!==s&&o>s&&(s=o,i.progressFn(o))),(t[a][0]<=t[a-1][0]||!i.joinRangesThatTouchEdges&&t[a][0]<t[a-1][1]||i.joinRangesThatTouchEdges&&t[a][0]<=t[a-1][1])&&(t[a-1][0]=Math.min(t[a][0],t[a-1][0]),t[a-1][1]=Math.max(t[a][1],t[a-1][1]),t[a][2]!==void 0&&(t[a-1][0]>=t[a][0]||t[a-1][1]<=t[a][1])&&t[a-1][2]!==null&&(t[a][2]===null&&t[a-1][2]!==null?t[a-1][2]=null:t[a-1][2]!=null?+((l=i||{})==null?void 0:l.mergeType)==2&&t[a-1][0]===t[a][0]?t[a-1][2]=t[a][2]:t[a-1][2]+=t[a][2]:t[a-1][2]=t[a][2]),t.splice(a,1),a=t.length);return t.length?t:null}var Ge={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},P=class{constructor(e){Z(this,"ranges");Z(this,"opts");let r=O(O({},Ge),e);if(r.mergeType&&r.mergeType!==1&&r.mergeType!==2)if(T(r.mergeType)&&r.mergeType.trim()==="1")r.mergeType=1;else if(T(r.mergeType)&&r.mergeType.trim()==="2")r.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 r.mergeType}", equal to ${JSON.stringify(r.mergeType,null,4)}`);this.opts=r,this.ranges=[]}add(e,r,n){var t;if(e==null&&r==null)return;if(W(e)&&!W(r)){if(Array.isArray(e)){if(e.length){if(e.some(s=>Array.isArray(s))){e.forEach(s=>{Array.isArray(s)&&this.add(...s)});return}e.length&&_(+e[0])&&_(+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(r,null,0)})`)}else if(!W(e)&&W(r))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(r,null,0)}) but first-one, "from" is not (${JSON.stringify(e,null,0)})`);let i=+e,f=+r;if(_(n)&&(n=String(n)),_(i)&&_(f)){if(W(n)&&!T(n)&&!_(n))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof n}, equal to:
|
|
18
|
+
${JSON.stringify(n,null,4)}`);if(W(this.ranges)&&Array.isArray(this.last())&&i===this.last()[1]){if(this.last()[1]=f,this.last()[2],this.last()[2]!==null&&W(n)){let s=this.last()[2]&&this.last()[2].length&&(!((t=this.opts)!=null&&t.mergeType)||this.opts.mergeType===1)?`${this.last()[2]}${n}`:n;this.opts.limitToBeAddedWhitespace&&(s=q(s,this.opts.limitLinebreaksCount)),T(s)&&!s.length||(this.last()[2]=s)}}else{this.ranges||(this.ranges=[]);let s=n!==void 0&&!(T(n)&&!n.length)?[i,f,n&&this.opts.limitToBeAddedWhitespace?q(n,this.opts.limitLinebreaksCount):n]:[i,f];this.ranges.push(s)}}else throw _(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 f}" equal to: ${JSON.stringify(f,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,r,n){this.add(e,r,n)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=ze(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>W(e[2])?[e[0],e[1],q(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])&&_(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 me={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function we(e,r){function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}if(!Array.isArray(e)||!e.length)return null;let i;if(r)if(n(r)){if(i=O(O({},me),r),i.progressFn&&n(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:
|
|
19
|
+
${JSON.stringify(r,null,4)} (type ${typeof r})`);else i=O({},me);let f=e.filter(l=>Array.isArray(l)).map(l=>[...l]).filter(l=>l[2]!==void 0||l[0]!==l[1]),t,s,o;i.progressFn?t=H(f,{progressFn:l=>{o=Math.floor(l/5),o!==s&&(s=o,i.progressFn(o))}}):t=H(f);let u=t.length-1;for(let l=u;l>0;l--)i.progressFn&&(o=Math.floor((1-l/u)*78)+21,o!==s&&o>s&&(s=o,i.progressFn(o))),(t[l][0]<=t[l-1][0]||!i.joinRangesThatTouchEdges&&t[l][0]<t[l-1][1]||i.joinRangesThatTouchEdges&&t[l][0]<=t[l-1][1])&&(t[l-1][0]=Math.min(t[l][0],t[l-1][0]),t[l-1][1]=Math.max(t[l][1],t[l-1][1]),t[l][2]!==void 0&&(t[l-1][0]>=t[l][0]||t[l-1][1]<=t[l][1])&&t[l-1][2]!==null&&(t[l][2]===null&&t[l-1][2]!==null?t[l-1][2]=null:t[l-1][2]!=null?+i.mergeType==2&&t[l-1][0]===t[l][0]?t[l-1][2]=t[l][2]:t[l-1][2]+=t[l][2]:t[l-1][2]=t[l][2]),t.splice(l,1),l=t.length);return t.length?t:null}var Qe=!0,Y="Invariant failed";function be(e,r){if(!e){if(Qe)throw new Error(Y);var n=typeof r=="function"?r():r,i=n?"".concat(Y,": ").concat(n):Y;throw new Error(i)}}function C(e,r,n){let i=0,f=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(r&&!Array.isArray(r))throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof r}, equal to: ${JSON.stringify(r,null,4)}`);if(n&&typeof n!="function")throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof n}, equal to: ${JSON.stringify(n,null,4)}`);if(!(r!=null&&r.filter(a=>a).length))return e;let t;Array.isArray(r)&&Number.isInteger(r[0])&&Number.isInteger(r[1])?t=[Array.from(r)]:t=Array.from(r);let s=t.length,o=0;t.filter(a=>a).forEach((a,c)=>{if(n&&(i=Math.floor(o/s*10),i!==f&&(f=i,n(i))),!Array.isArray(a))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${c}th element not an array: ${JSON.stringify(a,null,4)}, which is ${typeof a}`);if(!Number.isInteger(a[0])){if(!Number.isInteger(+a[0])||+a[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${c}th element, array ${JSON.stringify(a,null,0)}. Its first element is not an integer, string index, but ${typeof a[0]}, equal to: ${JSON.stringify(a[0],null,4)}.`);t[c][0]=+t[c][0]}if(!Number.isInteger(a[1])){if(!Number.isInteger(+a[1])||+a[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${c}th element, array ${JSON.stringify(a,null,0)}. Its second element is not an integer, string index, but ${typeof a[1]}, equal to: ${JSON.stringify(a[1],null,4)}.`);t[c][1]=+t[c][1]}o+=1});let u=we(t,{progressFn:a=>{n&&(i=10+Math.floor(a/10),i!==f&&(f=i,n(i)))}});be(u);let l=u.length;if(l>0){let a=e.slice(u[l-1][1]);e=u.reduce((c,$,d,h)=>{n&&(i=20+Math.floor(d/l*80),i!==f&&(f=i,n(i)));let y=d===0?0:h[d-1][1],m=h[d][0];return`${c}${e.slice(y,m)}${h[d][2]||""}`},""),e+=a}return e}var Ze={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function J(e,r){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:
|
|
20
|
+
${JSON.stringify(e,null,4)}`);let n=O(O({},Ze),r);function i(s){return n.classicTrim&&!s.trim()||!n.classicTrim&&(n.space&&s===" "||n.cr&&s==="\r"||n.lf&&s===`
|
|
21
|
+
`||n.tab&&s===" "||n.nbsp&&s==="\xA0")}let f,t;if(e.length){if(i(e[0]))for(let s=0,o=e.length;s<o;s++){if(!i(e[s])){f=s;break}if(s===e.length-1)return{res:"",ranges:[[0,e.length]]}}if(i(e[e.length-1])){for(let s=e.length;s--;)if(!i(e[s])){t=s+1;break}}return f?t?{res:e.slice(f,t),ranges:[[0,f],[t,e.length]]}:{res:e.slice(f),ranges:[[0,f]]}:t?{res:e.slice(0,t),ranges:[[t,e.length]]}:{res:e,ranges:[]}}return{res:"",ranges:[]}}var Ye={heads:["{{"],tails:["}}"]};function $e(e,r){let n=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(r&&!E(r))throw new Error(`string-remove-duplicate-heads-tails: [THROW_ID_03] The given options are not a plain object but ${typeof r}!`);let i=O({},r);if(i&&n.call(i,"heads"))if(I(i.heads).every(y=>typeof y=="string"||Array.isArray(y)))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&&n.call(i,"tails"))if(I(i.tails).every(y=>typeof y=="string"||Array.isArray(y)))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 f=J(e).res;if(f.length===0)return e;e=f;let t=O(O({},Ye),i);t.heads=t.heads.map(y=>y.trim()),t.tails=t.tails.map(y=>y.trim());let s=!1,o=!1,u=new P({limitToBeAddedWhitespace:!0}),l=new P({limitToBeAddedWhitespace:!0}),a=!0,c=!0,$="";function d(y,m){let g;return D(y,0,m.heads,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})&&D(y,g,m.tails,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})?y.slice(g):y}for(;e!==d(e,t);)e=J(d(e,t)).res;function h(y,m){let g;return!V(y,y.length-1,m.tails,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})||!g?y:V(y,g,m.heads,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})?y.slice(0,g+1):y}for(;e!==h(e,t);)e=J(h(e,t)).res;if(!t.heads.length||!D(e,0,t.heads,{trimBeforeMatching:!0})||!t.tails.length||!V(e,e.length-1,t.tails,{trimBeforeMatching:!0}))return J(e).res;for(let y=0,m=e.length;y<m;y++)if(e[y].trim()!==""){let g;if(D(e,y,t.heads,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})&&g){c=!0,a&&(a=!0);let p;D(e,g,t.tails,{trimBeforeMatching:!0,cb:(b,w,v)=>(p=v,!0)})&&u.push(y,p),l.current()&&s&&$!=="tails"&&u.push(l.current()),s||l.current()&&(u.push(l.current()),l.wipe()),l.push(y,g),$="heads",y=g-1;continue}if(D(e,y,t.tails,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=Number.isInteger(w)?w:e.length,!0)})&&g){c=!0,a?($==="heads"&&l.wipe(),a=!1):l.push(y,g),$="tails",y=g-1;continue}a&&(a=!0),c&&!s?(s=!0,c=!1):c&&!o?(o=!0,a=!0,c=!1,$==="heads"&&l.wipe()):c&&o&&l.wipe()}return l.current()&&u.push(l.current()),u.current()?C(e,u.current()).trim():e.trim()}var Te={fromIndex:0,throwWhenSomethingWrongIsDetected:!0,allowWholeValueToBeOnlyHeadsOrTails:!0,source:"string-find-heads-tails",matchHeadsAndTailsStrictlyInPairsByTheirOrder:!1,relaxedAPI:!1};function X(e,r,n,i){if(W(i)&&!E(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 f=O(O({},Te),i);if(T(f.fromIndex)&&/^\d*$/.test(f.fromIndex))f.fromIndex=Number(f.fromIndex);else if(!Number.isInteger(f.fromIndex)||f.fromIndex<0)throw new TypeError(`${f.source} [THROW_ID_18] the fourth input argument must be a natural number or zero! Currently it's: ${f.fromIndex}`);if(!T(e)||e.length===0){if(f.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 t,s;if(!T(r)&&!Array.isArray(r)){if(f.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 r}, equal to:
|
|
22
|
+
${JSON.stringify(r,null,4)}`)}else if(T(r))if(r.length===0){if(f.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 r=I(r);else if(Array.isArray(r))if(r.length===0){if(f.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(r.every((h,y)=>(t=h,s=y,T(h)))){if(!r.every((h,y)=>(s=y,T(h)&&h.length&&h.trim()!=="")))if(f.relaxedAPI){if(r=r.filter(h=>T(h)&&h.length),r.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 ${s} of heads array:
|
|
23
|
+
${JSON.stringify(r,null,4)}.`)}else if(f.relaxedAPI){if(r=r.filter(h=>T(h)&&h.length),r.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 ${s}th index is ${typeof t}, equal to:
|
|
24
24
|
${JSON.stringify(t,null,4)}. Whole heads array looks like:
|
|
25
|
-
${JSON.stringify(r,null,4)}`);if(
|
|
26
|
-
${JSON.stringify(n,null,4)}`)}else if(
|
|
27
|
-
${JSON.stringify(n,null,4)}`)}else if(
|
|
25
|
+
${JSON.stringify(r,null,4)}`);if(!T(n)&&!Array.isArray(n)){if(f.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 n}, equal to:
|
|
26
|
+
${JSON.stringify(n,null,4)}`)}else if(T(n))if(n.length===0){if(f.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 n=I(n);else if(Array.isArray(n))if(n.length===0){if(f.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(n.every((h,y)=>(t=h,s=y,T(h)))){if(!n.every((h,y)=>(s=y,T(h)&&h.length&&h.trim()!=="")))if(f.relaxedAPI){if(n=n.filter(h=>T(h)&&h.length),n.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 ${s}. Whole tails array is equal to:
|
|
27
|
+
${JSON.stringify(n,null,4)}`)}else if(f.relaxedAPI){if(n=n.filter(h=>T(h)&&h.length),n.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 ${s}th index is ${typeof t}, equal to:
|
|
28
28
|
${JSON.stringify(t,null,4)}. Whole tails array is equal to:
|
|
29
|
-
${JSON.stringify(n,null,4)}`);let
|
|
29
|
+
${JSON.stringify(n,null,4)}`);let o=f.source===Te.source;if(f.throwWhenSomethingWrongIsDetected&&!f.allowWholeValueToBeOnlyHeadsOrTails){if(I(r).includes(e))throw new Error(`${f.source}${o?": [THROW_ID_16]":""} the whole input string can't be equal to ${T(r)?"":"one of "}heads (${e})!`);if(I(n).includes(e))throw new Error(`${f.source}${o?": [THROW_ID_17]":""} the whole input string can't be equal to ${T(n)?"":"one of "}tails (${e})!`)}let u=r.concat(n).map(h=>h.charAt(0)).reduce((h,y)=>y.charCodeAt(0)>h[1]?[h[0],y.charCodeAt(0)]:y.charCodeAt(0)<h[0]?[y.charCodeAt(0),h[1]]:h,[r[0].charCodeAt(0),r[0].charCodeAt(0)]),l=[],a=!1,c={},$="",d;for(let h=f.fromIndex,y=e.length;h<y;h++){let m=e[h].charCodeAt(0);if(m<=u[1]&&m>=u[0]){let g=D(e,h,r);if(g&&f.matchHeadsAndTailsStrictlyInPairsByTheirOrder){for(let b=r.length;b--;)if(r[b]===g){d=b;break}}if(T(g))if(a){if(f.throwWhenSomethingWrongIsDetected)throw new TypeError(`${f.source}${o?": [THROW_ID_19]":""} When processing "${e}", we found heads (${e.slice(h,h+g.length)}) starting at character with index number "${h}" and there was another set of heads before it! Generally speaking, there should be "heads-tails-heads-tails", not "heads-heads-tails"!
|
|
30
30
|
We're talking about the area of the code:
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
--------------------------------------starts
|
|
34
34
|
${e.slice(Math.max(h-200,0),h)}
|
|
35
|
-
\x1B[33m------->\x1B[39m ${`\x1B[31m${e.slice(h,h+
|
|
36
|
-
${e.slice(h+
|
|
35
|
+
\x1B[33m------->\x1B[39m ${`\x1B[31m${e.slice(h,h+g.length)}\x1B[39m`} \x1B[33m<-------\x1B[39m
|
|
36
|
+
${e.slice(h+g.length,Math.min(y,h+200))}
|
|
37
37
|
--------------------------------------ends
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
To turn off this error being thrown, set resolvedOpts.throwWhenSomethingWrongIsDetected to Boolean false.`)}else{c={},c.headsStartAt=h,c.headsEndAt=h+
|
|
41
|
-
`;
|
|
40
|
+
To turn off this error being thrown, set resolvedOpts.throwWhenSomethingWrongIsDetected to Boolean false.`)}else{c={},c.headsStartAt=h,c.headsEndAt=h+g.length,a=!0,h+=g.length-1,$&&($="");continue}let p=D(e,h,n);if(a&&p&&f.matchHeadsAndTailsStrictlyInPairsByTheirOrder&&d!==void 0&&n[d]!==void 0&&n[d]!==p){let b;for(let w=n.length;w--;)if(n[w]===p){b=w;break}throw new TypeError(`${f.source}${o?": [THROW_ID_20]":""} When processing "${e}", we had "resolvedOpts.matchHeadsAndTailsStrictlyInPairsByTheirOrder" on. We found heads (${r[d]}) but the tails the followed it were not of the same index, ${d} (${n[d]}) but ${b} (${p}).`)}if(T(p))if(a){c.tailsStartAt=h,c.tailsEndAt=h+p.length,l.push(c),c={},a=!1,h+=p.length-1;continue}else f.throwWhenSomethingWrongIsDetected&&($=`${f.source}${o?": [THROW_ID_21]":""} When processing "${e}", we found tails (${e.slice(h,h+p.length)}) starting at character with index number "${h}" but there were no heads preceding it. That's very naughty!`)}if(f.throwWhenSomethingWrongIsDetected&&h===y-1){if(Object.keys(c).length!==0)throw new TypeError(`${f.source}${o?": [THROW_ID_22]":""} When processing "${e}", we reached the end of the string and yet didn't find any tails (${JSON.stringify(n,null,4)}) to match the last detected heads (${e.slice(c.headsStartAt,c.headsEndAt)})!`);if($)throw new Error($)}}return l}var Oe=k(F(),1);function ee(e){if(e.includes(".")){let r=e.lastIndexOf(".");if(!e.slice(0,r).includes("."))return e.slice(0,r);for(let n=r-1;n--;)if(e[n]===".")return e.slice(n+1,r)}return null}var re=(0,Oe.default)();function U(e,r){let n={now:!1};function i(f,t,s,o){let u=re(f),l,a=O({depth:-1,path:""},s);if(a.depth+=1,Array.isArray(u))for(let c=0,$=u.length;c<$&&!o.now;c++){let d=a.path?`${a.path}.${c}`:`${c}`;u[c]!==void 0?(a.parent=re(u),a.parentType="array",a.parentKey=ee(d),l=i(t(u[c],void 0,M(O({},a),{path:d}),o),t,M(O({},a),{path:d}),o),Number.isNaN(l)&&c<u.length?(u.splice(c,1),c-=1):u[c]=l):u.splice(c,1)}else if(E(u))for(let c in u){if(o.now&&c!=null)break;let $=a.path?`${a.path}.${c}`:c;a.depth===0&&c!=null&&(a.topmostKey=c),a.parent=re(u),a.parentType="object",a.parentKey=ee($),l=i(t(c,u[c],M(O({},a),{path:$}),o),t,M(O({},a),{path:$}),o),Number.isNaN(l)?delete u[c]:u[c]=l}return u}return i(e,r,{},n)}function te(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var ne=new Map,Ae=(e,r)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${r}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(n=>{if(typeof n!="string"){if(typeof n>"u")return!1;throw new TypeError(`Expected '${r}' to be an array of strings, but found a type of '${typeof n}' in the array`)}return!0})},Xe=(e,r)=>{r=O({caseSensitive:!1},r);let n=e+JSON.stringify(r);if(ne.has(n))return ne.get(n);let i=e[0]==="!";i&&(e=e.slice(1)),e=te(e).replace(/\\\*/g,"[\\s\\S]*");let f=new RegExp(`^${e}$`,r.caseSensitive?"":"i");return f.negated=i,ne.set(n,f),f},er=(e,r,n,i)=>{if(e=Ae(e,"inputs"),r=Ae(r,"patterns"),r.length===0)return[];r=r.map(s=>Xe(s,n));let{allPatterns:f}=n||{},t=[];for(let s of e){let o,u=[...r].fill(!1);for(let[l,a]of r.entries())if(a.test(s)&&(u[l]=!0,o=!a.negated,!o))break;if(!(o===!1||o===void 0&&r.some(l=>!l.negated)||f&&u.some((l,a)=>!l&&!r[a].negated))&&(t.push(s),i))break}return t};function K(e,r,n){return er(e,r,n,!0).length>0}var Ee=k(F(),1);var ve=(0,Ee.default)();function ie(e,r,n){let i;n!==void 0&&(i=Array.isArray(n)?ve(n):[ve(n)]);let f=[],t=U(e,(s,o,u)=>{let l=o!==void 0?o:s;if(o!==void 0&&K(s,r,{caseSensitive:!0})){if(i===void 0)f.push({val:o,path:u.path});else if(i.length)return i.shift()}return l});return i===void 0?f:t}var N=k(We(),1);var Se="12.0.23";var tr=Se,nr=Object.prototype.hasOwnProperty,_e={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 T(e)?e.trim():e}function ir(e){if(T(e)&&e.length&&e.indexOf(".")!==-1){for(let r=0,n=e.length;r<n;r++)if(e[r]===".")return e.slice(0,r)}return e}function sr(e){if(T(e)&&e.length&&e.indexOf(".")!==-1){for(let r=0,n=e.length;r<n;r++)if(e[r]===".")return e.slice(r+1)}return e}function xe(e){if(T(e)&&e.length&&e.indexOf(".")!==-1){for(let r=e.length;r--;)if(e[r]===".")return e.slice(0,r)}return e}function De(e){if(T(e)&&e.length&&e.indexOf(".")!==-1){for(let r=e.length;r--;)if(e[r]===".")return e.slice(r+1)}return e}function se(e,r){return!T(e)||!e.trim()?!1:!!(e.includes(r.heads)||e.includes(r.tails)||T(r.headsNoWrap)&&r.headsNoWrap.length&&e.includes(r.headsNoWrap)||T(r.tailsNoWrap)&&r.tailsNoWrap.length&&e.includes(r.tailsNoWrap))}function ar(e,r,n){let i,f;return T(e)&&e.length&&D(e,0,r,{trimBeforeMatching:!0,cb:(t,s,o)=>(i=o,!0)})&&V(e,e.length-1,n,{trimBeforeMatching:!0,cb:(t,s,o)=>(f=(o||0)+1,!0)})?e.slice(i,f):e}function Ne(e,r,n=!1,i,f,t){if(r.wrapHeadsWith||(r.wrapHeadsWith=""),r.wrapTailsWith||(r.wrapTailsWith=""),T(e)&&!n&&r.wrapGlobalFlipSwitch&&!r.dontWrapVars.some(s=>K(t,s))&&(!r.preventDoubleWrapping||r.preventDoubleWrapping&&T(e)&&!e.includes(r.wrapHeadsWith)&&!e.includes(r.wrapTailsWith)))return`${r.wrapHeadsWith}${e}${r.wrapTailsWith}`;if(n){if(!T(e))return e;let s=$e(e,{heads:r.wrapHeadsWith,tails:r.wrapTailsWith});return T(s)?ar(s,r.wrapHeadsWith,r.wrapTailsWith):s}return e}function or(e,r,n,i){let f;if(n.indexOf(".")!==-1){let t=n,s=!0;if(i.lookForDataContainers&&T(i.dataContainerIdentifierTails)&&i.dataContainerIdentifierTails.length&&!t.endsWith(i.dataContainerIdentifierTails)){let o=N.default.get(e,t+i.dataContainerIdentifierTails);E(o)&&N.default.get(o,r)&&(f=N.default.get(o,r),s=!1)}for(;s&&t.indexOf(".")!==-1;){if(t=xe(t),De(t)===r)throw new Error(`json-variables/findValues(): [THROW_ID_20] While trying to resolve: "${r}" at path "${n}", we encountered a closed loop. The parent key "${De(t)}" is called the same as the variable "${r}" we're looking for.`);if(i.lookForDataContainers&&T(i.dataContainerIdentifierTails)&&i.dataContainerIdentifierTails.length&&!t.endsWith(i.dataContainerIdentifierTails)){let o=N.default.get(e,t+i.dataContainerIdentifierTails);E(o)&&N.default.get(o,r)&&(f=N.default.get(o,r),s=!1)}if(f===void 0){let o=N.default.get(e,t);E(o)&&N.default.get(o,r)&&(f=N.default.get(o,r),s=!1)}}}if(f===void 0){let t=N.default.get(e,r);t!==void 0&&(f=t)}if(f===void 0)if(r.indexOf(".")===-1){let t=ie(e,r);if(t.length){for(let s=0,o=t.length;s<o;s++)if(T(t[s].val)||L(t[s].val)||B(t[s].val)){f=t[s].val;break}else if(ge(t[s].val)){f=String(t[s].val);break}else if(Array.isArray(t[s].val)){f=t[s].val.join("");break}}}else{let t=ie(e,ir(r));if(t.length)for(let s=0,o=t.length;s<o;s++){let u=N.default.get(t[s].val,sr(r));u&&T(u)&&(f=u)}}return f}function Re(e,r,n,i,f=[]){if(f.includes(n)){let d="";if(f.length>1){let h=` \u2192
|
|
41
|
+
`;d=f.reduce((y,m,g)=>y+(g===0?"":h)+(m===n?"\u{1F4A5} ":" ")+m,` Here's the path we travelled up until we hit the recursion:
|
|
42
42
|
|
|
43
|
-
`),
|
|
44
|
-
${
|
|
45
|
-
${
|
|
46
|
-
Please check the following key: ${
|
|
43
|
+
`),d+=`${h}\u{1F4A5} ${n}`}throw new Error(`json-variables/resolveString(): [THROW_ID_19] While trying to resolve: "${r}" at path "${n}", we encountered a closed loop, the key is referencing itself."${d}`)}let t={},s=Array.from(f);s.push(n);let o=new P;function u(d,h,y){for(let m=0,g=d.length;m<g;m++){let p=d[m],b=r.slice(p.headsEndAt,p.tailsStartAt);if(b.length===0)o.push(p.headsStartAt,p.tailsEndAt);else if(nr.call(t,b)&&T(t[b]))o.push(p.headsStartAt,p.tailsEndAt,t[b]);else{let w=or(e,b.trim(),n,i);if(w===void 0)if(i.allowUnresolved===!0)w="";else if(T(i.allowUnresolved))w=i.allowUnresolved;else throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_18] We couldn't find the value to resolve the variable ${r.slice(p.headsEndAt,p.tailsStartAt)}. We're at path: "${n}".`);if(!y&&i.throwWhenNonStringInsertedInString&&!T(w))throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ${r.slice(p.headsEndAt,p.tailsStartAt)} at path ${n}, it resolved into a non-string value, ${JSON.stringify(w,null,4)}. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").`);if(L(w)){if(i.resolveToBoolIfAnyValuesContainBool)return o.wipe(),i.resolveToFalseIfAnyValuesContainBool?!1:w;w=""}else{if(B(w)&&y)return o.wipe(),w;Array.isArray(w)?w=String(w.join("")):B(w)?w="":w=String(w)}let v=n.includes(".")?`${xe(n)}.${b}`:b;if(se(w,i)){let S=Ne(Re(e,w,v,i,s),i,h,s,v,b.trim());T(S)&&o.push(p.headsStartAt,p.tailsEndAt,S)}else{t[b]=w;let S=Ne(w,i,h,s,v,b.trim());T(S)&&o.push(p.headsStartAt,p.tailsEndAt,S)}}}}let l;try{l=X(r,i.heads,i.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(d){throw new Error(`json-variables/resolveString(): [THROW_ID_17] While trying to resolve string: "${r}" at path ${n}, something wrong with heads and tails was detected! Here's the internal error message:
|
|
44
|
+
${d}`)}let a=!1;l.length===1&&C(r,[[l[0].headsStartAt,l[0].tailsEndAt]]).trim()===""&&(a=!0);let c=u(l,!1,a);if(typeof c=="boolean"||c===null)return c;try{l=X(r,i.headsNoWrap,i.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(d){throw new Error(`json-variables/resolveString(): [THROW_ID_22] While trying to resolve string: "${r}" at path ${n}, something wrong with no-wrap heads and no-wrap tails was detected! Here's the internal error message:
|
|
45
|
+
${d}`)}l.length===1&&C(r,[[l[0].headsStartAt,l[0].tailsEndAt]]).trim()===""&&(a=!0);let $=u(l,!0,a);return L($)||B($)?$:o!=null&&o.current()?C(r,o.current()):r}function lr(e,r){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_01] Alas! Inputs are missing!");if(!E(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(r&&!E(r))throw new TypeError(`json-variables/jVar(): [THROW_ID_03] Alas! An Optional Options Object must be a plain object! Currently it's: ${Array.isArray(r)?"array":typeof r}`);let n=O(O({},_e),r);n.dontWrapVars?Array.isArray(n.dontWrapVars)||(n.dontWrapVars=I(n.dontWrapVars)):n.dontWrapVars=[];let i,f;if(n.dontWrapVars.length&&!n.dontWrapVars.every((s,o)=>T(s)?!0:(i=s,f=o,!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 ${f}, which is not string but ${Array.isArray(i)?"array":typeof i}!`);if(n.heads==="")throw new Error("json-variables/jVar(): [THROW_ID_06] Alas! resolvedOpts.heads are empty!");if(n.tails==="")throw new Error("json-variables/jVar(): [THROW_ID_07] Alas! resolvedOpts.tails are empty!");if(n.lookForDataContainers&&n.dataContainerIdentifierTails==="")throw new Error("json-variables/jVar(): [THROW_ID_08] Alas! resolvedOpts.dataContainerIdentifierTails is empty!");if(n.heads===n.tails)throw new Error("json-variables/jVar(): [THROW_ID_09] Alas! resolvedOpts.heads and resolvedOpts.tails can't be equal!");if(n.heads===n.headsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_10] Alas! resolvedOpts.heads and resolvedOpts.headsNoWrap can't be equal!");if(n.tails===n.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_11] Alas! resolvedOpts.tails and resolvedOpts.tailsNoWrap can't be equal!");if(n.headsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_12] Alas! resolvedOpts.headsNoWrap is an empty string!");if(n.tailsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_13] Alas! resolvedOpts.tailsNoWrap is an empty string!");if(n.headsNoWrap===n.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_14] Alas! resolvedOpts.headsNoWrap and resolvedOpts.tailsNoWrap can't be equal!");let t;return U(e,(s,o,u)=>{if(W(o)&&se(s,n))throw new Error(`json-variables/jVar(): [THROW_ID_15] Alas! Object keys can't contain variables!
|
|
46
|
+
Please check the following key: ${s}`);if(o!==void 0?t=o:t=s,t==="")return t;if(n.heads.length&&A(t)===A(n.heads)||n.tails.length&&A(t)===A(n.tails)||n.headsNoWrap.length&&A(t)===A(n.headsNoWrap)||n.tailsNoWrap.length&&A(t)===A(n.tailsNoWrap)){if(!n.noSingleMarkers)return t;throw new Error(`json-variables/jVar(): [THROW_ID_16] Alas! While processing the input, we stumbled upon ${A(t)} which is equal to ${A(t)===A(n.heads)?"heads":""}${A(t)===A(n.tails)?"tails":""}${T(n.headsNoWrap)&&A(t)===A(n.headsNoWrap)?"headsNoWrap":""}${T(n.tailsNoWrap)&&A(t)===A(n.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 (${A(t)}) alone`)}return T(t)&&se(t,n)?Re(e,t,u.path,n):t})}return ke(ur);})();
|
|
47
47
|
/**
|
|
48
48
|
* @name arrayiffy-if-string
|
|
49
49
|
* @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
|
|
50
|
-
* @version 5.0.
|
|
50
|
+
* @version 5.0.10
|
|
51
51
|
* @author Roy Revelt, Codsen Ltd
|
|
52
52
|
* @license MIT
|
|
53
53
|
* {@link https://codsen.com/os/arrayiffy-if-string/}
|
|
@@ -55,7 +55,7 @@ Please check the following key: ${o}`);if(s!==void 0?t=s:t=o,t==="")return t;if(
|
|
|
55
55
|
/**
|
|
56
56
|
* @name codsen-utils
|
|
57
57
|
* @fileoverview Various utility functions
|
|
58
|
-
* @version 1.6.
|
|
58
|
+
* @version 1.6.8
|
|
59
59
|
* @author Roy Revelt, Codsen Ltd
|
|
60
60
|
* @license MIT
|
|
61
61
|
* {@link https://codsen.com/os/codsen-utils/}
|
|
@@ -63,7 +63,7 @@ Please check the following key: ${o}`);if(s!==void 0?t=s:t=o,t==="")return t;if(
|
|
|
63
63
|
/**
|
|
64
64
|
* @name string-match-left-right
|
|
65
65
|
* @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
|
|
66
|
-
* @version 9.0.
|
|
66
|
+
* @version 9.0.23
|
|
67
67
|
* @author Roy Revelt, Codsen Ltd
|
|
68
68
|
* @license MIT
|
|
69
69
|
* {@link https://codsen.com/os/string-match-left-right/}
|
|
@@ -71,7 +71,7 @@ Please check the following key: ${o}`);if(s!==void 0?t=s:t=o,t==="")return t;if(
|
|
|
71
71
|
/**
|
|
72
72
|
* @name string-collapse-leading-whitespace
|
|
73
73
|
* @fileoverview Collapse the leading and trailing whitespace of a string
|
|
74
|
-
* @version 7.0.
|
|
74
|
+
* @version 7.0.9
|
|
75
75
|
* @author Roy Revelt, Codsen Ltd
|
|
76
76
|
* @license MIT
|
|
77
77
|
* {@link https://codsen.com/os/string-collapse-leading-whitespace/}
|
|
@@ -79,7 +79,7 @@ Please check the following key: ${o}`);if(s!==void 0?t=s:t=o,t==="")return t;if(
|
|
|
79
79
|
/**
|
|
80
80
|
* @name ranges-sort
|
|
81
81
|
* @fileoverview Sort string index ranges
|
|
82
|
-
* @version 6.0.
|
|
82
|
+
* @version 6.0.14
|
|
83
83
|
* @author Roy Revelt, Codsen Ltd
|
|
84
84
|
* @license MIT
|
|
85
85
|
* {@link https://codsen.com/os/ranges-sort/}
|
|
@@ -87,7 +87,7 @@ Please check the following key: ${o}`);if(s!==void 0?t=s:t=o,t==="")return t;if(
|
|
|
87
87
|
/**
|
|
88
88
|
* @name ranges-push
|
|
89
89
|
* @fileoverview Gather string index ranges
|
|
90
|
-
* @version 7.0.
|
|
90
|
+
* @version 7.0.19
|
|
91
91
|
* @author Roy Revelt, Codsen Ltd
|
|
92
92
|
* @license MIT
|
|
93
93
|
* {@link https://codsen.com/os/ranges-push/}
|
|
@@ -95,7 +95,7 @@ Please check the following key: ${o}`);if(s!==void 0?t=s:t=o,t==="")return t;if(
|
|
|
95
95
|
/**
|
|
96
96
|
* @name ranges-merge
|
|
97
97
|
* @fileoverview Merge and sort string index ranges
|
|
98
|
-
* @version 9.0.
|
|
98
|
+
* @version 9.0.19
|
|
99
99
|
* @author Roy Revelt, Codsen Ltd
|
|
100
100
|
* @license MIT
|
|
101
101
|
* {@link https://codsen.com/os/ranges-merge/}
|
|
@@ -103,7 +103,7 @@ Please check the following key: ${o}`);if(s!==void 0?t=s:t=o,t==="")return t;if(
|
|
|
103
103
|
/**
|
|
104
104
|
* @name ranges-apply
|
|
105
105
|
* @fileoverview Take an array of string index ranges, delete/replace the string according to them
|
|
106
|
-
* @version 7.0.
|
|
106
|
+
* @version 7.0.20
|
|
107
107
|
* @author Roy Revelt, Codsen Ltd
|
|
108
108
|
* @license MIT
|
|
109
109
|
* {@link https://codsen.com/os/ranges-apply/}
|
|
@@ -111,7 +111,7 @@ Please check the following key: ${o}`);if(s!==void 0?t=s:t=o,t==="")return t;if(
|
|
|
111
111
|
/**
|
|
112
112
|
* @name string-trim-spaces-only
|
|
113
113
|
* @fileoverview Like String.trim() but you can choose granularly what to trim
|
|
114
|
-
* @version 5.0.
|
|
114
|
+
* @version 5.0.13
|
|
115
115
|
* @author Roy Revelt, Codsen Ltd
|
|
116
116
|
* @license MIT
|
|
117
117
|
* {@link https://codsen.com/os/string-trim-spaces-only/}
|
|
@@ -119,7 +119,7 @@ Please check the following key: ${o}`);if(s!==void 0?t=s:t=o,t==="")return t;if(
|
|
|
119
119
|
/**
|
|
120
120
|
* @name string-remove-duplicate-heads-tails
|
|
121
121
|
* @fileoverview Detect and (recursively) remove head and tail wrappings around the input string
|
|
122
|
-
* @version 7.0.
|
|
122
|
+
* @version 7.0.23
|
|
123
123
|
* @author Roy Revelt, Codsen Ltd
|
|
124
124
|
* @license MIT
|
|
125
125
|
* {@link https://codsen.com/os/string-remove-duplicate-heads-tails/}
|
|
@@ -127,7 +127,7 @@ Please check the following key: ${o}`);if(s!==void 0?t=s:t=o,t==="")return t;if(
|
|
|
127
127
|
/**
|
|
128
128
|
* @name string-find-heads-tails
|
|
129
129
|
* @fileoverview Finds where are arbitrary templating marker heads and tails located
|
|
130
|
-
* @version 6.0.
|
|
130
|
+
* @version 6.0.23
|
|
131
131
|
* @author Roy Revelt, Codsen Ltd
|
|
132
132
|
* @license MIT
|
|
133
133
|
* {@link https://codsen.com/os/string-find-heads-tails/}
|
|
@@ -135,7 +135,7 @@ Please check the following key: ${o}`);if(s!==void 0?t=s:t=o,t==="")return t;if(
|
|
|
135
135
|
/**
|
|
136
136
|
* @name ast-monkey-util
|
|
137
137
|
* @fileoverview Utility library of AST helper functions
|
|
138
|
-
* @version 3.0.
|
|
138
|
+
* @version 3.0.10
|
|
139
139
|
* @author Roy Revelt, Codsen Ltd
|
|
140
140
|
* @license MIT
|
|
141
141
|
* {@link https://codsen.com/os/ast-monkey-util/}
|
|
@@ -143,7 +143,7 @@ Please check the following key: ${o}`);if(s!==void 0?t=s:t=o,t==="")return t;if(
|
|
|
143
143
|
/**
|
|
144
144
|
* @name ast-monkey-traverse
|
|
145
145
|
* @fileoverview Utility library to traverse AST
|
|
146
|
-
* @version 4.0.
|
|
146
|
+
* @version 4.0.20
|
|
147
147
|
* @author Roy Revelt, Codsen Ltd
|
|
148
148
|
* @license MIT
|
|
149
149
|
* {@link https://codsen.com/os/ast-monkey-traverse/}
|
|
@@ -151,7 +151,7 @@ Please check the following key: ${o}`);if(s!==void 0?t=s:t=o,t==="")return t;if(
|
|
|
151
151
|
/**
|
|
152
152
|
* @name ast-get-values-by-key
|
|
153
153
|
* @fileoverview Extract values and paths from AST by keys OR set them by keys
|
|
154
|
-
* @version 5.0.
|
|
154
|
+
* @version 5.0.22
|
|
155
155
|
* @author Roy Revelt, Codsen Ltd
|
|
156
156
|
* @license MIT
|
|
157
157
|
* {@link https://codsen.com/os/ast-get-values-by-key/}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "json-variables",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.23",
|
|
4
4
|
"description": "Resolves custom-marked, cross-referenced paths in parsed JSON",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"comb",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"homepage": "https://codsen.com/os/json-variables",
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
27
|
-
"url": "https://github.com/codsen/codsen.git",
|
|
27
|
+
"url": "git+https://github.com/codsen/codsen.git",
|
|
28
28
|
"directory": "packages/json-variables"
|
|
29
29
|
},
|
|
30
30
|
"license": "MIT",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
51
51
|
"lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
|
|
52
52
|
"letspublish": "npm publish || :",
|
|
53
|
-
"lint": "eslint . --
|
|
53
|
+
"lint": "eslint . --fix",
|
|
54
54
|
"perf": "node perf/check.js",
|
|
55
55
|
"prep": "echo 'ready'",
|
|
56
56
|
"prettier": "prettier",
|
|
@@ -78,16 +78,16 @@
|
|
|
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.
|
|
84
|
-
"codsen-utils": "^1.6.
|
|
81
|
+
"arrayiffy-if-string": "^5.0.10",
|
|
82
|
+
"ast-get-values-by-key": "^5.0.22",
|
|
83
|
+
"ast-monkey-traverse": "^4.0.20",
|
|
84
|
+
"codsen-utils": "^1.6.8",
|
|
85
85
|
"matcher": "^5.0.0",
|
|
86
86
|
"object-path": "^0.11.8",
|
|
87
|
-
"ranges-apply": "^7.0.
|
|
88
|
-
"ranges-push": "^7.0.
|
|
89
|
-
"string-find-heads-tails": "^6.0.
|
|
90
|
-
"string-match-left-right": "^9.0.
|
|
91
|
-
"string-remove-duplicate-heads-tails": "^7.0.
|
|
87
|
+
"ranges-apply": "^7.0.20",
|
|
88
|
+
"ranges-push": "^7.0.19",
|
|
89
|
+
"string-find-heads-tails": "^6.0.23",
|
|
90
|
+
"string-match-left-right": "^9.0.23",
|
|
91
|
+
"string-remove-duplicate-heads-tails": "^7.0.23"
|
|
92
92
|
}
|
|
93
93
|
}
|
package/types/index.d.ts
CHANGED