object-flatten-referencing 6.0.12 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 6.1.0 (2022-04-11)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- export defaults and version ([1107244](https://github.com/codsen/codsen/commit/1107244b45eff96ac1fc4ab992031ede0d10ba8c))
|
|
11
|
+
|
|
6
12
|
## 6.0.0 (2021-09-09)
|
|
7
13
|
|
|
8
14
|
### Features
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
## Install
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
This package is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). If you're not ready yet, install an older version of this program, 5.1.0 (`npm i object-flatten-referencing@5.1.0`).
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
npm i object-flatten-referencing
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name object-flatten-referencing
|
|
3
3
|
* @fileoverview Flatten complex nested objects according to a reference objects
|
|
4
|
-
* @version 6.0
|
|
4
|
+
* @version 6.1.0
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-flatten-referencing/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import D from"lodash.clonedeep";import{strIndexesOfPlus as A}from"str-indexes-of-plus";import{isMatch as R}from"matcher";import $ from"lodash.isplainobject";import
|
|
10
|
+
import D from"lodash.clonedeep";import{strIndexesOfPlus as A}from"str-indexes-of-plus";import{isMatch as R}from"matcher";import $ from"lodash.isplainobject";import O from"lodash.clonedeep";import I from"lodash.isplainobject";var j={wrapHeadsWith:"%%_",wrapTailsWith:"_%%",dontWrapKeys:[],dontWrapPaths:[],xhtml:!0,preventDoubleWrapping:!0,preventWrappingIfContains:[],objectKeyAndValueJoinChar:".",wrapGlobalFlipSwitch:!0,ignore:[],whatToDoWhenReferenceIsMissing:0,mergeArraysWithLineBreaks:!0,mergeWithoutTrailingBrIfLineContainsBr:!0,enforceStrictKeyset:!0};function y(f){return typeof f=="string"}function T(f,b){let h={...j,...b};if(arguments.length===0||Object.keys(f).length===0)return[];let i=O(f),r=[];return I(i)&&Object.keys(i).forEach(a=>{I(i[a])&&(i[a]=T(i[a],h)),Array.isArray(i[a])&&(r=r.concat(i[a].map(p=>`${a}${h.objectKeyAndValueJoinChar}${p}`))),y(i[a])&&r.push(`${a}${h.objectKeyAndValueJoinChar}${i[a]}`)}),r}function w(f,b,h=!1,i=!1){let r={...j,...b};if(arguments.length===0||f.length===0)return"";let a=O(f),p="";if(a.length)if(i){for(let e=0,s=a.length;e<s;e++)if(y(a[e])){let l;l="",r.mergeArraysWithLineBreaks&&e>0&&(!r.mergeWithoutTrailingBrIfLineContainsBr||typeof a[e-1]!="string"||r.mergeWithoutTrailingBrIfLineContainsBr&&a[e-1]!==void 0&&!a[e-1].toLowerCase().includes("<br"))&&(l=`<br${r.xhtml?" /":""}>`),p+=`${l}${h?r.wrapHeadsWith:""}${a[e]}${h?r.wrapTailsWith:""}`}else if(Array.isArray(a[e])&&a[e].length&&a[e].every(y)){let l="";r.mergeArraysWithLineBreaks&&p.length&&(l=`<br${r.xhtml?" /":""}>`),p=a[e].reduce((g,t,o,n)=>{let c="";return o!==n.length-1&&(c=" "),g+(o===0?l:"")+(h?r.wrapHeadsWith:"")+t+(h?r.wrapTailsWith:"")+c},p)}}else p=a.reduce((e,s,l,g)=>{let t="";r.mergeArraysWithLineBreaks&&l>0&&(t=`<br${r.xhtml?" /":""}>`);let o="";return l!==g.length-1&&(o=" "),`${e}${l===0?t:""}${h?r.wrapHeadsWith:""}${s}${h?r.wrapTailsWith:""}${o}`},p);return p}function m(f){return y(f)?f.length?[f]:[]:f}var x="6.1.0";var J=x;function W(f){return f!=null}function d(f){return typeof f=="string"}function q(f,b,h){if(arguments.length===0)throw new Error("object-flatten-referencing/ofr(): [THROW_ID_01] all inputs missing!");if(arguments.length===1)throw new Error("object-flatten-referencing/ofr(): [THROW_ID_02] reference object missing!");if(W(h)&&!$(h))throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_03] third input, options object must be a plain object. Currently it's: ${typeof h}`);let i={...j,...h};i.dontWrapKeys=m(i.dontWrapKeys),i.preventWrappingIfContains=m(i.preventWrappingIfContains),i.dontWrapPaths=m(i.dontWrapPaths),i.ignore=m(i.ignore),typeof i.whatToDoWhenReferenceIsMissing!="number"&&(i.whatToDoWhenReferenceIsMissing=+i.whatToDoWhenReferenceIsMissing||0);function r(a,p,e,s=!0,l=!0,g=""){let t=D(a),o=D(p);return e.wrapGlobalFlipSwitch||(s=!1),$(t)?Object.keys(t).forEach(n=>{let c=g+(g.length===0?n:`.${n}`);if(e.ignore.length===0||!e.ignore.includes(n)){if(e.wrapGlobalFlipSwitch&&(s=!0,e.dontWrapKeys.length&&(s=s&&!e.dontWrapKeys.some(u=>R(n,u,{caseSensitive:!0}))),e.dontWrapPaths.length&&(s=s&&!e.dontWrapPaths.some(u=>u===c)),e.preventWrappingIfContains.length&&typeof t[n]=="string"&&(s=s&&!e.preventWrappingIfContains.some(u=>t[n].includes(u)))),W(o[n])||!W(o[n])&&e.whatToDoWhenReferenceIsMissing===2)if(Array.isArray(t[n]))if(e.whatToDoWhenReferenceIsMissing===2||d(o[n]))t[n]=w(t[n],e,s,l);else{if(t[n].every(u=>typeof u=="string"||Array.isArray(u))){let u=!0;t[n].forEach(v=>{Array.isArray(v)&&!v.every(d)&&(u=!1)}),u&&(l=!1)}t[n]=r(t[n],o[n],e,s,l,c)}else $(t[n])?e.whatToDoWhenReferenceIsMissing===2||d(o[n])?t[n]=w(T(t[n],e),e,s,l):s?t[n]=r(t[n],o[n],e,s,l,c):t[n]=r(t[n],o[n],{...e,wrapGlobalFlipSwitch:!1},s,l,c):d(t[n])&&(t[n]=r(t[n],o[n],e,s,l,c));else if(typeof t[n]!=typeof o[n]&&e.whatToDoWhenReferenceIsMissing===1)throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_06] reference object does not have the key ${n} and we need it. TIP: Turn off throwing via opts.whatToDoWhenReferenceIsMissing.`)}}):Array.isArray(t)?Array.isArray(o)?t.forEach((n,c)=>{W(t[c])&&W(o[c])?t[c]=r(t[c],o[c],e,s,l,`${g}[${c}]`):t[c]=r(t[c],o[0],e,s,l,`${g}[${c}]`)}):d(o)&&(t=w(t,e,s,l)):d(t)&&t.length&&(e.wrapHeadsWith||e.wrapTailsWith)&&(!e.preventDoubleWrapping||(e.wrapHeadsWith===""||!A(t,e.wrapHeadsWith.trim()).length)&&(e.wrapTailsWith===""||!A(t,e.wrapTailsWith.trim()).length))&&(t=`${s?e.wrapHeadsWith:""}${t}${s?e.wrapTailsWith:""}`),t}return r(f,b,i)}export{m as arrayiffyString,j as defaults,w as flattenArr,T as flattenObject,q as flattenReferencing,J as version};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name object-flatten-referencing
|
|
3
3
|
* @fileoverview Flatten complex nested objects according to a reference objects
|
|
4
|
-
* @version 6.0
|
|
4
|
+
* @version 6.1.0
|
|
5
5
|
* @author Roy Revelt, Codsen Ltd
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/object-flatten-referencing/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var objectFlattenReferencing=(()=>{var _t=Object.create;var I=Object.defineProperty,mt=Object.defineProperties,wt=Object.getOwnPropertyDescriptor,Tt=Object.getOwnPropertyDescriptors,jt=Object.getOwnPropertyNames,_e=Object.getOwnPropertySymbols,Ot=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable;var we=(e,t,r)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y=(e,t)=>{for(var r in t||(t={}))me.call(t,r)&&we(e,r,t[r]);if(_e)for(var r of _e(t))vt.call(t,r)&&we(e,r,t[r]);return e},Te=(e,t)=>mt(e,Tt(t)),je=e=>I(e,"__esModule",{value:!0});var Oe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xt=(e,t)=>{for(var r in t)I(e,r,{get:t[r],enumerable:!0})},ve=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of jt(t))!me.call(e,a)&&(r||a!=="default")&&I(e,a,{get:()=>t[a],enumerable:!(n=wt(t,a))||n.enumerable});return e},H=(e,t)=>ve(je(I(e!=null?_t(Ot(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Wt=(e=>(t,r)=>e&&e.get(t)||(r=ve(je({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var ce=Oe((P,S)=>{var St=200,xe="__lodash_hash_undefined__",We=9007199254740991,Z="[object Arguments]",At="[object Array]",Se="[object Boolean]",Ae="[object Date]",Ct="[object Error]",Q="[object Function]",Ce="[object GeneratorFunction]",K="[object Map]",Ie="[object Number]",z="[object Object]",$e="[object Promise]",Ee="[object RegExp]",L="[object Set]",Pe="[object String]",Me="[object Symbol]",U="[object WeakMap]",Re="[object ArrayBuffer]",B="[object DataView]",De="[object Float32Array]",He="[object Float64Array]",Ke="[object Int8Array]",Le="[object Int16Array]",Be="[object Int32Array]",Fe="[object Uint8Array]",Ge="[object Uint8ClampedArray]",Ne="[object Uint16Array]",Ve="[object Uint32Array]",It=/[\\^$.*+?()[\]{}|]/g,$t=/\w*$/,Et=/^\[object .+?Constructor\]$/,Pt=/^(?:0|[1-9]\d*)$/,h={};h[Z]=h[At]=h[Re]=h[B]=h[Se]=h[Ae]=h[De]=h[He]=h[Ke]=h[Le]=h[Be]=h[K]=h[Ie]=h[z]=h[Ee]=h[L]=h[Pe]=h[Me]=h[Fe]=h[Ge]=h[Ne]=h[Ve]=!0;h[Ct]=h[Q]=h[U]=!1;var Mt=typeof global=="object"&&global&&global.Object===Object&&global,Rt=typeof self=="object"&&self&&self.Object===Object&&self,_=Mt||Rt||Function("return this")(),Je=typeof P=="object"&&P&&!P.nodeType&&P,qe=Je&&typeof S=="object"&&S&&!S.nodeType&&S,Dt=qe&&qe.exports===Je;function Ht(e,t){return e.set(t[0],t[1]),e}function Kt(e,t){return e.add(t),e}function Lt(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function Bt(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}function Xe(e,t,r,n){var a=-1,o=e?e.length:0;for(n&&o&&(r=e[++a]);++a<o;)r=t(r,e[a],a,e);return r}function Ft(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Gt(e,t){return e==null?void 0:e[t]}function Ye(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Ze(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function k(e,t){return function(r){return e(t(r))}}function Qe(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Nt=Array.prototype,Vt=Function.prototype,F=Object.prototype,ee=_["__core-js_shared__"],ze=function(){var e=/[^.]+$/.exec(ee&&ee.keys&&ee.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ue=Vt.toString,w=F.hasOwnProperty,G=F.toString,Jt=RegExp("^"+Ue.call(w).replace(It,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ke=Dt?_.Buffer:void 0,et=_.Symbol,tt=_.Uint8Array,qt=k(Object.getPrototypeOf,Object),Xt=Object.create,Yt=F.propertyIsEnumerable,Zt=Nt.splice,rt=Object.getOwnPropertySymbols,Qt=ke?ke.isBuffer:void 0,zt=k(Object.keys,Object),te=W(_,"DataView"),$=W(_,"Map"),re=W(_,"Promise"),ne=W(_,"Set"),ie=W(_,"WeakMap"),E=W(Object,"create"),Ut=O(te),kt=O($),er=O(re),tr=O(ne),rr=O(ie),nt=et?et.prototype:void 0,it=nt?nt.valueOf:void 0;function T(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function nr(){this.__data__=E?E(null):{}}function ir(e){return this.has(e)&&delete this.__data__[e]}function ar(e){var t=this.__data__;if(E){var r=t[e];return r===xe?void 0:r}return w.call(t,e)?t[e]:void 0}function or(e){var t=this.__data__;return E?t[e]!==void 0:w.call(t,e)}function sr(e,t){var r=this.__data__;return r[e]=E&&t===void 0?xe:t,this}T.prototype.clear=nr;T.prototype.delete=ir;T.prototype.get=ar;T.prototype.has=or;T.prototype.set=sr;function m(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function fr(){this.__data__=[]}function cr(e){var t=this.__data__,r=N(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Zt.call(t,r,1),!0}function lr(e){var t=this.__data__,r=N(t,e);return r<0?void 0:t[r][1]}function ur(e){return N(this.__data__,e)>-1}function hr(e,t){var r=this.__data__,n=N(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}m.prototype.clear=fr;m.prototype.delete=cr;m.prototype.get=lr;m.prototype.has=ur;m.prototype.set=hr;function v(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function pr(){this.__data__={hash:new T,map:new($||m),string:new T}}function gr(e){return V(this,e).delete(e)}function dr(e){return V(this,e).get(e)}function br(e){return V(this,e).has(e)}function yr(e,t){return V(this,e).set(e,t),this}v.prototype.clear=pr;v.prototype.delete=gr;v.prototype.get=dr;v.prototype.has=br;v.prototype.set=yr;function x(e){this.__data__=new m(e)}function _r(){this.__data__=new m}function mr(e){return this.__data__.delete(e)}function wr(e){return this.__data__.get(e)}function Tr(e){return this.__data__.has(e)}function jr(e,t){var r=this.__data__;if(r instanceof m){var n=r.__data__;if(!$||n.length<St-1)return n.push([e,t]),this;r=this.__data__=new v(n)}return r.set(e,t),this}x.prototype.clear=_r;x.prototype.delete=mr;x.prototype.get=wr;x.prototype.has=Tr;x.prototype.set=jr;function Or(e,t){var r=se(e)||Xr(e)?Ft(e.length,String):[],n=r.length,a=!!n;for(var o in e)(t||w.call(e,o))&&!(a&&(o=="length"||Nr(o,n)))&&r.push(o);return r}function at(e,t,r){var n=e[t];(!(w.call(e,t)&&ct(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function N(e,t){for(var r=e.length;r--;)if(ct(e[r][0],t))return r;return-1}function vr(e,t){return e&&ot(t,fe(t),e)}function ae(e,t,r,n,a,o,u){var i;if(n&&(i=o?n(e,a,o,u):n(e)),i!==void 0)return i;if(!J(e))return e;var c=se(e);if(c){if(i=Br(e),!t)return Hr(e,i)}else{var l=j(e),d=l==Q||l==Ce;if(Zr(e))return Ir(e,t);if(l==z||l==Z||d&&!o){if(Ye(e))return o?e:{};if(i=Fr(d?{}:e),!t)return Kr(e,vr(i,e))}else{if(!h[l])return o?e:{};i=Gr(e,l,ae,t)}}u||(u=new x);var s=u.get(e);if(s)return s;if(u.set(e,i),!c)var p=r?Lr(e):fe(e);return Lt(p||e,function(f,g){p&&(g=f,f=e[g]),at(i,g,ae(f,t,r,n,g,e,u))}),i}function xr(e){return J(e)?Xt(e):{}}function Wr(e,t,r){var n=t(e);return se(e)?n:Bt(n,r(e))}function Sr(e){return G.call(e)}function Ar(e){if(!J(e)||Jr(e))return!1;var t=ut(e)||Ye(e)?Jt:Et;return t.test(O(e))}function Cr(e){if(!ft(e))return zt(e);var t=[];for(var r in Object(e))w.call(e,r)&&r!="constructor"&&t.push(r);return t}function Ir(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function oe(e){var t=new e.constructor(e.byteLength);return new tt(t).set(new tt(e)),t}function $r(e,t){var r=t?oe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Er(e,t,r){var n=t?r(Ze(e),!0):Ze(e);return Xe(n,Ht,new e.constructor)}function Pr(e){var t=new e.constructor(e.source,$t.exec(e));return t.lastIndex=e.lastIndex,t}function Mr(e,t,r){var n=t?r(Qe(e),!0):Qe(e);return Xe(n,Kt,new e.constructor)}function Rr(e){return it?Object(it.call(e)):{}}function Dr(e,t){var r=t?oe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Hr(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function ot(e,t,r,n){r||(r={});for(var a=-1,o=t.length;++a<o;){var u=t[a],i=n?n(r[u],e[u],u,r,e):void 0;at(r,u,i===void 0?e[u]:i)}return r}function Kr(e,t){return ot(e,st(e),t)}function Lr(e){return Wr(e,fe,st)}function V(e,t){var r=e.__data__;return Vr(t)?r[typeof t=="string"?"string":"hash"]:r.map}function W(e,t){var r=Gt(e,t);return Ar(r)?r:void 0}var st=rt?k(rt,Object):Ur,j=Sr;(te&&j(new te(new ArrayBuffer(1)))!=B||$&&j(new $)!=K||re&&j(re.resolve())!=$e||ne&&j(new ne)!=L||ie&&j(new ie)!=U)&&(j=function(e){var t=G.call(e),r=t==z?e.constructor:void 0,n=r?O(r):void 0;if(n)switch(n){case Ut:return B;case kt:return K;case er:return $e;case tr:return L;case rr:return U}return t});function Br(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&w.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Fr(e){return typeof e.constructor=="function"&&!ft(e)?xr(qt(e)):{}}function Gr(e,t,r,n){var a=e.constructor;switch(t){case Re:return oe(e);case Se:case Ae:return new a(+e);case B:return $r(e,n);case De:case He:case Ke:case Le:case Be:case Fe:case Ge:case Ne:case Ve:return Dr(e,n);case K:return Er(e,n,r);case Ie:case Pe:return new a(e);case Ee:return Pr(e);case L:return Mr(e,n,r);case Me:return Rr(e)}}function Nr(e,t){return t=t==null?We:t,!!t&&(typeof e=="number"||Pt.test(e))&&e>-1&&e%1==0&&e<t}function Vr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Jr(e){return!!ze&&ze in e}function ft(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||F;return e===r}function O(e){if(e!=null){try{return Ue.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function qr(e){return ae(e,!0,!0)}function ct(e,t){return e===t||e!==e&&t!==t}function Xr(e){return Yr(e)&&w.call(e,"callee")&&(!Yt.call(e,"callee")||G.call(e)==Z)}var se=Array.isArray;function lt(e){return e!=null&&Qr(e.length)&&!ut(e)}function Yr(e){return zr(e)&<(e)}var Zr=Qt||kr;function ut(e){var t=J(e)?G.call(e):"";return t==Q||t==Ce}function Qr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=We}function J(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function zr(e){return!!e&&typeof e=="object"}function fe(e){return lt(e)?Or(e):Cr(e)}function Ur(){return[]}function kr(){return!1}S.exports=qr});var pe=Oe((jn,bt)=>{var rn="[object Object]";function nn(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function an(e,t){return function(r){return e(t(r))}}var on=Function.prototype,gt=Object.prototype,dt=on.toString,sn=gt.hasOwnProperty,fn=dt.call(Object),cn=gt.toString,ln=an(Object.getPrototypeOf,Object);function un(e){return!!e&&typeof e=="object"}function hn(e){if(!un(e)||cn.call(e)!=rn||nn(e))return!1;var t=ln(e);if(t===null)return!0;var r=sn.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&dt.call(r)==fn}bt.exports=hn});var bn={};xt(bn,{arrayiffyString:()=>A,defaults:()=>M,flattenArr:()=>R,flattenObject:()=>X,flattenReferencing:()=>dn,version:()=>gn});var be=H(ce(),1);function le(e,t,r=0){if(typeof e!="string")throw new TypeError(`str-indexes-of-plus/strIndexesOfPlus(): first input argument must be a string! Currently it's: ${typeof e}`);if(typeof t!="string")throw new TypeError(`str-indexes-of-plus/strIndexesOfPlus(): second input argument must be a string! Currently it's: ${typeof t}`);if(isNaN(+r)||typeof r=="string"&&!/^\d*$/.test(r))throw new TypeError(`str-indexes-of-plus/strIndexesOfPlus(): third input argument must be a natural number! Currently it's: ${r}`);let n=Array.from(e),a=Array.from(t);if(n.length===0||a.length===0||r!=null&&+r>=n.length)return[];r||(r=0);let o=[],u=!1,i;for(let c=r,l=n.length;c<l;c++)u&&(n[c]===a[c-+i]?c-+i+1===a.length&&o.push(+i):(i=null,u=!1)),u||n[c]===a[0]&&(a.length===1?o.push(c):(u=!0,i=c));return o}function ue(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var he=new Map,ht=(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=="undefined")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})},en=(e,t)=>{t=y({caseSensitive:!1},t);let r=e+JSON.stringify(t);if(he.has(r))return he.get(r);let n=e[0]==="!";n&&(e=e.slice(1)),e=ue(e).replace(/\\\*/g,"[\\s\\S]*");let a=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return a.negated=n,he.set(r,a),a},tn=(e,t,r,n)=>{if(e=ht(e,"inputs"),t=ht(t,"patterns"),t.length===0)return[];t=t.map(u=>en(u,r));let{allPatterns:a}=r||{},o=[];for(let u of e){let i,c=[...t].fill(!1);for(let[l,d]of t.entries())if(d.test(u)&&(c[l]=!0,i=!d.negated,!i))break;if(!(i===!1||i===void 0&&t.some(l=>!l.negated)||a&&c.some((l,d)=>!l&&!t[d].negated))&&(o.push(u),n))break}return o};function pt(e,t,r){return tn(e,t,r,!0).length>0}var Y=H(pe(),1);var ge=H(ce(),1),de=H(pe(),1),M={wrapHeadsWith:"%%_",wrapTailsWith:"_%%",dontWrapKeys:[],dontWrapPaths:[],xhtml:!0,preventDoubleWrapping:!0,preventWrappingIfContains:[],objectKeyAndValueJoinChar:".",wrapGlobalFlipSwitch:!0,ignore:[],whatToDoWhenReferenceIsMissing:0,mergeArraysWithLineBreaks:!0,mergeWithoutTrailingBrIfLineContainsBr:!0,enforceStrictKeyset:!0};function q(e){return typeof e=="string"}function X(e,t){let r=y(y({},M),t);if(arguments.length===0||Object.keys(e).length===0)return[];let n=(0,ge.default)(e),a=[];return(0,de.default)(n)&&Object.keys(n).forEach(o=>{(0,de.default)(n[o])&&(n[o]=X(n[o],r)),Array.isArray(n[o])&&(a=a.concat(n[o].map(u=>`${o}${r.objectKeyAndValueJoinChar}${u}`))),q(n[o])&&a.push(`${o}${r.objectKeyAndValueJoinChar}${n[o]}`)}),a}function R(e,t,r=!1,n=!1){let a=y(y({},M),t);if(arguments.length===0||e.length===0)return"";let o=(0,ge.default)(e),u="";if(o.length>0)if(n){for(let i=0,c=o.length;i<c;i++)if(q(o[i])){let l;l="",a.mergeArraysWithLineBreaks&&i>0&&(!a.mergeWithoutTrailingBrIfLineContainsBr||typeof o[i-1]!="string"||a.mergeWithoutTrailingBrIfLineContainsBr&&o[i-1]!==void 0&&!o[i-1].toLowerCase().includes("<br"))&&(l=`<br${a.xhtml?" /":""}>`),u+=`${l}${r?a.wrapHeadsWith:""}${o[i]}${r?a.wrapTailsWith:""}`}else if(Array.isArray(o[i])&&o[i].length>0&&o[i].every(q)){let l="";a.mergeArraysWithLineBreaks&&u.length>0&&(l=`<br${a.xhtml?" /":""}>`),u=o[i].reduce((d,s,p,f)=>{let g="";return p!==f.length-1&&(g=" "),d+(p===0?l:"")+(r?a.wrapHeadsWith:"")+s+(r?a.wrapTailsWith:"")+g},u)}}else u=o.reduce((i,c,l,d)=>{let s="";a.mergeArraysWithLineBreaks&&l>0&&(s=`<br${a.xhtml?" /":""}>`);let p="";return l!==d.length-1&&(p=" "),`${i}${l===0?s:""}${r?a.wrapHeadsWith:""}${c}${r?a.wrapTailsWith:""}${p}`},u);return u}function A(e){return q(e)?e.length>0?[e]:[]:e}var yt="6.0.12";var gn=yt;function D(e){return e!=null}function C(e){return typeof e=="string"}function dn(e,t,r){if(arguments.length===0)throw new Error("object-flatten-referencing/ofr(): [THROW_ID_01] all inputs missing!");if(arguments.length===1)throw new Error("object-flatten-referencing/ofr(): [THROW_ID_02] reference object missing!");if(D(r)&&!(0,Y.default)(r))throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_03] third input, options object must be a plain object. Currently it's: ${typeof r}`);let n=y(y({},M),r);n.dontWrapKeys=A(n.dontWrapKeys),n.preventWrappingIfContains=A(n.preventWrappingIfContains),n.dontWrapPaths=A(n.dontWrapPaths),n.ignore=A(n.ignore),typeof n.whatToDoWhenReferenceIsMissing!="number"&&(n.whatToDoWhenReferenceIsMissing=+n.whatToDoWhenReferenceIsMissing||0);function a(o,u,i,c=!0,l=!0,d=""){let s=(0,be.default)(o),p=(0,be.default)(u);return i.wrapGlobalFlipSwitch||(c=!1),(0,Y.default)(s)?Object.keys(s).forEach(f=>{let g=d+(d.length===0?f:`.${f}`);if(i.ignore.length===0||!i.ignore.includes(f)){if(i.wrapGlobalFlipSwitch&&(c=!0,i.dontWrapKeys.length>0&&(c=c&&!i.dontWrapKeys.some(b=>pt(f,b,{caseSensitive:!0}))),i.dontWrapPaths.length>0&&(c=c&&!i.dontWrapPaths.some(b=>b===g)),i.preventWrappingIfContains.length>0&&typeof s[f]=="string"&&(c=c&&!i.preventWrappingIfContains.some(b=>s[f].includes(b)))),D(p[f])||!D(p[f])&&i.whatToDoWhenReferenceIsMissing===2)if(Array.isArray(s[f]))if(i.whatToDoWhenReferenceIsMissing===2||C(p[f]))s[f]=R(s[f],i,c,l);else{if(s[f].every(b=>typeof b=="string"||Array.isArray(b))){let b=!0;s[f].forEach(ye=>{Array.isArray(ye)&&!ye.every(C)&&(b=!1)}),b&&(l=!1)}s[f]=a(s[f],p[f],i,c,l,g)}else(0,Y.default)(s[f])?i.whatToDoWhenReferenceIsMissing===2||C(p[f])?s[f]=R(X(s[f],i),i,c,l):c?s[f]=a(s[f],p[f],i,c,l,g):s[f]=a(s[f],p[f],Te(y({},i),{wrapGlobalFlipSwitch:!1}),c,l,g):C(s[f])&&(s[f]=a(s[f],p[f],i,c,l,g));else if(typeof s[f]!=typeof p[f]&&i.whatToDoWhenReferenceIsMissing===1)throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_06] reference object does not have the key ${f} and we need it. TIP: Turn off throwing via opts.whatToDoWhenReferenceIsMissing.`)}}):Array.isArray(s)?Array.isArray(p)?s.forEach((f,g)=>{D(s[g])&&D(p[g])?s[g]=a(s[g],p[g],i,c,l,`${d}[${g}]`):s[g]=a(s[g],p[0],i,c,l,`${d}[${g}]`)}):C(p)&&(s=R(s,i,c,l)):C(s)&&s.length>0&&(i.wrapHeadsWith||i.wrapTailsWith)&&(!i.preventDoubleWrapping||(i.wrapHeadsWith===""||!le(s,i.wrapHeadsWith.trim()).length)&&(i.wrapTailsWith===""||!le(s,i.wrapTailsWith.trim()).length))&&(s=`${c?i.wrapHeadsWith:""}${s}${c?i.wrapTailsWith:""}`),s}return a(e,t,n)}return Wt(bn);})();
|
|
10
|
+
var objectFlattenReferencing=(()=>{var yt=Object.create;var I=Object.defineProperty,_t=Object.defineProperties,mt=Object.getOwnPropertyDescriptor,wt=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertyNames,_e=Object.getOwnPropertySymbols,jt=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable;var me=(e,t,r)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y=(e,t)=>{for(var r in t||(t={}))we.call(t,r)&&me(e,r,t[r]);if(_e)for(var r of _e(t))Ot.call(t,r)&&me(e,r,t[r]);return e},Te=(e,t)=>_t(e,wt(t));var je=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vt=(e,t)=>{for(var r in t)I(e,r,{get:t[r],enumerable:!0})},Oe=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Tt(t))!we.call(e,a)&&a!==r&&I(e,a,{get:()=>t[a],enumerable:!(n=mt(t,a))||n.enumerable});return e};var H=(e,t,r)=>(r=e!=null?yt(jt(e)):{},Oe(t||!e||!e.__esModule?I(r,"default",{value:e,enumerable:!0}):r,e)),xt=e=>Oe(I({},"__esModule",{value:!0}),e);var ce=je(($,v)=>{var Wt=200,Re="__lodash_hash_undefined__",De=9007199254740991,re="[object Arguments]",St="[object Array]",He="[object Boolean]",Ke="[object Date]",At="[object Error]",ne="[object Function]",Le="[object GeneratorFunction]",K="[object Map]",Be="[object Number]",ie="[object Object]",ve="[object Promise]",Fe="[object RegExp]",L="[object Set]",Ge="[object String]",Ne="[object Symbol]",Q="[object WeakMap]",Ve="[object ArrayBuffer]",B="[object DataView]",Je="[object Float32Array]",qe="[object Float64Array]",Xe="[object Int8Array]",Ye="[object Int16Array]",Ze="[object Int32Array]",Qe="[object Uint8Array]",ze="[object Uint8ClampedArray]",Ue="[object Uint16Array]",ke="[object Uint32Array]",Ct=/[\\^$.*+?()[\]{}|]/g,It=/\w*$/,$t=/^\[object .+?Constructor\]$/,Et=/^(?:0|[1-9]\d*)$/,h={};h[re]=h[St]=h[Ve]=h[B]=h[He]=h[Ke]=h[Je]=h[qe]=h[Xe]=h[Ye]=h[Ze]=h[K]=h[Be]=h[ie]=h[Fe]=h[L]=h[Ge]=h[Ne]=h[Qe]=h[ze]=h[Ue]=h[ke]=!0;h[At]=h[ne]=h[Q]=!1;var Pt=typeof global=="object"&&global&&global.Object===Object&&global,Mt=typeof self=="object"&&self&&self.Object===Object&&self,_=Pt||Mt||Function("return this")(),et=typeof $=="object"&&$&&!$.nodeType&&$,xe=et&&typeof v=="object"&&v&&!v.nodeType&&v,Rt=xe&&xe.exports===et;function Dt(e,t){return e.set(t[0],t[1]),e}function Ht(e,t){return e.add(t),e}function Kt(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function Lt(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}function tt(e,t,r,n){var a=-1,o=e?e.length:0;for(n&&o&&(r=e[++a]);++a<o;)r=t(r,e[a],a,e);return r}function Bt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Ft(e,t){return e==null?void 0:e[t]}function rt(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function We(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function ae(e,t){return function(r){return e(t(r))}}function Se(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Gt=Array.prototype,Nt=Function.prototype,F=Object.prototype,Z=_["__core-js_shared__"],Ae=function(){var e=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),nt=Nt.toString,w=F.hasOwnProperty,G=F.toString,Vt=RegExp("^"+nt.call(w).replace(Ct,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ce=Rt?_.Buffer:void 0,Ie=_.Symbol,$e=_.Uint8Array,Jt=ae(Object.getPrototypeOf,Object),qt=Object.create,Xt=F.propertyIsEnumerable,Yt=Gt.splice,Ee=Object.getOwnPropertySymbols,Zt=Ce?Ce.isBuffer:void 0,Qt=ae(Object.keys,Object),z=S(_,"DataView"),E=S(_,"Map"),U=S(_,"Promise"),k=S(_,"Set"),ee=S(_,"WeakMap"),P=S(Object,"create"),zt=O(z),Ut=O(E),kt=O(U),er=O(k),tr=O(ee),Pe=Ie?Ie.prototype:void 0,Me=Pe?Pe.valueOf:void 0;function j(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function rr(){this.__data__=P?P(null):{}}function nr(e){return this.has(e)&&delete this.__data__[e]}function ir(e){var t=this.__data__;if(P){var r=t[e];return r===Re?void 0:r}return w.call(t,e)?t[e]:void 0}function ar(e){var t=this.__data__;return P?t[e]!==void 0:w.call(t,e)}function or(e,t){var r=this.__data__;return r[e]=P&&t===void 0?Re:t,this}j.prototype.clear=rr;j.prototype.delete=nr;j.prototype.get=ir;j.prototype.has=ar;j.prototype.set=or;function m(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function sr(){this.__data__=[]}function fr(e){var t=this.__data__,r=N(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Yt.call(t,r,1),!0}function cr(e){var t=this.__data__,r=N(t,e);return r<0?void 0:t[r][1]}function lr(e){return N(this.__data__,e)>-1}function ur(e,t){var r=this.__data__,n=N(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}m.prototype.clear=sr;m.prototype.delete=fr;m.prototype.get=cr;m.prototype.has=lr;m.prototype.set=ur;function x(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function hr(){this.__data__={hash:new j,map:new(E||m),string:new j}}function pr(e){return V(this,e).delete(e)}function gr(e){return V(this,e).get(e)}function dr(e){return V(this,e).has(e)}function br(e,t){return V(this,e).set(e,t),this}x.prototype.clear=hr;x.prototype.delete=pr;x.prototype.get=gr;x.prototype.has=dr;x.prototype.set=br;function W(e){this.__data__=new m(e)}function yr(){this.__data__=new m}function _r(e){return this.__data__.delete(e)}function mr(e){return this.__data__.get(e)}function wr(e){return this.__data__.has(e)}function Tr(e,t){var r=this.__data__;if(r instanceof m){var n=r.__data__;if(!E||n.length<Wt-1)return n.push([e,t]),this;r=this.__data__=new x(n)}return r.set(e,t),this}W.prototype.clear=yr;W.prototype.delete=_r;W.prototype.get=mr;W.prototype.has=wr;W.prototype.set=Tr;function jr(e,t){var r=se(e)||qr(e)?Bt(e.length,String):[],n=r.length,a=!!n;for(var o in e)(t||w.call(e,o))&&!(a&&(o=="length"||Gr(o,n)))&&r.push(o);return r}function it(e,t,r){var n=e[t];(!(w.call(e,t)&&ft(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function N(e,t){for(var r=e.length;r--;)if(ft(e[r][0],t))return r;return-1}function Or(e,t){return e&&at(t,fe(t),e)}function te(e,t,r,n,a,o,u){var i;if(n&&(i=o?n(e,a,o,u):n(e)),i!==void 0)return i;if(!J(e))return e;var c=se(e);if(c){if(i=Lr(e),!t)return Dr(e,i)}else{var l=T(e),d=l==ne||l==Le;if(Yr(e))return Cr(e,t);if(l==ie||l==re||d&&!o){if(rt(e))return o?e:{};if(i=Br(d?{}:e),!t)return Hr(e,Or(i,e))}else{if(!h[l])return o?e:{};i=Fr(e,l,te,t)}}u||(u=new W);var s=u.get(e);if(s)return s;if(u.set(e,i),!c)var p=r?Kr(e):fe(e);return Kt(p||e,function(f,g){p&&(g=f,f=e[g]),it(i,g,te(f,t,r,n,g,e,u))}),i}function vr(e){return J(e)?qt(e):{}}function xr(e,t,r){var n=t(e);return se(e)?n:Lt(n,r(e))}function Wr(e){return G.call(e)}function Sr(e){if(!J(e)||Vr(e))return!1;var t=lt(e)||rt(e)?Vt:$t;return t.test(O(e))}function Ar(e){if(!st(e))return Qt(e);var t=[];for(var r in Object(e))w.call(e,r)&&r!="constructor"&&t.push(r);return t}function Cr(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function oe(e){var t=new e.constructor(e.byteLength);return new $e(t).set(new $e(e)),t}function Ir(e,t){var r=t?oe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function $r(e,t,r){var n=t?r(We(e),!0):We(e);return tt(n,Dt,new e.constructor)}function Er(e){var t=new e.constructor(e.source,It.exec(e));return t.lastIndex=e.lastIndex,t}function Pr(e,t,r){var n=t?r(Se(e),!0):Se(e);return tt(n,Ht,new e.constructor)}function Mr(e){return Me?Object(Me.call(e)):{}}function Rr(e,t){var r=t?oe(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Dr(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function at(e,t,r,n){r||(r={});for(var a=-1,o=t.length;++a<o;){var u=t[a],i=n?n(r[u],e[u],u,r,e):void 0;it(r,u,i===void 0?e[u]:i)}return r}function Hr(e,t){return at(e,ot(e),t)}function Kr(e){return xr(e,fe,ot)}function V(e,t){var r=e.__data__;return Nr(t)?r[typeof t=="string"?"string":"hash"]:r.map}function S(e,t){var r=Ft(e,t);return Sr(r)?r:void 0}var ot=Ee?ae(Ee,Object):zr,T=Wr;(z&&T(new z(new ArrayBuffer(1)))!=B||E&&T(new E)!=K||U&&T(U.resolve())!=ve||k&&T(new k)!=L||ee&&T(new ee)!=Q)&&(T=function(e){var t=G.call(e),r=t==ie?e.constructor:void 0,n=r?O(r):void 0;if(n)switch(n){case zt:return B;case Ut:return K;case kt:return ve;case er:return L;case tr:return Q}return t});function Lr(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&w.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Br(e){return typeof e.constructor=="function"&&!st(e)?vr(Jt(e)):{}}function Fr(e,t,r,n){var a=e.constructor;switch(t){case Ve:return oe(e);case He:case Ke:return new a(+e);case B:return Ir(e,n);case Je:case qe:case Xe:case Ye:case Ze:case Qe:case ze:case Ue:case ke:return Rr(e,n);case K:return $r(e,n,r);case Be:case Ge:return new a(e);case Fe:return Er(e);case L:return Pr(e,n,r);case Ne:return Mr(e)}}function Gr(e,t){return t=t==null?De:t,!!t&&(typeof e=="number"||Et.test(e))&&e>-1&&e%1==0&&e<t}function Nr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Vr(e){return!!Ae&&Ae in e}function st(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||F;return e===r}function O(e){if(e!=null){try{return nt.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Jr(e){return te(e,!0,!0)}function ft(e,t){return e===t||e!==e&&t!==t}function qr(e){return Xr(e)&&w.call(e,"callee")&&(!Xt.call(e,"callee")||G.call(e)==re)}var se=Array.isArray;function ct(e){return e!=null&&Zr(e.length)&&!lt(e)}function Xr(e){return Qr(e)&&ct(e)}var Yr=Zt||Ur;function lt(e){var t=J(e)?G.call(e):"";return t==ne||t==Le}function Zr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=De}function J(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Qr(e){return!!e&&typeof e=="object"}function fe(e){return ct(e)?jr(e):Ar(e)}function zr(){return[]}function Ur(){return!1}v.exports=Jr});var pe=je((Tn,dt)=>{var tn="[object Object]";function rn(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function nn(e,t){return function(r){return e(t(r))}}var an=Function.prototype,pt=Object.prototype,gt=an.toString,on=pt.hasOwnProperty,sn=gt.call(Object),fn=pt.toString,cn=nn(Object.getPrototypeOf,Object);function ln(e){return!!e&&typeof e=="object"}function un(e){if(!ln(e)||fn.call(e)!=tn||rn(e))return!1;var t=cn(e);if(t===null)return!0;var r=on.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&>.call(r)==sn}dt.exports=un});var dn={};vt(dn,{arrayiffyString:()=>A,defaults:()=>M,flattenArr:()=>R,flattenObject:()=>X,flattenReferencing:()=>gn,version:()=>pn});var be=H(ce(),1);function le(e,t,r=0){if(typeof e!="string")throw new TypeError(`str-indexes-of-plus/strIndexesOfPlus(): first input argument must be a string! Currently it's: ${typeof e}`);if(typeof t!="string")throw new TypeError(`str-indexes-of-plus/strIndexesOfPlus(): second input argument must be a string! Currently it's: ${typeof t}`);if(isNaN(+r)||typeof r=="string"&&!/^\d*$/.test(r))throw new TypeError(`str-indexes-of-plus/strIndexesOfPlus(): third input argument must be a natural number! Currently it's: ${r}`);let n=Array.from(e),a=Array.from(t);if(n.length===0||a.length===0||r!=null&&+r>=n.length)return[];r||(r=0);let o=[],u=!1,i;for(let c=r,l=n.length;c<l;c++)u&&(n[c]===a[c-+i]?c-+i+1===a.length&&o.push(+i):(i=null,u=!1)),u||n[c]===a[0]&&(a.length===1?o.push(c):(u=!0,i=c));return o}function ue(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var he=new Map,ut=(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})},kr=(e,t)=>{t=y({caseSensitive:!1},t);let r=e+JSON.stringify(t);if(he.has(r))return he.get(r);let n=e[0]==="!";n&&(e=e.slice(1)),e=ue(e).replace(/\\\*/g,"[\\s\\S]*");let a=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return a.negated=n,he.set(r,a),a},en=(e,t,r,n)=>{if(e=ut(e,"inputs"),t=ut(t,"patterns"),t.length===0)return[];t=t.map(u=>kr(u,r));let{allPatterns:a}=r||{},o=[];for(let u of e){let i,c=[...t].fill(!1);for(let[l,d]of t.entries())if(d.test(u)&&(c[l]=!0,i=!d.negated,!i))break;if(!(i===!1||i===void 0&&t.some(l=>!l.negated)||a&&c.some((l,d)=>!l&&!t[d].negated))&&(o.push(u),n))break}return o};function ht(e,t,r){return en(e,t,r,!0).length>0}var Y=H(pe(),1);var de=H(ce(),1),ge=H(pe(),1),M={wrapHeadsWith:"%%_",wrapTailsWith:"_%%",dontWrapKeys:[],dontWrapPaths:[],xhtml:!0,preventDoubleWrapping:!0,preventWrappingIfContains:[],objectKeyAndValueJoinChar:".",wrapGlobalFlipSwitch:!0,ignore:[],whatToDoWhenReferenceIsMissing:0,mergeArraysWithLineBreaks:!0,mergeWithoutTrailingBrIfLineContainsBr:!0,enforceStrictKeyset:!0};function q(e){return typeof e=="string"}function X(e,t){let r=y(y({},M),t);if(arguments.length===0||Object.keys(e).length===0)return[];let n=(0,de.default)(e),a=[];return(0,ge.default)(n)&&Object.keys(n).forEach(o=>{(0,ge.default)(n[o])&&(n[o]=X(n[o],r)),Array.isArray(n[o])&&(a=a.concat(n[o].map(u=>`${o}${r.objectKeyAndValueJoinChar}${u}`))),q(n[o])&&a.push(`${o}${r.objectKeyAndValueJoinChar}${n[o]}`)}),a}function R(e,t,r=!1,n=!1){let a=y(y({},M),t);if(arguments.length===0||e.length===0)return"";let o=(0,de.default)(e),u="";if(o.length)if(n){for(let i=0,c=o.length;i<c;i++)if(q(o[i])){let l;l="",a.mergeArraysWithLineBreaks&&i>0&&(!a.mergeWithoutTrailingBrIfLineContainsBr||typeof o[i-1]!="string"||a.mergeWithoutTrailingBrIfLineContainsBr&&o[i-1]!==void 0&&!o[i-1].toLowerCase().includes("<br"))&&(l=`<br${a.xhtml?" /":""}>`),u+=`${l}${r?a.wrapHeadsWith:""}${o[i]}${r?a.wrapTailsWith:""}`}else if(Array.isArray(o[i])&&o[i].length&&o[i].every(q)){let l="";a.mergeArraysWithLineBreaks&&u.length&&(l=`<br${a.xhtml?" /":""}>`),u=o[i].reduce((d,s,p,f)=>{let g="";return p!==f.length-1&&(g=" "),d+(p===0?l:"")+(r?a.wrapHeadsWith:"")+s+(r?a.wrapTailsWith:"")+g},u)}}else u=o.reduce((i,c,l,d)=>{let s="";a.mergeArraysWithLineBreaks&&l>0&&(s=`<br${a.xhtml?" /":""}>`);let p="";return l!==d.length-1&&(p=" "),`${i}${l===0?s:""}${r?a.wrapHeadsWith:""}${c}${r?a.wrapTailsWith:""}${p}`},u);return u}function A(e){return q(e)?e.length?[e]:[]:e}var bt="6.1.0";var pn=bt;function D(e){return e!=null}function C(e){return typeof e=="string"}function gn(e,t,r){if(arguments.length===0)throw new Error("object-flatten-referencing/ofr(): [THROW_ID_01] all inputs missing!");if(arguments.length===1)throw new Error("object-flatten-referencing/ofr(): [THROW_ID_02] reference object missing!");if(D(r)&&!(0,Y.default)(r))throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_03] third input, options object must be a plain object. Currently it's: ${typeof r}`);let n=y(y({},M),r);n.dontWrapKeys=A(n.dontWrapKeys),n.preventWrappingIfContains=A(n.preventWrappingIfContains),n.dontWrapPaths=A(n.dontWrapPaths),n.ignore=A(n.ignore),typeof n.whatToDoWhenReferenceIsMissing!="number"&&(n.whatToDoWhenReferenceIsMissing=+n.whatToDoWhenReferenceIsMissing||0);function a(o,u,i,c=!0,l=!0,d=""){let s=(0,be.default)(o),p=(0,be.default)(u);return i.wrapGlobalFlipSwitch||(c=!1),(0,Y.default)(s)?Object.keys(s).forEach(f=>{let g=d+(d.length===0?f:`.${f}`);if(i.ignore.length===0||!i.ignore.includes(f)){if(i.wrapGlobalFlipSwitch&&(c=!0,i.dontWrapKeys.length&&(c=c&&!i.dontWrapKeys.some(b=>ht(f,b,{caseSensitive:!0}))),i.dontWrapPaths.length&&(c=c&&!i.dontWrapPaths.some(b=>b===g)),i.preventWrappingIfContains.length&&typeof s[f]=="string"&&(c=c&&!i.preventWrappingIfContains.some(b=>s[f].includes(b)))),D(p[f])||!D(p[f])&&i.whatToDoWhenReferenceIsMissing===2)if(Array.isArray(s[f]))if(i.whatToDoWhenReferenceIsMissing===2||C(p[f]))s[f]=R(s[f],i,c,l);else{if(s[f].every(b=>typeof b=="string"||Array.isArray(b))){let b=!0;s[f].forEach(ye=>{Array.isArray(ye)&&!ye.every(C)&&(b=!1)}),b&&(l=!1)}s[f]=a(s[f],p[f],i,c,l,g)}else(0,Y.default)(s[f])?i.whatToDoWhenReferenceIsMissing===2||C(p[f])?s[f]=R(X(s[f],i),i,c,l):c?s[f]=a(s[f],p[f],i,c,l,g):s[f]=a(s[f],p[f],Te(y({},i),{wrapGlobalFlipSwitch:!1}),c,l,g):C(s[f])&&(s[f]=a(s[f],p[f],i,c,l,g));else if(typeof s[f]!=typeof p[f]&&i.whatToDoWhenReferenceIsMissing===1)throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_06] reference object does not have the key ${f} and we need it. TIP: Turn off throwing via opts.whatToDoWhenReferenceIsMissing.`)}}):Array.isArray(s)?Array.isArray(p)?s.forEach((f,g)=>{D(s[g])&&D(p[g])?s[g]=a(s[g],p[g],i,c,l,`${d}[${g}]`):s[g]=a(s[g],p[0],i,c,l,`${d}[${g}]`)}):C(p)&&(s=R(s,i,c,l)):C(s)&&s.length&&(i.wrapHeadsWith||i.wrapTailsWith)&&(!i.preventDoubleWrapping||(i.wrapHeadsWith===""||!le(s,i.wrapHeadsWith.trim()).length)&&(i.wrapTailsWith===""||!le(s,i.wrapTailsWith.trim()).length))&&(s=`${c?i.wrapHeadsWith:""}${s}${c?i.wrapTailsWith:""}`),s}return a(e,t,n)}return xt(dn);})();
|
|
11
11
|
/**
|
|
12
12
|
* @name str-indexes-of-plus
|
|
13
13
|
* @fileoverview Like indexOf but returns array and counts per-grapheme
|