object-flatten-referencing 7.0.11 → 7.0.12

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.
@@ -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 7.0.11
4
+ * @version 7.0.12
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 C}from"matcher";import{existy as W,isStr as u,isPlainObject as y}from"codsen-utils";import $ from"lodash.clonedeep";import{isStr as v,isPlainObject as I}from"codsen-utils";var j={wrapHeadsWith:"%%_",wrapTailsWith:"_%%",dontWrapKeys:[],dontWrapPaths:[],xhtml:!0,preventDoubleWrapping:!0,preventWrappingIfContains:[],objectKeyAndValueJoinChar:".",wrapGlobalFlipSwitch:!0,ignore:[],whatToDoWhenReferenceIsMissing:0,mergeArraysWithLineBreaks:!0,mergeWithoutTrailingBrIfLineContainsBr:!0,enforceStrictKeyset:!0};function w(h,m){let c={...j,...m};if(arguments.length===0||Object.keys(h).length===0)return[];let i=$(h),n=[];return I(i)&&Object.keys(i).forEach(s=>{I(i[s])&&(i[s]=w(i[s],c)),Array.isArray(i[s])&&(n=n.concat(i[s].map(p=>`${s}${c.objectKeyAndValueJoinChar}${p}`))),v(i[s])&&n.push(`${s}${c.objectKeyAndValueJoinChar}${i[s]}`)}),n}function O(h,m,c=!1,i=!1){let n={...j,...m};if(arguments.length===0||h.length===0)return"";let s=$(h),p="";if(s.length)if(i){for(let e=0,a=s.length;e<a;e++)if(v(s[e])){let l;l="",n.mergeArraysWithLineBreaks&&e>0&&(!n.mergeWithoutTrailingBrIfLineContainsBr||typeof s[e-1]!="string"||n.mergeWithoutTrailingBrIfLineContainsBr&&s[e-1]!==void 0&&!s[e-1].toLowerCase().includes("<br"))&&(l=`<br${n.xhtml?" /":""}>`),p+=`${l}${c?n.wrapHeadsWith:""}${s[e]}${c?n.wrapTailsWith:""}`}else if(Array.isArray(s[e])&&s[e].length&&s[e].every(v)){let l="";n.mergeArraysWithLineBreaks&&p.length&&(l=`<br${n.xhtml?" /":""}>`),p=s[e].reduce((g,t,o,r)=>{let f="";return o!==r.length-1&&(f=" "),g+(o===0?l:"")+(c?n.wrapHeadsWith:"")+t+(c?n.wrapTailsWith:"")+f},p)}}else p=s.reduce((e,a,l,g)=>{let t="";n.mergeArraysWithLineBreaks&&l>0&&(t=`<br${n.xhtml?" /":""}>`);let o="";return l!==g.length-1&&(o=" "),`${e}${l===0?t:""}${c?n.wrapHeadsWith:""}${a}${c?n.wrapTailsWith:""}${o}`},p);return p}function b(h){return v(h)?h.length?[h]:[]:h}var x="7.0.11";var q=x;function z(h,m,c){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] resolvedReference object missing!");if(W(c)&&!y(c))throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_03] third resolvedInput, options object must be a plain object. Currently it's: ${typeof c}`);let i={...j,...c};i.dontWrapKeys=b(i.dontWrapKeys),i.preventWrappingIfContains=b(i.preventWrappingIfContains),i.dontWrapPaths=b(i.dontWrapPaths),i.ignore=b(i.ignore),typeof i.whatToDoWhenReferenceIsMissing!="number"&&(i.whatToDoWhenReferenceIsMissing=+i.whatToDoWhenReferenceIsMissing||0);function n(s,p,e,a=!0,l=!0,g=""){let t=D(s),o=D(p);return e.wrapGlobalFlipSwitch||(a=!1),y(t)?Object.keys(t).forEach(r=>{let f=g+(g.length===0?r:`.${r}`);if(e.ignore.length===0||!e.ignore.includes(r)){if(e.wrapGlobalFlipSwitch&&(a=!0,e.dontWrapKeys.length&&(a=a&&!e.dontWrapKeys.some(d=>C(r,d,{caseSensitive:!0}))),e.dontWrapPaths.length&&(a=a&&!e.dontWrapPaths.some(d=>d===f)),e.preventWrappingIfContains.length&&typeof t[r]=="string"&&(a=a&&!e.preventWrappingIfContains.some(d=>t[r].includes(d)))),W(o[r])||!W(o[r])&&e.whatToDoWhenReferenceIsMissing===2)if(Array.isArray(t[r]))if(e.whatToDoWhenReferenceIsMissing===2||u(o[r]))t[r]=O(t[r],e,a,l);else{if(t[r].every(d=>typeof d=="string"||Array.isArray(d))){let d=!0;t[r].forEach(T=>{Array.isArray(T)&&!T.every(u)&&(d=!1)}),d&&(l=!1)}t[r]=n(t[r],o[r],e,a,l,f)}else y(t[r])?e.whatToDoWhenReferenceIsMissing===2||u(o[r])?t[r]=O(w(t[r],e),e,a,l):a?t[r]=n(t[r],o[r],e,a,l,f):t[r]=n(t[r],o[r],{...e,wrapGlobalFlipSwitch:!1},a,l,f):u(t[r])&&(t[r]=n(t[r],o[r],e,a,l,f));else if(typeof t[r]!=typeof o[r]&&e.whatToDoWhenReferenceIsMissing===1)throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_06] resolvedReference object does not have the key ${r} and we need it. TIP: Turn off throwing via opts2.whatToDoWhenReferenceIsMissing.`)}}):Array.isArray(t)?Array.isArray(o)?t.forEach((r,f)=>{W(t[f])&&W(o[f])?t[f]=n(t[f],o[f],e,a,l,`${g}[${f}]`):t[f]=n(t[f],o[0],e,a,l,`${g}[${f}]`)}):u(o)&&(t=O(t,e,a,l)):u(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=`${a?e.wrapHeadsWith:""}${t}${a?e.wrapTailsWith:""}`),t}return n(h,m,i)}export{b as arrayiffyString,j as defaults,O as flattenArr,w as flattenObject,z as flattenReferencing,q as version};
10
+ import C from"rfdc";import{strIndexesOfPlus as S}from"str-indexes-of-plus";import{isMatch as J}from"matcher";import{arrayiffy as v}from"arrayiffy-if-string";import{existy as y,isStr as m,isPlainObject as b}from"codsen-utils";import D from"rfdc";import{isStr as w,isPlainObject as I}from"codsen-utils";var T=D(),W={wrapHeadsWith:"%%_",wrapTailsWith:"_%%",dontWrapKeys:[],dontWrapPaths:[],xhtml:!0,preventDoubleWrapping:!0,preventWrappingIfContains:[],objectKeyAndValueJoinChar:".",wrapGlobalFlipSwitch:!0,ignore:[],whatToDoWhenReferenceIsMissing:0,mergeArraysWithLineBreaks:!0,mergeWithoutTrailingBrIfLineContainsBr:!0,enforceStrictKeyset:!0};function j(u,g){let c={...W,...g};if(arguments.length===0||Object.keys(u).length===0)return[];let i=T(u),n=[];return I(i)&&Object.keys(i).forEach(a=>{I(i[a])&&(i[a]=j(i[a],c)),Array.isArray(i[a])&&(n=n.concat(i[a].map(p=>`${a}${c.objectKeyAndValueJoinChar}${p}`))),w(i[a])&&n.push(`${a}${c.objectKeyAndValueJoinChar}${i[a]}`)}),n}function O(u,g,c=!1,i=!1){let n={...W,...g};if(arguments.length===0||u.length===0)return"";let a=T(u),p="";if(a.length)if(i){for(let e=0,s=a.length;e<s;e++)if(w(a[e])){let l;l="",n.mergeArraysWithLineBreaks&&e>0&&(!n.mergeWithoutTrailingBrIfLineContainsBr||typeof a[e-1]!="string"||n.mergeWithoutTrailingBrIfLineContainsBr&&a[e-1]!==void 0&&!a[e-1].toLowerCase().includes("<br"))&&(l=`<br${n.xhtml?" /":""}>`),p+=`${l}${c?n.wrapHeadsWith:""}${a[e]}${c?n.wrapTailsWith:""}`}else if(Array.isArray(a[e])&&a[e].length&&a[e].every(w)){let l="";n.mergeArraysWithLineBreaks&&p.length&&(l=`<br${n.xhtml?" /":""}>`),p=a[e].reduce((d,t,o,r)=>{let f="";return o!==r.length-1&&(f=" "),d+(o===0?l:"")+(c?n.wrapHeadsWith:"")+t+(c?n.wrapTailsWith:"")+f},p)}}else p=a.reduce((e,s,l,d)=>{let t="";n.mergeArraysWithLineBreaks&&l>0&&(t=`<br${n.xhtml?" /":""}>`);let o="";return l!==d.length-1&&(o=" "),`${e}${l===0?t:""}${c?n.wrapHeadsWith:""}${s}${c?n.wrapTailsWith:""}${o}`},p);return p}var x="7.0.12";var A=C(),X=x;function Y(u,g,c){if(!b(u))throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_01] the first input argument must be a plain object! It was given as ${JSON.stringify(u,null,4)} (its typeof was ${typeof u}).`);if(!b(g))throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_02] the second input argument must be a plain object! It was given as ${JSON.stringify(g,null,4)} (its typeof was ${typeof g}).`);if(c&&!b(c))throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_03] the third input argument must be a plain object! It was given as ${JSON.stringify(c,null,4)} (its typeof was ${typeof c}).`);let i={...W,...c};i.dontWrapKeys=v(i.dontWrapKeys),i.preventWrappingIfContains=v(i.preventWrappingIfContains),i.dontWrapPaths=v(i.dontWrapPaths),i.ignore=v(i.ignore),typeof i.whatToDoWhenReferenceIsMissing!="number"&&(i.whatToDoWhenReferenceIsMissing=+i.whatToDoWhenReferenceIsMissing||0);function n(a,p,e,s=!0,l=!0,d=""){let t=A(a),o=A(p);return e.wrapGlobalFlipSwitch||(s=!1),b(t)?Object.keys(t).forEach(r=>{let f=d+(d.length===0?r:`.${r}`);if(e.ignore.length===0||!e.ignore.includes(r)){if(e.wrapGlobalFlipSwitch&&(s=!0,e.dontWrapKeys.length&&(s=s&&!e.dontWrapKeys.some(h=>J(r,h,{caseSensitive:!0}))),e.dontWrapPaths.length&&(s=s&&!e.dontWrapPaths.some(h=>h===f)),e.preventWrappingIfContains.length&&typeof t[r]=="string"&&(s=s&&!e.preventWrappingIfContains.some(h=>t[r].includes(h)))),y(o[r])||!y(o[r])&&e.whatToDoWhenReferenceIsMissing===2)if(Array.isArray(t[r]))if(e.whatToDoWhenReferenceIsMissing===2||m(o[r]))t[r]=O(t[r],e,s,l);else{if(t[r].every(h=>typeof h=="string"||Array.isArray(h))){let h=!0;t[r].forEach($=>{Array.isArray($)&&!$.every(m)&&(h=!1)}),h&&(l=!1)}t[r]=n(t[r],o[r],e,s,l,f)}else b(t[r])?e.whatToDoWhenReferenceIsMissing===2||m(o[r])?t[r]=O(j(t[r],e),e,s,l):s?t[r]=n(t[r],o[r],e,s,l,f):t[r]=n(t[r],o[r],{...e,wrapGlobalFlipSwitch:!1},s,l,f):m(t[r])&&(t[r]=n(t[r],o[r],e,s,l,f));else if(typeof t[r]!=typeof o[r]&&e.whatToDoWhenReferenceIsMissing===1)throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_06] resolvedReference object does not have the key ${r} and we need it. TIP: Turn off throwing via opts2.whatToDoWhenReferenceIsMissing.`)}}):Array.isArray(t)?Array.isArray(o)?t.forEach((r,f)=>{y(t[f])&&y(o[f])?t[f]=n(t[f],o[f],e,s,l,`${d}[${f}]`):t[f]=n(t[f],o[0],e,s,l,`${d}[${f}]`)}):m(o)&&(t=O(t,e,s,l)):m(t)&&t.length&&(e.wrapHeadsWith||e.wrapTailsWith)&&(!e.preventDoubleWrapping||(e.wrapHeadsWith===""||!S(t,e.wrapHeadsWith.trim()).length)&&(e.wrapTailsWith===""||!S(t,e.wrapTailsWith.trim()).length))&&(t=`${s?e.wrapHeadsWith:""}${t}${s?e.wrapTailsWith:""}`),t}return n(u,g,i)}export{v as arrayiffy,W as defaults,O as flattenArr,j as flattenObject,Y as flattenReferencing,X 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 7.0.11
4
+ * @version 7.0.12
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
- "use strict";var objectFlattenReferencing=(()=>{var ft=Object.create;var E=Object.defineProperty,lt=Object.defineProperties,ht=Object.getOwnPropertyDescriptor,pt=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertyNames,de=Object.getOwnPropertySymbols,gt=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty,bt=Object.prototype.propertyIsEnumerable;var ge=(e,t,r)=>t in e?E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t)=>{for(var r in t||(t={}))be.call(t,r)&&ge(e,r,t[r]);if(de)for(var r of de(t))bt.call(t,r)&&ge(e,r,t[r]);return e},ye=(e,t)=>lt(e,pt(t));var yt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),mt=(e,t)=>{for(var r in t)E(e,r,{get:t[r],enumerable:!0})},me=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of dt(t))!be.call(e,a)&&a!==r&&E(e,a,{get:()=>t[a],enumerable:!(n=ht(t,a))||n.enumerable});return e};var _e=(e,t,r)=>(r=e!=null?ft(gt(e)):{},me(t||!e||!e.__esModule?E(r,"default",{value:e,enumerable:!0}):r,e)),_t=e=>me(E({},"__esModule",{value:!0}),e);var oe=yt((P,C)=>{var wt=200,Ie="__lodash_hash_undefined__",Ee=9007199254740991,ee="[object Arguments]",vt="[object Array]",Pe="[object Boolean]",De="[object Date]",At="[object Error]",te="[object Function]",Re="[object GeneratorFunction]",L="[object Map]",Me="[object Number]",re="[object Object]",we="[object Promise]",Be="[object RegExp]",F="[object Set]",Le="[object String]",Fe="[object Symbol]",q="[object WeakMap]",He="[object ArrayBuffer]",H="[object DataView]",Ke="[object Float32Array]",Ne="[object Float64Array]",Ge="[object Int8Array]",Je="[object Int16Array]",Ve="[object Int32Array]",Qe="[object Uint8Array]",Ue="[object Uint8ClampedArray]",qe="[object Uint16Array]",Ze="[object Uint32Array]",xt=/[\\^$.*+?()[\]{}|]/g,Tt=/\w*$/,Ot=/^\[object .+?Constructor\]$/,Ct=/^(?:0|[1-9]\d*)$/,h={};h[ee]=h[vt]=h[He]=h[H]=h[Pe]=h[De]=h[Ke]=h[Ne]=h[Ge]=h[Je]=h[Ve]=h[L]=h[Me]=h[re]=h[Be]=h[F]=h[Le]=h[Fe]=h[Qe]=h[Ue]=h[qe]=h[Ze]=!0;h[At]=h[te]=h[q]=!1;var St=typeof global=="object"&&global&&global.Object===Object&&global,jt=typeof self=="object"&&self&&self.Object===Object&&self,_=St||jt||Function("return this")(),Xe=typeof P=="object"&&P&&!P.nodeType&&P,ve=Xe&&typeof C=="object"&&C&&!C.nodeType&&C,Wt=ve&&ve.exports===Xe;function $t(e,t){return e.set(t[0],t[1]),e}function It(e,t){return e.add(t),e}function Et(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function Pt(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}function Ye(e,t,r,n){var a=-1,s=e?e.length:0;for(n&&s&&(r=e[++a]);++a<s;)r=t(r,e[a],a,e);return r}function Dt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Rt(e,t){return e==null?void 0:e[t]}function ze(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Ae(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function ne(e,t){return function(r){return e(t(r))}}function xe(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Mt=Array.prototype,Bt=Function.prototype,K=Object.prototype,U=_["__core-js_shared__"],Te=function(){var e=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),ke=Bt.toString,v=K.hasOwnProperty,N=K.toString,Lt=RegExp("^"+ke.call(v).replace(xt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Oe=Wt?_.Buffer:void 0,Ce=_.Symbol,Se=_.Uint8Array,Ft=ne(Object.getPrototypeOf,Object),Ht=Object.create,Kt=K.propertyIsEnumerable,Nt=Mt.splice,je=Object.getOwnPropertySymbols,Gt=Oe?Oe.isBuffer:void 0,Jt=ne(Object.keys,Object),Z=W(_,"DataView"),D=W(_,"Map"),X=W(_,"Promise"),Y=W(_,"Set"),z=W(_,"WeakMap"),R=W(Object,"create"),Vt=T(Z),Qt=T(D),Ut=T(X),qt=T(Y),Zt=T(z),We=Ce?Ce.prototype:void 0,$e=We?We.valueOf:void 0;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 Xt(){this.__data__=R?R(null):{}}function Yt(e){return this.has(e)&&delete this.__data__[e]}function zt(e){var t=this.__data__;if(R){var r=t[e];return r===Ie?void 0:r}return v.call(t,e)?t[e]:void 0}function kt(e){var t=this.__data__;return R?t[e]!==void 0:v.call(t,e)}function er(e,t){var r=this.__data__;return r[e]=R&&t===void 0?Ie:t,this}x.prototype.clear=Xt;x.prototype.delete=Yt;x.prototype.get=zt;x.prototype.has=kt;x.prototype.set=er;function w(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 tr(){this.__data__=[]}function rr(e){var t=this.__data__,r=G(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Nt.call(t,r,1),!0}function nr(e){var t=this.__data__,r=G(t,e);return r<0?void 0:t[r][1]}function ir(e){return G(this.__data__,e)>-1}function ar(e,t){var r=this.__data__,n=G(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}w.prototype.clear=tr;w.prototype.delete=rr;w.prototype.get=nr;w.prototype.has=ir;w.prototype.set=ar;function S(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__={hash:new x,map:new(D||w),string:new x}}function or(e){return J(this,e).delete(e)}function ur(e){return J(this,e).get(e)}function cr(e){return J(this,e).has(e)}function fr(e,t){return J(this,e).set(e,t),this}S.prototype.clear=sr;S.prototype.delete=or;S.prototype.get=ur;S.prototype.has=cr;S.prototype.set=fr;function j(e){this.__data__=new w(e)}function lr(){this.__data__=new w}function hr(e){return this.__data__.delete(e)}function pr(e){return this.__data__.get(e)}function dr(e){return this.__data__.has(e)}function gr(e,t){var r=this.__data__;if(r instanceof w){var n=r.__data__;if(!D||n.length<wt-1)return n.push([e,t]),this;r=this.__data__=new S(n)}return r.set(e,t),this}j.prototype.clear=lr;j.prototype.delete=hr;j.prototype.get=pr;j.prototype.has=dr;j.prototype.set=gr;function br(e,t){var r=ae(e)||Hr(e)?Dt(e.length,String):[],n=r.length,a=!!n;for(var s in e)(t||v.call(e,s))&&!(a&&(s=="length"||Mr(s,n)))&&r.push(s);return r}function et(e,t,r){var n=e[t];(!(v.call(e,t)&&it(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function G(e,t){for(var r=e.length;r--;)if(it(e[r][0],t))return r;return-1}function yr(e,t){return e&&tt(t,se(t),e)}function k(e,t,r,n,a,s,l){var i;if(n&&(i=s?n(e,a,s,l):n(e)),i!==void 0)return i;if(!V(e))return e;var c=ae(e);if(c){if(i=Pr(e),!t)return $r(e,i)}else{var f=A(e),g=f==te||f==Re;if(Nr(e))return xr(e,t);if(f==re||f==ee||g&&!s){if(ze(e))return s?e:{};if(i=Dr(g?{}:e),!t)return Ir(e,yr(i,e))}else{if(!h[f])return s?e:{};i=Rr(e,f,k,t)}}l||(l=new j);var o=l.get(e);if(o)return o;if(l.set(e,i),!c)var p=r?Er(e):se(e);return Et(p||e,function(u,d){p&&(d=u,u=e[d]),et(i,d,k(u,t,r,n,d,e,l))}),i}function mr(e){return V(e)?Ht(e):{}}function _r(e,t,r){var n=t(e);return ae(e)?n:Pt(n,r(e))}function wr(e){return N.call(e)}function vr(e){if(!V(e)||Lr(e))return!1;var t=st(e)||ze(e)?Lt:Ot;return t.test(T(e))}function Ar(e){if(!nt(e))return Jt(e);var t=[];for(var r in Object(e))v.call(e,r)&&r!="constructor"&&t.push(r);return t}function xr(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function ie(e){var t=new e.constructor(e.byteLength);return new Se(t).set(new Se(e)),t}function Tr(e,t){var r=t?ie(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Or(e,t,r){var n=t?r(Ae(e),!0):Ae(e);return Ye(n,$t,new e.constructor)}function Cr(e){var t=new e.constructor(e.source,Tt.exec(e));return t.lastIndex=e.lastIndex,t}function Sr(e,t,r){var n=t?r(xe(e),!0):xe(e);return Ye(n,It,new e.constructor)}function jr(e){return $e?Object($e.call(e)):{}}function Wr(e,t){var r=t?ie(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function $r(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function tt(e,t,r,n){r||(r={});for(var a=-1,s=t.length;++a<s;){var l=t[a],i=n?n(r[l],e[l],l,r,e):void 0;et(r,l,i===void 0?e[l]:i)}return r}function Ir(e,t){return tt(e,rt(e),t)}function Er(e){return _r(e,se,rt)}function J(e,t){var r=e.__data__;return Br(t)?r[typeof t=="string"?"string":"hash"]:r.map}function W(e,t){var r=Rt(e,t);return vr(r)?r:void 0}var rt=je?ne(je,Object):Vr,A=wr;(Z&&A(new Z(new ArrayBuffer(1)))!=H||D&&A(new D)!=L||X&&A(X.resolve())!=we||Y&&A(new Y)!=F||z&&A(new z)!=q)&&(A=function(e){var t=N.call(e),r=t==re?e.constructor:void 0,n=r?T(r):void 0;if(n)switch(n){case Vt:return H;case Qt:return L;case Ut:return we;case qt:return F;case Zt:return q}return t});function Pr(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&v.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Dr(e){return typeof e.constructor=="function"&&!nt(e)?mr(Ft(e)):{}}function Rr(e,t,r,n){var a=e.constructor;switch(t){case He:return ie(e);case Pe:case De:return new a(+e);case H:return Tr(e,n);case Ke:case Ne:case Ge:case Je:case Ve:case Qe:case Ue:case qe:case Ze:return Wr(e,n);case L:return Or(e,n,r);case Me:case Le:return new a(e);case Be:return Cr(e);case F:return Sr(e,n,r);case Fe:return jr(e)}}function Mr(e,t){return t=t==null?Ee:t,!!t&&(typeof e=="number"||Ct.test(e))&&e>-1&&e%1==0&&e<t}function Br(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Lr(e){return!!Te&&Te in e}function nt(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||K;return e===r}function T(e){if(e!=null){try{return ke.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Fr(e){return k(e,!0,!0)}function it(e,t){return e===t||e!==e&&t!==t}function Hr(e){return Kr(e)&&v.call(e,"callee")&&(!Kt.call(e,"callee")||N.call(e)==ee)}var ae=Array.isArray;function at(e){return e!=null&&Gr(e.length)&&!st(e)}function Kr(e){return Jr(e)&&at(e)}var Nr=Gt||Qr;function st(e){var t=V(e)?N.call(e):"";return t==te||t==Re}function Gr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Ee}function V(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Jr(e){return!!e&&typeof e=="object"}function se(e){return at(e)?br(e):Ar(e)}function Vr(){return[]}function Qr(){return!1}C.exports=Fr});var zr={};mt(zr,{arrayiffyString:()=>I,defaults:()=>M,flattenArr:()=>B,flattenObject:()=>Q,flattenReferencing:()=>Yr,version:()=>Xr});var he=_e(oe(),1);function ue(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 s=[],l=!1,i;for(let c=r,f=n.length;c<f;c++)l&&(n[c]===a[c-+i]?c-+i+1===a.length&&s.push(+i):(i=null,l=!1)),l||n[c]===a[0]&&(a.length===1?s.push(c):(l=!0,i=c));return s}function ce(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var fe=new Map,ot=(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})},Ur=(e,t)=>{t=m({caseSensitive:!1},t);let r=e+JSON.stringify(t);if(fe.has(r))return fe.get(r);let n=e[0]==="!";n&&(e=e.slice(1)),e=ce(e).replace(/\\\*/g,"[\\s\\S]*");let a=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return a.negated=n,fe.set(r,a),a},qr=(e,t,r,n)=>{if(e=ot(e,"inputs"),t=ot(t,"patterns"),t.length===0)return[];t=t.map(l=>Ur(l,r));let{allPatterns:a}=r||{},s=[];for(let l of e){let i,c=[...t].fill(!1);for(let[f,g]of t.entries())if(g.test(l)&&(c[f]=!0,i=!g.negated,!i))break;if(!(i===!1||i===void 0&&t.some(f=>!f.negated)||a&&c.some((f,g)=>!f&&!t[g].negated))&&(s.push(l),n))break}return s};function ut(e,t,r){return qr(e,t,r,!0).length>0}function O(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function b(e){return typeof e=="string"}function $(e){return e!=null}var le=_e(oe(),1);var 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,t){let r=m(m({},M),t);if(arguments.length===0||Object.keys(e).length===0)return[];let n=(0,le.default)(e),a=[];return O(n)&&Object.keys(n).forEach(s=>{O(n[s])&&(n[s]=Q(n[s],r)),Array.isArray(n[s])&&(a=a.concat(n[s].map(l=>`${s}${r.objectKeyAndValueJoinChar}${l}`))),b(n[s])&&a.push(`${s}${r.objectKeyAndValueJoinChar}${n[s]}`)}),a}function B(e,t,r=!1,n=!1){let a=m(m({},M),t);if(arguments.length===0||e.length===0)return"";let s=(0,le.default)(e),l="";if(s.length)if(n){for(let i=0,c=s.length;i<c;i++)if(b(s[i])){let f;f="",a.mergeArraysWithLineBreaks&&i>0&&(!a.mergeWithoutTrailingBrIfLineContainsBr||typeof s[i-1]!="string"||a.mergeWithoutTrailingBrIfLineContainsBr&&s[i-1]!==void 0&&!s[i-1].toLowerCase().includes("<br"))&&(f=`<br${a.xhtml?" /":""}>`),l+=`${f}${r?a.wrapHeadsWith:""}${s[i]}${r?a.wrapTailsWith:""}`}else if(Array.isArray(s[i])&&s[i].length&&s[i].every(b)){let f="";a.mergeArraysWithLineBreaks&&l.length&&(f=`<br${a.xhtml?" /":""}>`),l=s[i].reduce((g,o,p,u)=>{let d="";return p!==u.length-1&&(d=" "),g+(p===0?f:"")+(r?a.wrapHeadsWith:"")+o+(r?a.wrapTailsWith:"")+d},l)}}else l=s.reduce((i,c,f,g)=>{let o="";a.mergeArraysWithLineBreaks&&f>0&&(o=`<br${a.xhtml?" /":""}>`);let p="";return f!==g.length-1&&(p=" "),`${i}${f===0?o:""}${r?a.wrapHeadsWith:""}${c}${r?a.wrapTailsWith:""}${p}`},l);return l}function I(e){return b(e)?e.length?[e]:[]:e}var ct="7.0.11";var Xr=ct;function Yr(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] resolvedReference object missing!");if($(r)&&!O(r))throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_03] third resolvedInput, options object must be a plain object. Currently it's: ${typeof r}`);let n=m(m({},M),r);n.dontWrapKeys=I(n.dontWrapKeys),n.preventWrappingIfContains=I(n.preventWrappingIfContains),n.dontWrapPaths=I(n.dontWrapPaths),n.ignore=I(n.ignore),typeof n.whatToDoWhenReferenceIsMissing!="number"&&(n.whatToDoWhenReferenceIsMissing=+n.whatToDoWhenReferenceIsMissing||0);function a(s,l,i,c=!0,f=!0,g=""){let o=(0,he.default)(s),p=(0,he.default)(l);return i.wrapGlobalFlipSwitch||(c=!1),O(o)?Object.keys(o).forEach(u=>{let d=g+(g.length===0?u:`.${u}`);if(i.ignore.length===0||!i.ignore.includes(u)){if(i.wrapGlobalFlipSwitch&&(c=!0,i.dontWrapKeys.length&&(c=c&&!i.dontWrapKeys.some(y=>ut(u,y,{caseSensitive:!0}))),i.dontWrapPaths.length&&(c=c&&!i.dontWrapPaths.some(y=>y===d)),i.preventWrappingIfContains.length&&typeof o[u]=="string"&&(c=c&&!i.preventWrappingIfContains.some(y=>o[u].includes(y)))),$(p[u])||!$(p[u])&&i.whatToDoWhenReferenceIsMissing===2)if(Array.isArray(o[u]))if(i.whatToDoWhenReferenceIsMissing===2||b(p[u]))o[u]=B(o[u],i,c,f);else{if(o[u].every(y=>typeof y=="string"||Array.isArray(y))){let y=!0;o[u].forEach(pe=>{Array.isArray(pe)&&!pe.every(b)&&(y=!1)}),y&&(f=!1)}o[u]=a(o[u],p[u],i,c,f,d)}else O(o[u])?i.whatToDoWhenReferenceIsMissing===2||b(p[u])?o[u]=B(Q(o[u],i),i,c,f):c?o[u]=a(o[u],p[u],i,c,f,d):o[u]=a(o[u],p[u],ye(m({},i),{wrapGlobalFlipSwitch:!1}),c,f,d):b(o[u])&&(o[u]=a(o[u],p[u],i,c,f,d));else if(typeof o[u]!=typeof p[u]&&i.whatToDoWhenReferenceIsMissing===1)throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_06] resolvedReference object does not have the key ${u} and we need it. TIP: Turn off throwing via opts2.whatToDoWhenReferenceIsMissing.`)}}):Array.isArray(o)?Array.isArray(p)?o.forEach((u,d)=>{$(o[d])&&$(p[d])?o[d]=a(o[d],p[d],i,c,f,`${g}[${d}]`):o[d]=a(o[d],p[0],i,c,f,`${g}[${d}]`)}):b(p)&&(o=B(o,i,c,f)):b(o)&&o.length&&(i.wrapHeadsWith||i.wrapTailsWith)&&(!i.preventDoubleWrapping||(i.wrapHeadsWith===""||!ue(o,i.wrapHeadsWith.trim()).length)&&(i.wrapTailsWith===""||!ue(o,i.wrapTailsWith.trim()).length))&&(o=`${c?i.wrapHeadsWith:""}${o}${c?i.wrapTailsWith:""}`),o}return a(e,t,n)}return _t(zr);})();
10
+ "use strict";var objectFlattenReferencing=(()=>{var G=Object.create;var v=Object.defineProperty,Q=Object.defineProperties,q=Object.getOwnPropertyDescriptor,z=Object.getOwnPropertyDescriptors,Z=Object.getOwnPropertyNames,I=Object.getOwnPropertySymbols,X=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable;var M=(r,t,a)=>t in r?v(r,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[t]=a,y=(r,t)=>{for(var a in t||(t={}))B.call(t,a)&&M(r,a,t[a]);if(I)for(var a of I(t))Y.call(t,a)&&M(r,a,t[a]);return r},E=(r,t)=>Q(r,z(t));var U=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),k=(r,t)=>{for(var a in t)v(r,a,{get:t[a],enumerable:!0})},P=(r,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Z(t))!B.call(r,n)&&n!==a&&v(r,n,{get:()=>t[n],enumerable:!(l=q(t,n))||l.enumerable});return r};var R=(r,t,a)=>(a=r!=null?G(X(r)):{},P(t||!r||!r.__esModule?v(a,"default",{value:r,enumerable:!0}):a,r)),ee=r=>P(v({},"__esModule",{value:!0}),r);var $=U((ue,N)=>{"use strict";N.exports=re;function w(r){return r instanceof Buffer?Buffer.from(r):new r.constructor(r.buffer.slice(),r.byteOffset,r.length)}function re(r){if(r=r||{},r.circles)return te(r);return r.proto?l:a;function t(n,o){for(var i=Object.keys(n),e=new Array(i.length),f=0;f<i.length;f++){var s=i[f],p=n[s];typeof p!="object"||p===null?e[s]=p:p instanceof Date?e[s]=new Date(p):ArrayBuffer.isView(p)?e[s]=w(p):e[s]=o(p)}return e}function a(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,a);if(n instanceof Map)return new Map(t(Array.from(n),a));if(n instanceof Set)return new Set(t(Array.from(n),a));var o={};for(var i in n)if(Object.hasOwnProperty.call(n,i)!==!1){var e=n[i];typeof e!="object"||e===null?o[i]=e:e instanceof Date?o[i]=new Date(e):e instanceof Map?o[i]=new Map(t(Array.from(e),a)):e instanceof Set?o[i]=new Set(t(Array.from(e),a)):ArrayBuffer.isView(e)?o[i]=w(e):o[i]=a(e)}return o}function l(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,l);if(n instanceof Map)return new Map(t(Array.from(n),l));if(n instanceof Set)return new Set(t(Array.from(n),l));var o={};for(var i in n){var e=n[i];typeof e!="object"||e===null?o[i]=e:e instanceof Date?o[i]=new Date(e):e instanceof Map?o[i]=new Map(t(Array.from(e),l)):e instanceof Set?o[i]=new Set(t(Array.from(e),l)):ArrayBuffer.isView(e)?o[i]=w(e):o[i]=l(e)}return o}}function te(r){var t=[],a=[];return r.proto?o:n;function l(i,e){for(var f=Object.keys(i),s=new Array(f.length),p=0;p<f.length;p++){var u=f[p],h=i[u];if(typeof h!="object"||h===null)s[u]=h;else if(h instanceof Date)s[u]=new Date(h);else if(ArrayBuffer.isView(h))s[u]=w(h);else{var c=t.indexOf(h);c!==-1?s[u]=a[c]:s[u]=e(h)}}return s}function n(i){if(typeof i!="object"||i===null)return i;if(i instanceof Date)return new Date(i);if(Array.isArray(i))return l(i,n);if(i instanceof Map)return new Map(l(Array.from(i),n));if(i instanceof Set)return new Set(l(Array.from(i),n));var e={};t.push(i),a.push(e);for(var f in i)if(Object.hasOwnProperty.call(i,f)!==!1){var s=i[f];if(typeof s!="object"||s===null)e[f]=s;else if(s instanceof Date)e[f]=new Date(s);else if(s instanceof Map)e[f]=new Map(l(Array.from(s),n));else if(s instanceof Set)e[f]=new Set(l(Array.from(s),n));else if(ArrayBuffer.isView(s))e[f]=w(s);else{var p=t.indexOf(s);p!==-1?e[f]=a[p]:e[f]=n(s)}}return t.pop(),a.pop(),e}function o(i){if(typeof i!="object"||i===null)return i;if(i instanceof Date)return new Date(i);if(Array.isArray(i))return l(i,o);if(i instanceof Map)return new Map(l(Array.from(i),o));if(i instanceof Set)return new Set(l(Array.from(i),o));var e={};t.push(i),a.push(e);for(var f in i){var s=i[f];if(typeof s!="object"||s===null)e[f]=s;else if(s instanceof Date)e[f]=new Date(s);else if(s instanceof Map)e[f]=new Map(l(Array.from(s),o));else if(s instanceof Set)e[f]=new Set(l(Array.from(s),o));else if(ArrayBuffer.isView(s))e[f]=w(s);else{var p=t.indexOf(s);p!==-1?e[f]=a[p]:e[f]=o(s)}}return t.pop(),a.pop(),e}}});var le={};k(le,{arrayiffy:()=>A,defaults:()=>S,flattenArr:()=>x,flattenObject:()=>W,flattenReferencing:()=>fe,version:()=>se});var _=R($(),1);function j(r,t,a=0){if(typeof r!="string")throw new TypeError(`str-indexes-of-plus/strIndexesOfPlus(): first input argument must be a string! Currently it's: ${typeof r}`);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(+a)||typeof a=="string"&&!/^\d*$/.test(a))throw new TypeError(`str-indexes-of-plus/strIndexesOfPlus(): third input argument must be a natural number! Currently it's: ${a}`);let l=Array.from(r),n=Array.from(t);if(l.length===0||n.length===0||a!=null&&+a>=l.length)return[];a||(a=0);let o=[],i=!1,e;for(let f=a,s=l.length;f<s;f++)i&&(l[f]===n[f-+e]?f-+e+1===n.length&&o.push(+e):(e=null,i=!1)),i||l[f]===n[0]&&(n.length===1?o.push(f):(i=!0,e=f));return o}function D(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var C=new Map,L=(r,t)=>{if(!Array.isArray(r))switch(typeof r){case"string":r=[r];break;case"undefined":r=[];break;default:throw new TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof r}'`)}return r.filter(a=>{if(typeof a!="string"){if(typeof a>"u")return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof a}' in the array`)}return!0})},ne=(r,t)=>{t=y({caseSensitive:!1},t);let a=r+JSON.stringify(t);if(C.has(a))return C.get(a);let l=r[0]==="!";l&&(r=r.slice(1)),r=D(r).replace(/\\\*/g,"[\\s\\S]*");let n=new RegExp(`^${r}$`,t.caseSensitive?"":"i");return n.negated=l,C.set(a,n),n},ie=(r,t,a,l)=>{if(r=L(r,"inputs"),t=L(t,"patterns"),t.length===0)return[];t=t.map(i=>ne(i,a));let{allPatterns:n}=a||{},o=[];for(let i of r){let e,f=[...t].fill(!1);for(let[s,p]of t.entries())if(p.test(i)&&(f[s]=!0,e=!p.negated,!e))break;if(!(e===!1||e===void 0&&t.some(s=>!s.negated)||n&&f.some((s,p)=>!s&&!t[p].negated))&&(o.push(i),l))break}return o};function F(r,t,a){return ie(r,t,a,!0).length>0}function A(r){return typeof r!="string"?r:r.length?[r]:[]}function b(r){if(r==null||typeof r!="object")return!1;let t=Object.getPrototypeOf(r);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in r)&&!(Symbol.toStringTag in r)}function m(r){return typeof r=="string"}function O(r){return r!=null}var J=R($(),1);var K=(0,J.default)(),S={wrapHeadsWith:"%%_",wrapTailsWith:"_%%",dontWrapKeys:[],dontWrapPaths:[],xhtml:!0,preventDoubleWrapping:!0,preventWrappingIfContains:[],objectKeyAndValueJoinChar:".",wrapGlobalFlipSwitch:!0,ignore:[],whatToDoWhenReferenceIsMissing:0,mergeArraysWithLineBreaks:!0,mergeWithoutTrailingBrIfLineContainsBr:!0,enforceStrictKeyset:!0};function W(r,t){let a=y(y({},S),t);if(arguments.length===0||Object.keys(r).length===0)return[];let l=K(r),n=[];return b(l)&&Object.keys(l).forEach(o=>{b(l[o])&&(l[o]=W(l[o],a)),Array.isArray(l[o])&&(n=n.concat(l[o].map(i=>`${o}${a.objectKeyAndValueJoinChar}${i}`))),m(l[o])&&n.push(`${o}${a.objectKeyAndValueJoinChar}${l[o]}`)}),n}function x(r,t,a=!1,l=!1){let n=y(y({},S),t);if(arguments.length===0||r.length===0)return"";let o=K(r),i="";if(o.length)if(l){for(let e=0,f=o.length;e<f;e++)if(m(o[e])){let s;s="",n.mergeArraysWithLineBreaks&&e>0&&(!n.mergeWithoutTrailingBrIfLineContainsBr||typeof o[e-1]!="string"||n.mergeWithoutTrailingBrIfLineContainsBr&&o[e-1]!==void 0&&!o[e-1].toLowerCase().includes("<br"))&&(s=`<br${n.xhtml?" /":""}>`),i+=`${s}${a?n.wrapHeadsWith:""}${o[e]}${a?n.wrapTailsWith:""}`}else if(Array.isArray(o[e])&&o[e].length&&o[e].every(m)){let s="";n.mergeArraysWithLineBreaks&&i.length&&(s=`<br${n.xhtml?" /":""}>`),i=o[e].reduce((p,u,h,c)=>{let g="";return h!==c.length-1&&(g=" "),p+(h===0?s:"")+(a?n.wrapHeadsWith:"")+u+(a?n.wrapTailsWith:"")+g},i)}}else i=o.reduce((e,f,s,p)=>{let u="";n.mergeArraysWithLineBreaks&&s>0&&(u=`<br${n.xhtml?" /":""}>`);let h="";return s!==p.length-1&&(h=" "),`${e}${s===0?u:""}${a?n.wrapHeadsWith:""}${f}${a?n.wrapTailsWith:""}${h}`},i);return i}var H="7.0.12";var V=(0,_.default)(),se=H;function fe(r,t,a){if(!b(r))throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_01] the first input argument must be a plain object! It was given as ${JSON.stringify(r,null,4)} (its typeof was ${typeof r}).`);if(!b(t))throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_02] the second input argument must be a plain object! It was given as ${JSON.stringify(t,null,4)} (its typeof was ${typeof t}).`);if(a&&!b(a))throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_03] the third input argument must be a plain object! It was given as ${JSON.stringify(a,null,4)} (its typeof was ${typeof a}).`);let l=y(y({},S),a);l.dontWrapKeys=A(l.dontWrapKeys),l.preventWrappingIfContains=A(l.preventWrappingIfContains),l.dontWrapPaths=A(l.dontWrapPaths),l.ignore=A(l.ignore),typeof l.whatToDoWhenReferenceIsMissing!="number"&&(l.whatToDoWhenReferenceIsMissing=+l.whatToDoWhenReferenceIsMissing||0);function n(o,i,e,f=!0,s=!0,p=""){let u=V(o),h=V(i);return e.wrapGlobalFlipSwitch||(f=!1),b(u)?Object.keys(u).forEach(c=>{let g=p+(p.length===0?c:`.${c}`);if(e.ignore.length===0||!e.ignore.includes(c)){if(e.wrapGlobalFlipSwitch&&(f=!0,e.dontWrapKeys.length&&(f=f&&!e.dontWrapKeys.some(d=>F(c,d,{caseSensitive:!0}))),e.dontWrapPaths.length&&(f=f&&!e.dontWrapPaths.some(d=>d===g)),e.preventWrappingIfContains.length&&typeof u[c]=="string"&&(f=f&&!e.preventWrappingIfContains.some(d=>u[c].includes(d)))),O(h[c])||!O(h[c])&&e.whatToDoWhenReferenceIsMissing===2)if(Array.isArray(u[c]))if(e.whatToDoWhenReferenceIsMissing===2||m(h[c]))u[c]=x(u[c],e,f,s);else{if(u[c].every(d=>typeof d=="string"||Array.isArray(d))){let d=!0;u[c].forEach(T=>{Array.isArray(T)&&!T.every(m)&&(d=!1)}),d&&(s=!1)}u[c]=n(u[c],h[c],e,f,s,g)}else b(u[c])?e.whatToDoWhenReferenceIsMissing===2||m(h[c])?u[c]=x(W(u[c],e),e,f,s):f?u[c]=n(u[c],h[c],e,f,s,g):u[c]=n(u[c],h[c],E(y({},e),{wrapGlobalFlipSwitch:!1}),f,s,g):m(u[c])&&(u[c]=n(u[c],h[c],e,f,s,g));else if(typeof u[c]!=typeof h[c]&&e.whatToDoWhenReferenceIsMissing===1)throw new Error(`object-flatten-referencing/ofr(): [THROW_ID_06] resolvedReference object does not have the key ${c} and we need it. TIP: Turn off throwing via opts2.whatToDoWhenReferenceIsMissing.`)}}):Array.isArray(u)?Array.isArray(h)?u.forEach((c,g)=>{O(u[g])&&O(h[g])?u[g]=n(u[g],h[g],e,f,s,`${p}[${g}]`):u[g]=n(u[g],h[0],e,f,s,`${p}[${g}]`)}):m(h)&&(u=x(u,e,f,s)):m(u)&&u.length&&(e.wrapHeadsWith||e.wrapTailsWith)&&(!e.preventDoubleWrapping||(e.wrapHeadsWith===""||!j(u,e.wrapHeadsWith.trim()).length)&&(e.wrapTailsWith===""||!j(u,e.wrapTailsWith.trim()).length))&&(u=`${f?e.wrapHeadsWith:""}${u}${f?e.wrapTailsWith:""}`),u}return n(r,t,l)}return ee(le);})();
11
11
  /**
12
12
  * @name str-indexes-of-plus
13
13
  * @fileoverview Like indexOf but returns array and counts per-grapheme
@@ -16,10 +16,18 @@
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/str-indexes-of-plus/}
18
18
  */
19
+ /**
20
+ * @name arrayiffy-if-string
21
+ * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
22
+ * @version 5.0.5
23
+ * @author Roy Revelt, Codsen Ltd
24
+ * @license MIT
25
+ * {@link https://codsen.com/os/arrayiffy-if-string/}
26
+ */
19
27
  /**
20
28
  * @name codsen-utils
21
29
  * @fileoverview Various utility functions
22
- * @version 1.4.0
30
+ * @version 1.5.0
23
31
  * @author Roy Revelt, Codsen Ltd
24
32
  * @license MIT
25
33
  * {@link https://codsen.com/os/codsen-utils/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "object-flatten-referencing",
3
- "version": "7.0.11",
3
+ "version": "7.0.12",
4
4
  "description": "Flatten complex nested objects according to a reference objects",
5
5
  "keywords": [
6
6
  "advanced",
@@ -70,12 +70,10 @@
70
70
  }
71
71
  },
72
72
  "dependencies": {
73
- "codsen-utils": "^1.4.0",
74
- "lodash.clonedeep": "^4.5.0",
73
+ "arrayiffy-if-string": "^5.0.5",
74
+ "codsen-utils": "^1.5.0",
75
75
  "matcher": "^5.0.0",
76
+ "rfdc": "^1.3.0",
76
77
  "str-indexes-of-plus": "^5.0.5"
77
- },
78
- "devDependencies": {
79
- "@types/lodash.clonedeep": "^4.5.7"
80
78
  }
81
79
  }
package/types/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { Obj } from "codsen-utils";
1
+ export { arrayiffy } from "arrayiffy-if-string";
2
+ import { JSONObject, JSONValue } from "codsen-utils";
2
3
 
3
4
  interface Opts {
4
5
  wrapHeadsWith: string;
@@ -17,25 +18,23 @@ interface Opts {
17
18
  enforceStrictKeyset: boolean;
18
19
  }
19
20
  declare const defaults: Opts;
20
- declare function flattenObject(obj: Obj, opts?: Partial<Opts>): any[];
21
+ declare function flattenObject(obj: JSONObject, opts?: Partial<Opts>): any[];
21
22
  declare function flattenArr(
22
23
  arr: any[],
23
24
  opts?: Partial<Opts>,
24
25
  wrap?: boolean,
25
26
  joinArraysUsingBrs?: boolean
26
27
  ): string;
27
- declare function arrayiffyString(something: string | any): any;
28
28
 
29
29
  declare const version: string;
30
30
  declare function flattenReferencing(
31
- input: any,
32
- reference: any,
31
+ input: JSONValue,
32
+ reference: JSONValue,
33
33
  opts?: Partial<Opts>
34
34
  ): any;
35
35
 
36
36
  export {
37
37
  Opts,
38
- arrayiffyString,
39
38
  defaults,
40
39
  flattenArr,
41
40
  flattenObject,