@symbo.ls/utils 3.14.11 → 3.14.13

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
@@ -1,5 +1,17 @@
1
1
  # @symbo.ls/utils
2
2
 
3
+ ## 3.14.13
4
+
5
+ ### Patch Changes
6
+
7
+ - Auto-generated cross-repo patch release.
8
+
9
+ ## 3.14.12
10
+
11
+ ### Patch Changes
12
+
13
+ - Auto-generated cross-repo patch release.
14
+
3
15
  ## 3.14.11
4
16
 
5
17
  ### Patch Changes
@@ -1,12 +1,12 @@
1
- "use strict";var g=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var L=(e,t)=>{for(var o in t)g(e,o,{get:t[o],enumerable:!0})},B=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of M(t))!F.call(e,n)&&n!==o&&g(e,n,{get:()=>t[n],enumerable:!(r=R(t,n))||r.enumerable});return e};var H=e=>B(g({},"__esModule",{value:!0}),e);var ae={};L(ae,{clone:()=>G,createNestedObject:()=>oe,createObjectWithoutPrototype:()=>I,deepClone:()=>D,deepContains:()=>ne,deepDestringifyFunctions:()=>x,deepMerge:()=>z,deepStringifyFunctions:()=>_,destringifyGlobalScope:()=>Q,detectInfiniteLoop:()=>fe,excludeKeysFromObject:()=>ue,exec:()=>S,getInObjectByPath:()=>ie,hasFunction:()=>d,hasOwnProperty:()=>Y,isCyclic:()=>le,isEmpty:()=>C,isEmptyObject:()=>m,isEqualDeep:()=>W,makeObjectWithoutPrototype:()=>b,map:()=>J,merge:()=>q,objectToString:()=>P,overwrite:()=>j,overwriteDeep:()=>T,overwriteShallow:()=>ee,removeFromObject:()=>re,removeNestedKeyByPath:()=>se,setInObjectByPath:()=>ce,stringToObject:()=>X});module.exports=H(ae);var O=require("./globals.js"),i=require("./types.js"),E=require("./array.js"),A=require("./string.js"),h=require("./node.js"),N=require("./keys.js");const v="production",w=e=>e.charCodeAt(0)===95&&e.charCodeAt(1)===95,S=(e,t,o,r)=>{if((0,i.isFunction)(e))return t?typeof e.call!="function"?e:e.call(t,t,o||t.state,r||t.context):void 0;if(e!=null&&t?.context?.plugins&&((0,i.isArray)(e)||(0,i.isObject)(e)&&!(0,h.isDOMNode)(e))){const n=t.context.plugins;for(const s of n)if(s.resolveHandler){const c=s.resolveHandler(e,t);if(typeof c=="function")return S(c,t,o,r)}}return e},J=(e,t,o)=>{for(const r in t)e[r]=S(t[r],o)},q=(e,t,o=[])=>{const r=o instanceof Set;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(w(n)||(r?o.has(n):o.includes(n))||e[n]===void 0&&(e[n]=t[n]));return e},z=(e,t,o=N.METHODS_EXL)=>$(e,t,o,null),$=(e,t,o,r)=>{if(e===t)return e;if(r){for(let s=0;s<r.length;s+=2)if(r[s]===e&&r[s+1]===t)return e}const n=o instanceof Set;for(const s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||w(s)||s==="constructor"||s==="prototype"||(n?o.has(s):o.includes(s)))continue;const c=e[s],f=t[s];if((0,i.isObjectLike)(c)&&(0,i.isObjectLike)(f)){const u=r||[];u.push(e,t),$(c,f,o,u),u.length-=2}else c===void 0&&(e[s]=f)}return e},G=(e,t=[])=>{const o=t instanceof Set,r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(w(n)||(o?t.has(n):t.includes(n))||(r[n]=e[n]));return r},D=(e,t={})=>{const{exclude:o=[],cleanUndefined:r=!1,cleanNull:n=!1,window:s,visited:c=new WeakMap,handleExtends:f=!1}=t,u=s||O.window||globalThis;if(!(0,i.isObjectLike)(e)||(0,h.isDOMNode)(e))return e;if(c.has(e))return c.get(e);const a=(0,i.isArray)(e)?[]:{};c.set(e,a);const k=o instanceof Set?o:o.length>3?new Set(o):null;for(const p in e){if(!Object.prototype.hasOwnProperty.call(e,p)||w(p)||p==="__proto__"||(k?k.has(p):o.includes(p)))continue;const y=e[p];if(!(r&&y===void 0)&&!(n&&y===null)){if((0,h.isDOMNode)(y)){a[p]=y;continue}if(f&&p==="extends"&&(0,i.isArray)(y)){a[p]=(0,E.unstackArrayOfObjects)(y,o);continue}if((0,i.isFunction)(y)){a[p]=y;continue}(0,i.isObjectLike)(y)?a[p]=D(y,{...t,visited:c}):a[p]=y}}return a},_=(e,t={})=>{(e.node||e.__ref||e.parent||e.__element||e.parse)&&((e.__element||e.parent?.__element).warn("Trying to clone element or state at",e),e=e.parse?.());for(const o in e){const r=e[o];if((0,i.isFunction)(r))t[o]=r.toString();else if((0,i.isObject)(r))t[o]={},_(r,t[o]);else if((0,i.isArray)(r)){const n=t[o]=[];for(let s=0;s<r.length;s++){const c=r[s];(0,i.isObject)(c)?(n[s]={},_(c,n[s])):(0,i.isFunction)(c)?n[s]=c.toString():n[s]=c}}else t[o]=r}return t},K=new Set(["&","*","-",":","%","{","}",">","<","@",".","/","!"," "]),P=(e={},t=0)=>{if(e===null||typeof e!="object")return String(e);let o=!1;for(const s in e){o=!0;break}if(!o)return"{}";const r=" ".repeat(t);let n=`{
2
- `;for(const s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;const c=e[s];let f=!1;for(let l=0;l<s.length;l++)if(K.has(s[l])){f=!0;break}const u=f?`'${s}'`:s;if(n+=`${r} ${u}: `,(0,i.isArray)(c)){n+=`[
1
+ "use strict";var _=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var L=(e,t)=>{for(var o in t)_(e,o,{get:t[o],enumerable:!0})},B=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of R(t))!F.call(e,n)&&n!==o&&_(e,n,{get:()=>t[n],enumerable:!(r=M(t,n))||r.enumerable});return e};var G=e=>B(_({},"__esModule",{value:!0}),e);var he={};L(he,{clone:()=>q,createNestedObject:()=>ie,createObjectWithoutPrototype:()=>I,deepClone:()=>N,deepContains:()=>se,deepDestringifyFunctions:()=>x,deepMerge:()=>V,deepStringifyFunctions:()=>S,destringifyGlobalScope:()=>m,detectInfiniteLoop:()=>ae,excludeKeysFromObject:()=>ye,exec:()=>g,getInObjectByPath:()=>ue,hasFunction:()=>d,hasOwnProperty:()=>j,isCyclic:()=>pe,isEmpty:()=>D,isEmptyObject:()=>ee,isEqualDeep:()=>W,makeObjectWithoutPrototype:()=>te,map:()=>H,merge:()=>J,objectToString:()=>P,overwrite:()=>ne,overwriteDeep:()=>C,overwriteShallow:()=>re,removeFromObject:()=>ce,removeNestedKeyByPath:()=>fe,setInObjectByPath:()=>le,stringToObject:()=>b});module.exports=G(he);var O=require("./globals.js"),i=require("./types.js"),$=require("./array.js"),v=require("./string.js"),h=require("./node.js"),T=require("./keys.js");const k="production",w=e=>e.charCodeAt(0)===95&&e.charCodeAt(1)===95,g=(e,t,o,r)=>{if((0,i.isFunction)(e))return t?typeof e.call!="function"?e:e.call(t,t,o||t.state,r||t.context):void 0;if(e!=null&&t?.context?.plugins&&((0,i.isArray)(e)||(0,i.isObject)(e)&&!(0,h.isDOMNode)(e))){const n=t.context.plugins;for(const s of n)if(s.resolveHandler){const c=s.resolveHandler(e,t);if(typeof c=="function")return g(c,t,o,r)}}return e},H=(e,t,o)=>{for(const r in t)e[r]=g(t[r],o)},J=(e,t,o=[])=>{const r=o instanceof Set;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(w(n)||(r?o.has(n):o.includes(n))||e[n]===void 0&&(e[n]=t[n]));return e},V=(e,t,o=T.METHODS_EXL)=>E(e,t,o,null),E=(e,t,o,r)=>{if(e===t)return e;if(r){for(let s=0;s<r.length;s+=2)if(r[s]===e&&r[s+1]===t)return e}const n=o instanceof Set;for(const s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||w(s)||s==="constructor"||s==="prototype"||(n?o.has(s):o.includes(s)))continue;const c=e[s],f=t[s];if((0,i.isObjectLike)(c)&&(0,i.isObjectLike)(f)){const u=r||[];u.push(e,t),E(c,f,o,u),u.length-=2}else c===void 0&&(e[s]=f)}return e},q=(e,t=[])=>{const o=t instanceof Set,r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(w(n)||(o?t.has(n):t.includes(n))||(r[n]=e[n]));return r},N=(e,t={})=>{const{exclude:o=[],cleanUndefined:r=!1,cleanNull:n=!1,window:s,visited:c=new WeakMap,handleExtends:f=!1}=t,u=s||O.window||globalThis;if(!(0,i.isObjectLike)(e)||(0,h.isDOMNode)(e))return e;if(c.has(e))return c.get(e);const a=(0,i.isArray)(e)?[]:{};c.set(e,a);const A=o instanceof Set?o:o.length>3?new Set(o):null;for(const p in e){if(!Object.prototype.hasOwnProperty.call(e,p)||w(p)||p==="__proto__"||(A?A.has(p):o.includes(p)))continue;const y=e[p];if(!(r&&y===void 0)&&!(n&&y===null)){if((0,h.isDOMNode)(y)){a[p]=y;continue}if(f&&p==="extends"&&(0,i.isArray)(y)){a[p]=(0,$.unstackArrayOfObjects)(y,o);continue}if((0,i.isFunction)(y)){a[p]=y;continue}(0,i.isObjectLike)(y)?a[p]=N(y,{...t,visited:c}):a[p]=y}}return a},S=(e,t={})=>{(e.node||e.__ref||e.parent||e.__element||e.parse)&&((e.__element||e.parent?.__element).warn("Trying to clone element or state at",e),e=e.parse?.());for(const o in e){const r=e[o];if((0,i.isFunction)(r))t[o]=r.toString();else if((0,i.isObject)(r))t[o]={},S(r,t[o]);else if((0,i.isArray)(r)){const n=t[o]=[];for(let s=0;s<r.length;s++){const c=r[s];(0,i.isObject)(c)?(n[s]={},S(c,n[s])):(0,i.isFunction)(c)?n[s]=c.toString():n[s]=c}}else t[o]=r}return t},z=new Set(["&","*","-",":","%","{","}",">","<","@",".","/","!"," "]),P=(e={},t=0)=>{if(e===null||typeof e!="object")return String(e);let o=!1;for(const s in e){o=!0;break}if(!o)return"{}";const r=" ".repeat(t);let n=`{
2
+ `;for(const s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;const c=e[s];let f=!1;for(let l=0;l<s.length;l++)if(z.has(s[l])){f=!0;break}const u=f?`'${s}'`:s;if(n+=`${r} ${u}: `,(0,i.isArray)(c)){n+=`[
3
3
  `;for(const l of c)(0,i.isObjectLike)(l)&&l!==null?n+=`${r} ${P(l,t+2)},
4
4
  `:(0,i.isString)(l)?n+=`${r} '${l}',
5
5
  `:n+=`${r} ${l},
6
- `;n+=`${r} ]`}else(0,i.isObjectLike)(c)?n+=P(c,t+1):(0,i.isString)(c)?n+=(0,A.stringIncludesAny)(c,[`
6
+ `;n+=`${r} ]`}else(0,i.isObjectLike)(c)?n+=P(c,t+1):(0,i.isString)(c)?n+=(0,v.stringIncludesAny)(c,[`
7
7
  `,"'"])?`\`${c}\``:`'${c}'`:n+=c;n+=`,
8
- `}return n+=`${r}}`,n},U=[/^\(\s*\{[^}]*\}\s*\)\s*=>/,/^(\([^)]*\)|[^=]*)\s*=>/,/^function[\s(]/,/^async\s+/,/^\(\s*function/,/^[a-zA-Z_$][a-zA-Z0-9_$]*\s*=>/],V=/^["[{]/,d=e=>{if(!e)return!1;const t=e.trim().replace(/\n\s*/g," ").trim();if(t===""||t==="{}"||t==="[]"||!U.some(s=>s.test(t)))return!1;const r=t.charCodeAt(0),n=t.includes("=>");return!(r===123&&!n||r===91||V.test(t)&&!n)},Z=e=>(0,eval)(e),x=(e,t={},o={window:{eval:Z}})=>{for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;const n=e[r];if((0,i.isString)(n))if(d(n))try{t[r]=o.window.eval(`(${n})`)}catch(s){typeof console<"u"&&console.warn&&console.warn('[smbls] deepDestringifyFunctions: eval failed on "'+r+'" \u2014 function will be left as a string and el.call("'+r+'") will silently no-op. Reason: '+(s&&s.message?s.message:String(s))+`.
8
+ `}return n+=`${r}}`,n},K=[/^\(\s*\{[^}]*\}\s*\)\s*=>/,/^(\([^)]*\)|[^=]*)\s*=>/,/^function[\s(]/,/^async\s+/,/^\(\s*function/,/^[a-zA-Z_$][a-zA-Z0-9_$]*\s*=>/],U=/^["[{]/,d=e=>{if(!e)return!1;const t=e.trim().replace(/\n\s*/g," ").trim();if(t===""||t==="{}"||t==="[]"||!K.some(s=>s.test(t)))return!1;const r=t.charCodeAt(0),n=t.includes("=>");return!(r===123&&!n||r===91||U.test(t)&&!n)},Y=e=>(0,eval)(e),x=(e,t={},o={window:{eval:Y}})=>{for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;const n=e[r];if((0,i.isString)(n))if(d(n))try{t[r]=o.window.eval(`(${n})`)}catch(s){typeof console<"u"&&console.warn&&console.warn('[smbls] deepDestringifyFunctions: eval failed on "'+r+'" \u2014 function will be left as a string and el.call("'+r+'") will silently no-op. Reason: '+(s&&s.message?s.message:String(s))+`.
9
9
  First 200 chars of source: `+String(n).slice(0,200)),t[r]=n}else t[r]=n;else if((0,i.isArray)(n)){const s=t[r]=[];for(let c=0;c<n.length;c++){const f=n[c];if((0,i.isString)(f))if(d(f))try{s.push(o.window.eval(`(${f})`))}catch(u){typeof console<"u"&&console.warn&&console.warn(`[smbls] deepDestringifyFunctions: eval failed in array at index ${c} (prop "${r}"). Reason: ${u&&u.message?u.message:String(u)}.
10
- First 200 chars: ${String(f).slice(0,200)}`),s.push(f)}else s.push(f);else(0,i.isObject)(f)?s.push(x(f)):s.push(f)}}else(0,i.isObject)(n)?t[r]=x(n,t[r]):t[r]=n}return t},Q=e=>{if(!e||typeof e!="object")return e;const t={},o=[];for(const r of Object.keys(e)){const n=e[r];(0,i.isString)(n)&&d(n)?o.push([r,n]):t[r]=n}for(const[r,n]of o)try{const s=Object.keys(t).map(c=>`var ${c} = __gs__[${JSON.stringify(c)}];`).join(`
10
+ First 200 chars: ${String(f).slice(0,200)}`),s.push(f)}else s.push(f);else(0,i.isObject)(f)?s.push(x(f)):s.push(f)}}else(0,i.isObject)(n)?t[r]=x(n,t[r]):t[r]=n}return t},Z="Set",Q="Map",X=e=>!e||typeof e!="object"?e:e.__type===Z&&Array.isArray(e.values)?new Set(e.values):e.__type===Q&&Array.isArray(e.entries)?new Map(e.entries):e,m=e=>{if(!e||typeof e!="object")return e;const t={},o=[];for(const r of Object.keys(e)){const n=e[r];(0,i.isString)(n)&&d(n)?o.push([r,n]):t[r]=X(n)}for(const[r,n]of o)try{const s=Object.keys(t).map(c=>`var ${c} = __gs__[${JSON.stringify(c)}];`).join(`
11
11
  `);t[r]=O.window.eval(`(function(__gs__) { ${s}
12
- return (${n}); })`)(t)}catch{try{t[r]=O.window.eval(`(${n})`)}catch{t[r]=n}}return t},X=(e,t={verbose:!0})=>{try{return e?O.window.eval("("+e+")"):{}}catch(o){t.verbose&&console.warn(o)}},Y=(e,...t)=>Object.prototype.hasOwnProperty.call(e,...t),C=e=>{for(const t in e)return!1;return!0},m=e=>(0,i.isObject)(e)&&C(e),b=()=>Object.create(null),j=(e,t,o={})=>{const r=o.exclude||[],n=o.preventUnderscore;for(const s in t)r.includes(s)||!n&&w(s)||s==="constructor"||s==="prototype"||t[s]!==void 0&&(e[s]=t[s]);return e},ee=(e,t,o=[])=>{const r=o instanceof Set;for(const n in t)w(n)||n==="constructor"||n==="prototype"||(r?o.has(n):o.includes(n))||(e[n]=t[n]);return e},T=(e,t,o={},r=new WeakMap)=>{if(!(0,i.isObjectLike)(e)||!(0,i.isObjectLike)(t)||(0,h.isDOMNode)(e)||(0,h.isDOMNode)(t))return t;if(r.has(e))return r.get(e);r.set(e,e);const n=o.exclude,s=n?n instanceof Set?n:new Set(n):null,c=!o.preventForce;for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f)||s&&s.has(f)||c&&w(f)||f==="constructor"||f==="prototype")continue;const u=e[f],l=t[f];(0,h.isDOMNode)(l)?e[f]=l:(0,i.isObjectLike)(u)&&(0,i.isObjectLike)(l)?e[f]=T(u,l,o,r):l!==void 0&&(e[f]=l)}return e},W=(e,t,o=new Set)=>{if(typeof e!="object"||typeof t!="object"||e===null||t===null)return e===t;if(o.has(e)||o.has(t))return!0;o.add(e),o.add(t);const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let s=0;s<r.length;s++){const c=r[s];if(!Object.prototype.hasOwnProperty.call(t,c)||!W(e[c],t[c],o))return!1}return!0},te=new Set(["node","__ref"]),ne=(e,t,o=te)=>{if(e===t)return!0;if(!(0,i.isObjectLike)(e)||!(0,i.isObjectLike)(t)||(0,h.isDOMNode)(e)||(0,h.isDOMNode)(t))return e===t;const r=o instanceof Set?o:new Set(o),n=new WeakSet;function s(c,f){if(n.has(f))return!0;n.add(f);for(const u in f){if(!Object.prototype.hasOwnProperty.call(f,u)||r.has(u))continue;if(!Object.prototype.hasOwnProperty.call(c,u))return!1;const l=f[u],a=c[u];if((0,h.isDOMNode)(l)||(0,h.isDOMNode)(a)){if(l!==a)return!1}else if((0,i.isObjectLike)(l)&&(0,i.isObjectLike)(a)){if(!s(a,l))return!1}else if(l!==a)return!1}return!0}return s(e,t)},re=(e,t)=>{if(t==null)return e;if((0,i.is)(t)("string","number"))delete e[t];else if((0,i.isArray)(t))for(let o=0;o<t.length;o++)delete e[t[o]];else throw new Error("Invalid input: props must be a string or an array of strings");return e},I=e=>{if(e===null||typeof e!="object")return e;const t=Object.create(null);for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=I(e[o]));return t},oe=(e,t)=>{if(e.length===0)return t;const o={};let r=o;for(let n=0;n<e.length;n++)n===e.length-1&&t?r[e[n]]=t:(r[e[n]]={},r=r[e[n]]);return o},se=(e,t)=>{if(!Array.isArray(t))throw new Error("Path must be an array.");let o=e;for(let n=0;n<t.length-1;n++){if(o[t[n]]===void 0)return;o=o[t[n]]}const r=t[t.length-1];o&&Object.prototype.hasOwnProperty.call(o,r)&&delete o[r]},ce=(e,t,o)=>{if(!Array.isArray(t))throw new Error("Path must be an array.");let r=e;for(let n=0;n<t.length-1;n++)(!r[t[n]]||typeof r[t[n]]!="object")&&(r[t[n]]={}),r=r[t[n]];return r[t[t.length-1]]=o,e},ie=(e,t)=>{if(!Array.isArray(t))throw new Error("Path must be an array.");let o=e;for(let r=0;r<t.length;r++){if(o==null)return;o=o[t[r]]}return o},fe=e=>{let o=[],r=0;for(let n=0;n<e.length;n++)if(o.length<2)o.push(e[n]);else if(e[n]===o[n%2]?r++:(o=[e[n-1],e[n]],r=1),r>=20)return(v==="test"||v==="development")&&console.warn("Warning: Potential infinite loop detected due to repeated sequence:",o),!0},le=e=>{const t=new WeakSet;function o(r){if(r&&typeof r=="object"){if(t.has(r))return!0;t.add(r);for(const n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&o(r[n]))return console.log(r,"cycle at "+n),!0}return!1}return o(e)},ue=(e,t)=>{const o=t instanceof Set?t:new Set(t),r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&!o.has(n)&&(r[n]=e[n]);return r};
12
+ return (${n}); })`)(t)}catch{try{t[r]=O.window.eval(`(${n})`)}catch{t[r]=n}}return t},b=(e,t={verbose:!0})=>{try{return e?O.window.eval("("+e+")"):{}}catch(o){t.verbose&&console.warn(o)}},j=(e,...t)=>Object.prototype.hasOwnProperty.call(e,...t),D=e=>{for(const t in e)return!1;return!0},ee=e=>(0,i.isObject)(e)&&D(e),te=()=>Object.create(null),ne=(e,t,o={})=>{const r=o.exclude||[],n=o.preventUnderscore;for(const s in t)r.includes(s)||!n&&w(s)||s==="constructor"||s==="prototype"||t[s]!==void 0&&(e[s]=t[s]);return e},re=(e,t,o=[])=>{const r=o instanceof Set;for(const n in t)w(n)||n==="constructor"||n==="prototype"||(r?o.has(n):o.includes(n))||(e[n]=t[n]);return e},C=(e,t,o={},r=new WeakMap)=>{if(!(0,i.isObjectLike)(e)||!(0,i.isObjectLike)(t)||(0,h.isDOMNode)(e)||(0,h.isDOMNode)(t))return t;if(r.has(e))return r.get(e);r.set(e,e);const n=o.exclude,s=n?n instanceof Set?n:new Set(n):null,c=!o.preventForce;for(const f in t){if(!Object.prototype.hasOwnProperty.call(t,f)||s&&s.has(f)||c&&w(f)||f==="constructor"||f==="prototype")continue;const u=e[f],l=t[f];(0,h.isDOMNode)(l)?e[f]=l:(0,i.isObjectLike)(u)&&(0,i.isObjectLike)(l)?e[f]=C(u,l,o,r):l!==void 0&&(e[f]=l)}return e},W=(e,t,o=new Set)=>{if(typeof e!="object"||typeof t!="object"||e===null||t===null)return e===t;if(o.has(e)||o.has(t))return!0;o.add(e),o.add(t);const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let s=0;s<r.length;s++){const c=r[s];if(!Object.prototype.hasOwnProperty.call(t,c)||!W(e[c],t[c],o))return!1}return!0},oe=new Set(["node","__ref"]),se=(e,t,o=oe)=>{if(e===t)return!0;if(!(0,i.isObjectLike)(e)||!(0,i.isObjectLike)(t)||(0,h.isDOMNode)(e)||(0,h.isDOMNode)(t))return e===t;const r=o instanceof Set?o:new Set(o),n=new WeakSet;function s(c,f){if(n.has(f))return!0;n.add(f);for(const u in f){if(!Object.prototype.hasOwnProperty.call(f,u)||r.has(u))continue;if(!Object.prototype.hasOwnProperty.call(c,u))return!1;const l=f[u],a=c[u];if((0,h.isDOMNode)(l)||(0,h.isDOMNode)(a)){if(l!==a)return!1}else if((0,i.isObjectLike)(l)&&(0,i.isObjectLike)(a)){if(!s(a,l))return!1}else if(l!==a)return!1}return!0}return s(e,t)},ce=(e,t)=>{if(t==null)return e;if((0,i.is)(t)("string","number"))delete e[t];else if((0,i.isArray)(t))for(let o=0;o<t.length;o++)delete e[t[o]];else throw new Error("Invalid input: props must be a string or an array of strings");return e},I=e=>{if(e===null||typeof e!="object")return e;const t=Object.create(null);for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=I(e[o]));return t},ie=(e,t)=>{if(e.length===0)return t;const o={};let r=o;for(let n=0;n<e.length;n++)n===e.length-1&&t?r[e[n]]=t:(r[e[n]]={},r=r[e[n]]);return o},fe=(e,t)=>{if(!Array.isArray(t))throw new Error("Path must be an array.");let o=e;for(let n=0;n<t.length-1;n++){if(o[t[n]]===void 0)return;o=o[t[n]]}const r=t[t.length-1];o&&Object.prototype.hasOwnProperty.call(o,r)&&delete o[r]},le=(e,t,o)=>{if(!Array.isArray(t))throw new Error("Path must be an array.");let r=e;for(let n=0;n<t.length-1;n++)(!r[t[n]]||typeof r[t[n]]!="object")&&(r[t[n]]={}),r=r[t[n]];return r[t[t.length-1]]=o,e},ue=(e,t)=>{if(!Array.isArray(t))throw new Error("Path must be an array.");let o=e;for(let r=0;r<t.length;r++){if(o==null)return;o=o[t[r]]}return o},ae=e=>{let o=[],r=0;for(let n=0;n<e.length;n++)if(o.length<2)o.push(e[n]);else if(e[n]===o[n%2]?r++:(o=[e[n-1],e[n]],r=1),r>=20)return(k==="test"||k==="development")&&console.warn("Warning: Potential infinite loop detected due to repeated sequence:",o),!0},pe=e=>{const t=new WeakSet;function o(r){if(r&&typeof r=="object"){if(t.has(r))return!0;t.add(r);for(const n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&o(r[n]))return console.log(r,"cycle at "+n),!0}return!1}return o(e)},ye=(e,t)=>{const o=t instanceof Set?t:new Set(t),r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&!o.has(n)&&(r[n]=e[n]);return r};
@@ -1,12 +1,12 @@
1
- import{window as S}from"./globals.js";import{isFunction as _,isObjectLike as u,isObject as d,isArray as w,isString as g,is as D}from"./types.js";import{unstackArrayOfObjects as C}from"./array.js";import{stringIncludesAny as T}from"./string.js";import{isDOMNode as h}from"./node.js";import{METHODS_EXL as W}from"./keys.js";const k="production",O=e=>e.charCodeAt(0)===95&&e.charCodeAt(1)===95,v=(e,t,o,r)=>{if(_(e))return t?typeof e.call!="function"?e:e.call(t,t,o||t.state,r||t.context):void 0;if(e!=null&&t?.context?.plugins&&(w(e)||d(e)&&!h(e))){const n=t.context.plugins;for(const s of n)if(s.resolveHandler){const c=s.resolveHandler(e,t);if(typeof c=="function")return v(c,t,o,r)}}return e},X=(e,t,o)=>{for(const r in t)e[r]=v(t[r],o)},Y=(e,t,o=[])=>{const r=o instanceof Set;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(O(n)||(r?o.has(n):o.includes(n))||e[n]===void 0&&(e[n]=t[n]));return e},m=(e,t,o=W)=>$(e,t,o,null),$=(e,t,o,r)=>{if(e===t)return e;if(r){for(let s=0;s<r.length;s+=2)if(r[s]===e&&r[s+1]===t)return e}const n=o instanceof Set;for(const s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||O(s)||s==="constructor"||s==="prototype"||(n?o.has(s):o.includes(s)))continue;const c=e[s],i=t[s];if(u(c)&&u(i)){const l=r||[];l.push(e,t),$(c,i,o,l),l.length-=2}else c===void 0&&(e[s]=i)}return e},b=(e,t=[])=>{const o=t instanceof Set,r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(O(n)||(o?t.has(n):t.includes(n))||(r[n]=e[n]));return r},I=(e,t={})=>{const{exclude:o=[],cleanUndefined:r=!1,cleanNull:n=!1,window:s,visited:c=new WeakMap,handleExtends:i=!1}=t,l=s||S||globalThis;if(!u(e)||h(e))return e;if(c.has(e))return c.get(e);const a=w(e)?[]:{};c.set(e,a);const x=o instanceof Set?o:o.length>3?new Set(o):null;for(const p in e){if(!Object.prototype.hasOwnProperty.call(e,p)||O(p)||p==="__proto__"||(x?x.has(p):o.includes(p)))continue;const y=e[p];if(!(r&&y===void 0)&&!(n&&y===null)){if(h(y)){a[p]=y;continue}if(i&&p==="extends"&&w(y)){a[p]=C(y,o);continue}if(_(y)){a[p]=y;continue}u(y)?a[p]=I(y,{...t,visited:c}):a[p]=y}}return a},E=(e,t={})=>{(e.node||e.__ref||e.parent||e.__element||e.parse)&&((e.__element||e.parent?.__element).warn("Trying to clone element or state at",e),e=e.parse?.());for(const o in e){const r=e[o];if(_(r))t[o]=r.toString();else if(d(r))t[o]={},E(r,t[o]);else if(w(r)){const n=t[o]=[];for(let s=0;s<r.length;s++){const c=r[s];d(c)?(n[s]={},E(c,n[s])):_(c)?n[s]=c.toString():n[s]=c}}else t[o]=r}return t},R=new Set(["&","*","-",":","%","{","}",">","<","@",".","/","!"," "]),A=(e={},t=0)=>{if(e===null||typeof e!="object")return String(e);let o=!1;for(const s in e){o=!0;break}if(!o)return"{}";const r=" ".repeat(t);let n=`{
2
- `;for(const s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;const c=e[s];let i=!1;for(let f=0;f<s.length;f++)if(R.has(s[f])){i=!0;break}const l=i?`'${s}'`:s;if(n+=`${r} ${l}: `,w(c)){n+=`[
3
- `;for(const f of c)u(f)&&f!==null?n+=`${r} ${A(f,t+2)},
4
- `:g(f)?n+=`${r} '${f}',
1
+ import{window as g}from"./globals.js";import{isFunction as S,isObjectLike as u,isObject as d,isArray as w,isString as _,is as N}from"./types.js";import{unstackArrayOfObjects as D}from"./array.js";import{stringIncludesAny as C}from"./string.js";import{isDOMNode as h}from"./node.js";import{METHODS_EXL as W}from"./keys.js";const A="production",O=e=>e.charCodeAt(0)===95&&e.charCodeAt(1)===95,k=(e,t,o,r)=>{if(S(e))return t?typeof e.call!="function"?e:e.call(t,t,o||t.state,r||t.context):void 0;if(e!=null&&t?.context?.plugins&&(w(e)||d(e)&&!h(e))){const n=t.context.plugins;for(const s of n)if(s.resolveHandler){const c=s.resolveHandler(e,t);if(typeof c=="function")return k(c,t,o,r)}}return e},b=(e,t,o)=>{for(const r in t)e[r]=k(t[r],o)},j=(e,t,o=[])=>{const r=o instanceof Set;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(O(n)||(r?o.has(n):o.includes(n))||e[n]===void 0&&(e[n]=t[n]));return e},ee=(e,t,o=W)=>E(e,t,o,null),E=(e,t,o,r)=>{if(e===t)return e;if(r){for(let s=0;s<r.length;s+=2)if(r[s]===e&&r[s+1]===t)return e}const n=o instanceof Set;for(const s in t){if(!Object.prototype.hasOwnProperty.call(t,s)||O(s)||s==="constructor"||s==="prototype"||(n?o.has(s):o.includes(s)))continue;const c=e[s],i=t[s];if(u(c)&&u(i)){const l=r||[];l.push(e,t),E(c,i,o,l),l.length-=2}else c===void 0&&(e[s]=i)}return e},te=(e,t=[])=>{const o=t instanceof Set,r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(O(n)||(o?t.has(n):t.includes(n))||(r[n]=e[n]));return r},I=(e,t={})=>{const{exclude:o=[],cleanUndefined:r=!1,cleanNull:n=!1,window:s,visited:c=new WeakMap,handleExtends:i=!1}=t,l=s||g||globalThis;if(!u(e)||h(e))return e;if(c.has(e))return c.get(e);const a=w(e)?[]:{};c.set(e,a);const x=o instanceof Set?o:o.length>3?new Set(o):null;for(const p in e){if(!Object.prototype.hasOwnProperty.call(e,p)||O(p)||p==="__proto__"||(x?x.has(p):o.includes(p)))continue;const y=e[p];if(!(r&&y===void 0)&&!(n&&y===null)){if(h(y)){a[p]=y;continue}if(i&&p==="extends"&&w(y)){a[p]=D(y,o);continue}if(S(y)){a[p]=y;continue}u(y)?a[p]=I(y,{...t,visited:c}):a[p]=y}}return a},$=(e,t={})=>{(e.node||e.__ref||e.parent||e.__element||e.parse)&&((e.__element||e.parent?.__element).warn("Trying to clone element or state at",e),e=e.parse?.());for(const o in e){const r=e[o];if(S(r))t[o]=r.toString();else if(d(r))t[o]={},$(r,t[o]);else if(w(r)){const n=t[o]=[];for(let s=0;s<r.length;s++){const c=r[s];d(c)?(n[s]={},$(c,n[s])):S(c)?n[s]=c.toString():n[s]=c}}else t[o]=r}return t},M=new Set(["&","*","-",":","%","{","}",">","<","@",".","/","!"," "]),v=(e={},t=0)=>{if(e===null||typeof e!="object")return String(e);let o=!1;for(const s in e){o=!0;break}if(!o)return"{}";const r=" ".repeat(t);let n=`{
2
+ `;for(const s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;const c=e[s];let i=!1;for(let f=0;f<s.length;f++)if(M.has(s[f])){i=!0;break}const l=i?`'${s}'`:s;if(n+=`${r} ${l}: `,w(c)){n+=`[
3
+ `;for(const f of c)u(f)&&f!==null?n+=`${r} ${v(f,t+2)},
4
+ `:_(f)?n+=`${r} '${f}',
5
5
  `:n+=`${r} ${f},
6
- `;n+=`${r} ]`}else u(c)?n+=A(c,t+1):g(c)?n+=T(c,[`
6
+ `;n+=`${r} ]`}else u(c)?n+=v(c,t+1):_(c)?n+=C(c,[`
7
7
  `,"'"])?`\`${c}\``:`'${c}'`:n+=c;n+=`,
8
- `}return n+=`${r}}`,n},M=[/^\(\s*\{[^}]*\}\s*\)\s*=>/,/^(\([^)]*\)|[^=]*)\s*=>/,/^function[\s(]/,/^async\s+/,/^\(\s*function/,/^[a-zA-Z_$][a-zA-Z0-9_$]*\s*=>/],F=/^["[{]/,P=e=>{if(!e)return!1;const t=e.trim().replace(/\n\s*/g," ").trim();if(t===""||t==="{}"||t==="[]"||!M.some(s=>s.test(t)))return!1;const r=t.charCodeAt(0),n=t.includes("=>");return!(r===123&&!n||r===91||F.test(t)&&!n)},L=e=>(0,eval)(e),N=(e,t={},o={window:{eval:L}})=>{for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;const n=e[r];if(g(n))if(P(n))try{t[r]=o.window.eval(`(${n})`)}catch(s){typeof console<"u"&&console.warn&&console.warn('[smbls] deepDestringifyFunctions: eval failed on "'+r+'" \u2014 function will be left as a string and el.call("'+r+'") will silently no-op. Reason: '+(s&&s.message?s.message:String(s))+`.
9
- First 200 chars of source: `+String(n).slice(0,200)),t[r]=n}else t[r]=n;else if(w(n)){const s=t[r]=[];for(let c=0;c<n.length;c++){const i=n[c];if(g(i))if(P(i))try{s.push(o.window.eval(`(${i})`))}catch(l){typeof console<"u"&&console.warn&&console.warn(`[smbls] deepDestringifyFunctions: eval failed in array at index ${c} (prop "${r}"). Reason: ${l&&l.message?l.message:String(l)}.
10
- First 200 chars: ${String(i).slice(0,200)}`),s.push(i)}else s.push(i);else d(i)?s.push(N(i)):s.push(i)}}else d(n)?t[r]=N(n,t[r]):t[r]=n}return t},j=e=>{if(!e||typeof e!="object")return e;const t={},o=[];for(const r of Object.keys(e)){const n=e[r];g(n)&&P(n)?o.push([r,n]):t[r]=n}for(const[r,n]of o)try{const s=Object.keys(t).map(c=>`var ${c} = __gs__[${JSON.stringify(c)}];`).join(`
11
- `);t[r]=S.eval(`(function(__gs__) { ${s}
12
- return (${n}); })`)(t)}catch{try{t[r]=S.eval(`(${n})`)}catch{t[r]=n}}return t},ee=(e,t={verbose:!0})=>{try{return e?S.eval("("+e+")"):{}}catch(o){t.verbose&&console.warn(o)}},te=(e,...t)=>Object.prototype.hasOwnProperty.call(e,...t),B=e=>{for(const t in e)return!1;return!0},ne=e=>d(e)&&B(e),re=()=>Object.create(null),oe=(e,t,o={})=>{const r=o.exclude||[],n=o.preventUnderscore;for(const s in t)r.includes(s)||!n&&O(s)||s==="constructor"||s==="prototype"||t[s]!==void 0&&(e[s]=t[s]);return e},se=(e,t,o=[])=>{const r=o instanceof Set;for(const n in t)O(n)||n==="constructor"||n==="prototype"||(r?o.has(n):o.includes(n))||(e[n]=t[n]);return e},H=(e,t,o={},r=new WeakMap)=>{if(!u(e)||!u(t)||h(e)||h(t))return t;if(r.has(e))return r.get(e);r.set(e,e);const n=o.exclude,s=n?n instanceof Set?n:new Set(n):null,c=!o.preventForce;for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||s&&s.has(i)||c&&O(i)||i==="constructor"||i==="prototype")continue;const l=e[i],f=t[i];h(f)?e[i]=f:u(l)&&u(f)?e[i]=H(l,f,o,r):f!==void 0&&(e[i]=f)}return e},J=(e,t,o=new Set)=>{if(typeof e!="object"||typeof t!="object"||e===null||t===null)return e===t;if(o.has(e)||o.has(t))return!0;o.add(e),o.add(t);const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let s=0;s<r.length;s++){const c=r[s];if(!Object.prototype.hasOwnProperty.call(t,c)||!J(e[c],t[c],o))return!1}return!0},q=new Set(["node","__ref"]),ce=(e,t,o=q)=>{if(e===t)return!0;if(!u(e)||!u(t)||h(e)||h(t))return e===t;const r=o instanceof Set?o:new Set(o),n=new WeakSet;function s(c,i){if(n.has(i))return!0;n.add(i);for(const l in i){if(!Object.prototype.hasOwnProperty.call(i,l)||r.has(l))continue;if(!Object.prototype.hasOwnProperty.call(c,l))return!1;const f=i[l],a=c[l];if(h(f)||h(a)){if(f!==a)return!1}else if(u(f)&&u(a)){if(!s(a,f))return!1}else if(f!==a)return!1}return!0}return s(e,t)},ie=(e,t)=>{if(t==null)return e;if(D(t)("string","number"))delete e[t];else if(w(t))for(let o=0;o<t.length;o++)delete e[t[o]];else throw new Error("Invalid input: props must be a string or an array of strings");return e},z=e=>{if(e===null||typeof e!="object")return e;const t=Object.create(null);for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=z(e[o]));return t},fe=(e,t)=>{if(e.length===0)return t;const o={};let r=o;for(let n=0;n<e.length;n++)n===e.length-1&&t?r[e[n]]=t:(r[e[n]]={},r=r[e[n]]);return o},le=(e,t)=>{if(!Array.isArray(t))throw new Error("Path must be an array.");let o=e;for(let n=0;n<t.length-1;n++){if(o[t[n]]===void 0)return;o=o[t[n]]}const r=t[t.length-1];o&&Object.prototype.hasOwnProperty.call(o,r)&&delete o[r]},ue=(e,t,o)=>{if(!Array.isArray(t))throw new Error("Path must be an array.");let r=e;for(let n=0;n<t.length-1;n++)(!r[t[n]]||typeof r[t[n]]!="object")&&(r[t[n]]={}),r=r[t[n]];return r[t[t.length-1]]=o,e},ae=(e,t)=>{if(!Array.isArray(t))throw new Error("Path must be an array.");let o=e;for(let r=0;r<t.length;r++){if(o==null)return;o=o[t[r]]}return o},pe=e=>{let o=[],r=0;for(let n=0;n<e.length;n++)if(o.length<2)o.push(e[n]);else if(e[n]===o[n%2]?r++:(o=[e[n-1],e[n]],r=1),r>=20)return(k==="test"||k==="development")&&console.warn("Warning: Potential infinite loop detected due to repeated sequence:",o),!0},ye=e=>{const t=new WeakSet;function o(r){if(r&&typeof r=="object"){if(t.has(r))return!0;t.add(r);for(const n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&o(r[n]))return console.log(r,"cycle at "+n),!0}return!1}return o(e)},he=(e,t)=>{const o=t instanceof Set?t:new Set(t),r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&!o.has(n)&&(r[n]=e[n]);return r};export{b as clone,fe as createNestedObject,z as createObjectWithoutPrototype,I as deepClone,ce as deepContains,N as deepDestringifyFunctions,m as deepMerge,E as deepStringifyFunctions,j as destringifyGlobalScope,pe as detectInfiniteLoop,he as excludeKeysFromObject,v as exec,ae as getInObjectByPath,P as hasFunction,te as hasOwnProperty,ye as isCyclic,B as isEmpty,ne as isEmptyObject,J as isEqualDeep,re as makeObjectWithoutPrototype,X as map,Y as merge,A as objectToString,oe as overwrite,H as overwriteDeep,se as overwriteShallow,ie as removeFromObject,le as removeNestedKeyByPath,ue as setInObjectByPath,ee as stringToObject};
8
+ `}return n+=`${r}}`,n},R=[/^\(\s*\{[^}]*\}\s*\)\s*=>/,/^(\([^)]*\)|[^=]*)\s*=>/,/^function[\s(]/,/^async\s+/,/^\(\s*function/,/^[a-zA-Z_$][a-zA-Z0-9_$]*\s*=>/],F=/^["[{]/,P=e=>{if(!e)return!1;const t=e.trim().replace(/\n\s*/g," ").trim();if(t===""||t==="{}"||t==="[]"||!R.some(s=>s.test(t)))return!1;const r=t.charCodeAt(0),n=t.includes("=>");return!(r===123&&!n||r===91||F.test(t)&&!n)},L=e=>(0,eval)(e),T=(e,t={},o={window:{eval:L}})=>{for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;const n=e[r];if(_(n))if(P(n))try{t[r]=o.window.eval(`(${n})`)}catch(s){typeof console<"u"&&console.warn&&console.warn('[smbls] deepDestringifyFunctions: eval failed on "'+r+'" \u2014 function will be left as a string and el.call("'+r+'") will silently no-op. Reason: '+(s&&s.message?s.message:String(s))+`.
9
+ First 200 chars of source: `+String(n).slice(0,200)),t[r]=n}else t[r]=n;else if(w(n)){const s=t[r]=[];for(let c=0;c<n.length;c++){const i=n[c];if(_(i))if(P(i))try{s.push(o.window.eval(`(${i})`))}catch(l){typeof console<"u"&&console.warn&&console.warn(`[smbls] deepDestringifyFunctions: eval failed in array at index ${c} (prop "${r}"). Reason: ${l&&l.message?l.message:String(l)}.
10
+ First 200 chars: ${String(i).slice(0,200)}`),s.push(i)}else s.push(i);else d(i)?s.push(T(i)):s.push(i)}}else d(n)?t[r]=T(n,t[r]):t[r]=n}return t},B="Set",G="Map",H=e=>!e||typeof e!="object"?e:e.__type===B&&Array.isArray(e.values)?new Set(e.values):e.__type===G&&Array.isArray(e.entries)?new Map(e.entries):e,ne=e=>{if(!e||typeof e!="object")return e;const t={},o=[];for(const r of Object.keys(e)){const n=e[r];_(n)&&P(n)?o.push([r,n]):t[r]=H(n)}for(const[r,n]of o)try{const s=Object.keys(t).map(c=>`var ${c} = __gs__[${JSON.stringify(c)}];`).join(`
11
+ `);t[r]=g.eval(`(function(__gs__) { ${s}
12
+ return (${n}); })`)(t)}catch{try{t[r]=g.eval(`(${n})`)}catch{t[r]=n}}return t},re=(e,t={verbose:!0})=>{try{return e?g.eval("("+e+")"):{}}catch(o){t.verbose&&console.warn(o)}},oe=(e,...t)=>Object.prototype.hasOwnProperty.call(e,...t),J=e=>{for(const t in e)return!1;return!0},se=e=>d(e)&&J(e),ce=()=>Object.create(null),ie=(e,t,o={})=>{const r=o.exclude||[],n=o.preventUnderscore;for(const s in t)r.includes(s)||!n&&O(s)||s==="constructor"||s==="prototype"||t[s]!==void 0&&(e[s]=t[s]);return e},fe=(e,t,o=[])=>{const r=o instanceof Set;for(const n in t)O(n)||n==="constructor"||n==="prototype"||(r?o.has(n):o.includes(n))||(e[n]=t[n]);return e},V=(e,t,o={},r=new WeakMap)=>{if(!u(e)||!u(t)||h(e)||h(t))return t;if(r.has(e))return r.get(e);r.set(e,e);const n=o.exclude,s=n?n instanceof Set?n:new Set(n):null,c=!o.preventForce;for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||s&&s.has(i)||c&&O(i)||i==="constructor"||i==="prototype")continue;const l=e[i],f=t[i];h(f)?e[i]=f:u(l)&&u(f)?e[i]=V(l,f,o,r):f!==void 0&&(e[i]=f)}return e},q=(e,t,o=new Set)=>{if(typeof e!="object"||typeof t!="object"||e===null||t===null)return e===t;if(o.has(e)||o.has(t))return!0;o.add(e),o.add(t);const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let s=0;s<r.length;s++){const c=r[s];if(!Object.prototype.hasOwnProperty.call(t,c)||!q(e[c],t[c],o))return!1}return!0},z=new Set(["node","__ref"]),le=(e,t,o=z)=>{if(e===t)return!0;if(!u(e)||!u(t)||h(e)||h(t))return e===t;const r=o instanceof Set?o:new Set(o),n=new WeakSet;function s(c,i){if(n.has(i))return!0;n.add(i);for(const l in i){if(!Object.prototype.hasOwnProperty.call(i,l)||r.has(l))continue;if(!Object.prototype.hasOwnProperty.call(c,l))return!1;const f=i[l],a=c[l];if(h(f)||h(a)){if(f!==a)return!1}else if(u(f)&&u(a)){if(!s(a,f))return!1}else if(f!==a)return!1}return!0}return s(e,t)},ue=(e,t)=>{if(t==null)return e;if(N(t)("string","number"))delete e[t];else if(w(t))for(let o=0;o<t.length;o++)delete e[t[o]];else throw new Error("Invalid input: props must be a string or an array of strings");return e},K=e=>{if(e===null||typeof e!="object")return e;const t=Object.create(null);for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=K(e[o]));return t},ae=(e,t)=>{if(e.length===0)return t;const o={};let r=o;for(let n=0;n<e.length;n++)n===e.length-1&&t?r[e[n]]=t:(r[e[n]]={},r=r[e[n]]);return o},pe=(e,t)=>{if(!Array.isArray(t))throw new Error("Path must be an array.");let o=e;for(let n=0;n<t.length-1;n++){if(o[t[n]]===void 0)return;o=o[t[n]]}const r=t[t.length-1];o&&Object.prototype.hasOwnProperty.call(o,r)&&delete o[r]},ye=(e,t,o)=>{if(!Array.isArray(t))throw new Error("Path must be an array.");let r=e;for(let n=0;n<t.length-1;n++)(!r[t[n]]||typeof r[t[n]]!="object")&&(r[t[n]]={}),r=r[t[n]];return r[t[t.length-1]]=o,e},he=(e,t)=>{if(!Array.isArray(t))throw new Error("Path must be an array.");let o=e;for(let r=0;r<t.length;r++){if(o==null)return;o=o[t[r]]}return o},we=e=>{let o=[],r=0;for(let n=0;n<e.length;n++)if(o.length<2)o.push(e[n]);else if(e[n]===o[n%2]?r++:(o=[e[n-1],e[n]],r=1),r>=20)return(A==="test"||A==="development")&&console.warn("Warning: Potential infinite loop detected due to repeated sequence:",o),!0},Oe=e=>{const t=new WeakSet;function o(r){if(r&&typeof r=="object"){if(t.has(r))return!0;t.add(r);for(const n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&o(r[n]))return console.log(r,"cycle at "+n),!0}return!1}return o(e)},de=(e,t)=>{const o=t instanceof Set?t:new Set(t),r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&!o.has(n)&&(r[n]=e[n]);return r};export{te as clone,ae as createNestedObject,K as createObjectWithoutPrototype,I as deepClone,le as deepContains,T as deepDestringifyFunctions,ee as deepMerge,$ as deepStringifyFunctions,ne as destringifyGlobalScope,we as detectInfiniteLoop,de as excludeKeysFromObject,k as exec,he as getInObjectByPath,P as hasFunction,oe as hasOwnProperty,Oe as isCyclic,J as isEmpty,se as isEmptyObject,q as isEqualDeep,ce as makeObjectWithoutPrototype,b as map,j as merge,v as objectToString,ie as overwrite,V as overwriteDeep,fe as overwriteShallow,ue as removeFromObject,pe as removeNestedKeyByPath,ye as setInObjectByPath,re as stringToObject};
package/object.js CHANGED
@@ -449,15 +449,39 @@ export const deepDestringifyFunctions = (
449
449
  return destringified
450
450
  }
451
451
 
452
+ // Tag values must stay in lockstep with plugins/frank/globalScopeBuilder.js
453
+ // (the serializer side). End-to-end contract covered by
454
+ // destringifyGlobalScope-set-map.test.js.
455
+ const TYPE_TAG_SET = 'Set'
456
+ const TYPE_TAG_MAP = 'Map'
457
+
458
+ /**
459
+ * Rehydrate Set / Map tagged forms back into real Set / Map instances.
460
+ * Pass-through for any other value (including user objects that
461
+ * happen to carry an unrelated `__type` field — only `'Set'` / `'Map'`
462
+ * rehydrate).
463
+ */
464
+ const _rehydrateTaggedValue = (val) => {
465
+ if (!val || typeof val !== 'object') return val
466
+ if (val.__type === TYPE_TAG_SET && Array.isArray(val.values)) return new Set(val.values)
467
+ if (val.__type === TYPE_TAG_MAP && Array.isArray(val.entries)) return new Map(val.entries)
468
+ return val
469
+ }
470
+
452
471
  /**
453
472
  * Destringify a globalScope object so that function strings become real functions.
454
473
  * All globalScope values are made available as local variables when eval'ing each
455
474
  * function, so helpers can reference constants and other helpers naturally.
475
+ *
476
+ * Also rehydrates Set/Map tagged forms (FT-FRANK-1) so `globalScope.X.has(y)`
477
+ * works for the original Set/Map constructors authors put on globalScope.js.
456
478
  */
457
479
  export const destringifyGlobalScope = (gs) => {
458
480
  if (!gs || typeof gs !== 'object') return gs
459
481
 
460
- // First pass: collect non-function values (constants, arrays, objects)
482
+ // First pass: collect non-function values (constants, arrays, objects).
483
+ // Set/Map tagged forms get rehydrated here so they're available as
484
+ // live instances in the closure that wraps function destringify below.
461
485
  const result = {}
462
486
  const fnEntries = []
463
487
  for (const key of Object.keys(gs)) {
@@ -465,7 +489,7 @@ export const destringifyGlobalScope = (gs) => {
465
489
  if (isString(val) && hasFunction(val)) {
466
490
  fnEntries.push([key, val])
467
491
  } else {
468
- result[key] = val
492
+ result[key] = _rehydrateTaggedValue(val)
469
493
  }
470
494
  }
471
495
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/utils",
3
- "version": "3.14.11",
3
+ "version": "3.14.13",
4
4
  "license": "CC-BY-NC-4.0",
5
5
  "type": "module",
6
6
  "module": "./dist/esm/index.js",