@visulima/object 3.1.0 → 3.1.2
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 +4 -0
- package/dist/index.js +1 -1
- package/dist/packem_shared/deleteProperty-Cn6yDusY.js +1 -0
- package/dist/packem_shared/isPlainObject-CV4RFPv0.js +1 -0
- package/dist/packem_shared/omit-7v36zCOc.js +1 -0
- package/dist/packem_shared/pick-1aTP8kw5.js +1 -0
- package/dist/packem_shared/split-path-0wTzUYQI.js +1 -0
- package/package.json +2 -2
- package/dist/packem_shared/deleteProperty-y5ClNSkn.js +0 -1
- package/dist/packem_shared/isPlainObject-DqcjswLg.js +0 -1
- package/dist/packem_shared/omit-BVHtDcCP.js +0 -1
- package/dist/packem_shared/pick-Fkm4vY-x.js +0 -1
- package/dist/packem_shared/split-path-DEreWCls.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## @visulima/object [3.1.2](https://github.com/visulima/visulima/compare/%40visulima%2Fobject%403.1.1...%40visulima%2Fobject%403.1.2) (2026-08-18)
|
|
2
|
+
|
|
3
|
+
## @visulima/object [3.1.1](https://github.com/visulima/visulima/compare/%40visulima%2Fobject%403.1.0...%40visulima%2Fobject%403.1.1) (2026-08-17)
|
|
4
|
+
|
|
1
5
|
## @visulima/object [3.1.0](https://github.com/visulima/visulima/compare/%40visulima%2Fobject%403.0.0...%40visulima%2Fobject%403.1.0) (2026-08-02)
|
|
2
6
|
|
|
3
7
|
## @visulima/object [3.0.0](https://github.com/visulima/visulima/compare/@visulima/object@2.0.4...@visulima/object@3.0.0) (2026-07-03)
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as U}from"./packem_shared/omit-
|
|
1
|
+
import{default as U}from"./packem_shared/omit-7v36zCOc.js";import{default as z}from"./packem_shared/pick-1aTP8kw5.js";import{default as G}from"./packem_shared/isPlainObject-CV4RFPv0.js";import{deleteProperty as J,escapePath as Q,getProperty as X,hasProperty as Y,setProperty as Z}from"./packem_shared/deleteProperty-Cn6yDusY.js";var u={},f={},q;function L(){if(q)return f;q=1,Object.defineProperty(f,"__esModule",{value:!0}),f.isDocumentToRecurOn=f.flatten=f.unique=void 0;function c(i){return[...new Set(i)]}f.unique=c;function h(i){return[].concat(...i)}f.flatten=h;function _(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&Object.keys(i).length}return f.isDocumentToRecurOn=_,f}var A={},k;function T(){return k||(k=1,Object.defineProperty(A,"__esModule",{value:!0})),A}var S;function F(){return S||(S=1,(function(c){var h=u&&u.__createBinding||(Object.create?(function(e,r,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(r,t);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,s)}):(function(e,r,t,n){n===void 0&&(n=t),e[n]=r[t]})),_=u&&u.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),i=u&&u.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&h(r,e,t);return _(r,e),r},E=u&&u.__exportStar||function(e,r){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t)&&h(r,e,t)};Object.defineProperty(c,"__esModule",{value:!0}),c.deepKeysFromList=c.deepKeys=void 0;const b=i(L());E(T(),c);function M(e,r){const t=D(r),n=new WeakSet;return typeof e=="object"&&e!==null?P("",e,t,n):[]}c.deepKeys=M;function v(e,r,t){const n=D(r),s=t??new WeakSet;return e.map(o=>typeof o=="object"&&o!==null?s.has(o)?[]:P("",o,n,s):[])}c.deepKeysFromList=v;function P(e,r,t,n){const s=[],o=Object.keys(r);n.add(r);const l=[{obj:r,keys:o,i:0,basePath:e}];for(;l.length;){const p=l[l.length-1];if(p.i>=p.keys.length){l.pop();continue}const K=p.keys[p.i++],a=p.obj[K],O=j(p.basePath,m(K,t));if(t.expandNestedObjects&&b.isDocumentToRecurOn(a)||t.arrayIndexesAsKeys&&Array.isArray(a)&&a.length)if(t.arrayIndexesAsKeys&&Array.isArray(a)){const g=a;for(let d=g.length-1;d>=0;d--){const y=g[d],x=j(O,String(d));typeof y=="object"&&y!==null&&!Array.isArray(y)?n.has(y)||(n.add(y),l.push({obj:y,keys:Object.keys(y),i:0,basePath:x})):s.push(x)}}else n.has(a)||(n.add(a),l.push({obj:a,keys:Object.keys(a),i:0,basePath:O}));else if(t.expandArrayObjects&&Array.isArray(a)){const g=R(a,O,t,n);for(const d of g)s.push(d)}else{if(t.ignoreEmptyArrays&&Array.isArray(a)&&!a.length)continue;s.push(O)}}return b.unique(s)}function R(e,r,t,n){let s=v(e,t,n);return e.length?e.length&&b.flatten(s).length===0?[r]:(s=s.map(o=>Array.isArray(o)&&o.length===0?[r]:o.map(l=>j(r,m(l,t)))),b.unique(b.flatten(s))):t.ignoreEmptyArraysWhenExpanding?[]:[r]}function m(e,r){return r.escapeNestedDots?e.replace(/\./g,"\\."):e}function j(e,r){return e?e+"."+r:r}function D(e){return{arrayIndexesAsKeys:!1,expandNestedObjects:!0,expandArrayObjects:!1,ignoreEmptyArraysWhenExpanding:!1,escapeNestedDots:!1,ignoreEmptyArrays:!1,...e??{}}}})(u)),u}var w=F();const N=w.deepKeys,I=w.deepKeysFromList;export{N as deepKeys,I as deepKeysFromList,J as deleteProperty,Q as escapePath,X as getProperty,Y as hasProperty,G as isPlainObject,U as omit,z as pick,Z as setProperty};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const u=r=>{const e=typeof r;return r!==null&&(e==="object"||e==="function")},d=new Set(["__proto__","prototype","constructor"]),m=Math.max(...[...d].map(r=>r.length)),E=1e6,A=r=>r>="0"&&r<="9";function l(r){if(r==="0")return!0;if(/^[1-9]\d*$/.test(r)){const e=Number.parseInt(r,10);return e<=Number.MAX_SAFE_INTEGER&&e<=E}return!1}function h(r,e){return d.has(r)?!1:(r&&l(r)?e.push(Number.parseInt(r,10)):e.push(r),!0)}function I(r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);const e=[];let n="",t="",o=!1,i="start",s=!1,f=0;for(const a of r){if(f++,s){n+=a,s=!1;continue}if(a==="\\"){if(i==="index")throw new Error(`Invalid character '${a}' in an index at position ${f}`);if(i==="indexEnd")throw new Error(`Invalid character '${a}' after an index at position ${f}`);s=!0,i=i==="start"?"property":i;continue}switch(a){case".":{if(i==="index")throw new Error(`Invalid character '${a}' in an index at position ${f}`);if(i==="indexEnd"){i="property";break}if(!h(n,e))return[];n="",i="property";break}case"[":{if(i==="index")throw new Error(`Invalid character '${a}' in an index at position ${f}`);if(i==="indexEnd"){i="index";break}if(i==="property"&&n.length<=m&&d.has(n))return[];o=i==="property",i="index";break}case"]":{if(i==="indexEnd")throw new Error(`Invalid character '${a}' after an index at position ${f}`);if(i!=="index"){i==="start"&&(i="property"),n+=a;break}if(t===""){n+="[]",i="property";break}if((n!==""||o)&&!h(n,e))return[];n="",o=!1;const p=Number.parseInt(t,10),c=p<=E&&t===String(p);e.push(c?p:t),t="",i="indexEnd";break}default:{if(i==="index"){if(!A(a))throw new Error(`Invalid character '${a}' in an index at position ${f}`);t+=a;break}if(i==="indexEnd")throw new Error(`Invalid character '${a}' after an index at position ${f}`);i==="start"&&(i="property"),n+=a}}}switch(s&&(n+="\\"),i){case"property":{if(!h(n,e))return[];break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function y(r){if(typeof r=="string")return I(r);if(Array.isArray(r)){const e=[];for(const[n,t]of r.entries()){if(typeof t!="string"&&typeof t!="number")throw new TypeError(`Expected a string or number for path segment at index ${n}, got ${typeof t}`);if(typeof t=="number"&&!Number.isFinite(t))throw new TypeError(`Path segment at index ${n} must be a finite number, got ${t}`);if(d.has(t))return[];typeof t=="string"&&l(t)?e.push(Number.parseInt(t,10)):e.push(t)}return e}return[]}function b(r,e,n){if(!u(r)||typeof e!="string"&&!Array.isArray(e))return n===void 0?r:n;const t=y(e);if(t.length===0)return n;for(let o=0;o<t.length;o++){const i=t[o];if(r=r[i],r==null){if(o!==t.length-1)return n;break}}return r===void 0?n:r}function k(r,e,n){if(!u(r)||typeof e!="string"&&!Array.isArray(e))return r;const t=r,o=y(e);if(o.length===0)return r;for(let i=0;i<o.length;i++){const s=o[i];if(i===o.length-1){r[s]=n;continue}const f=r[s];if(u(f)){r=f;continue}const p=typeof o[i+1]=="number";r[s]=p?[]:{},r=r[s]}return t}function P(r,e){if(!u(r)||typeof e!="string"&&!Array.isArray(e))return!1;const n=y(e);if(n.length===0)return!1;for(let t=0;t<n.length;t++){const o=n[t];if(t===n.length-1)return Object.hasOwn(r,o)?(delete r[o],!0):!1;const i=r[o];if(!u(i))return!1;r=i}}function S(r,e){if(!u(r)||typeof e!="string"&&!Array.isArray(e))return!1;const n=y(e);if(n.length===0)return!1;for(const t of n){if(!u(r)||!(t in r))return!1;r=r[t]}return!0}function g(r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);return r.replaceAll(/[\\.[]/g,String.raw`\$&`)}function w(r){const e=Object.entries(r);return Array.isArray(r)?e.map(([n,t])=>[l(n)?Number.parseInt(n,10):n,t]):e}function $(r,e,n,t){const o=!e&&(t||n);if(typeof r=="number"){if(!Number.isInteger(r)||r<0){const s=g(String(r));return e?s:`.${s}`}return o?`.${r}`:`[${r}]`}if(r==="")return e?"":".";if(l(r)){const s=Number.parseInt(r,10);return o?`.${s}`:`[${s}]`}const i=g(r);return e?i:`.${i}`}function K(r,e={}){if(!Array.isArray(r))throw new TypeError(`Expected an array, got ${typeof r}`);const{preferDotForIndices:n=!1}=e,t=[];let o=!0;for(const[i,s]of r.entries()){if(typeof s!="string"&&typeof s!="number")throw new TypeError(`Expected a string or number for path segment at index ${i}, got ${typeof s}`);const f=$(s,i===0,o,n);t.push(f),f!==""&&(o=!1)}return t.join("")}function*N(r){if(!u(r))return;const e=w(r);if(e.length===0)return;const n=new Set([r]),t=[{iterator:e[Symbol.iterator](),prefix:"",object:r}];for(;t.length>0;){const o=t.at(-1),{value:i,done:s}=o.iterator.next();if(s){n.delete(t.pop().object);continue}const[f,a]=i,{prefix:p}=o,c=p+$(f,t.length===1,p==="",!1);if(u(a)){if(n.has(a))continue;const x=w(a);if(x.length>0){n.add(a),t.push({iterator:x[Symbol.iterator](),prefix:c,object:a});continue}}yield c}}function T(r){return[...N(r)]}function _(r){const e={};if(!u(r))return e;for(const[n,t]of Object.entries(r))k(e,n,t);return e}export{T as deepKeys,P as deleteProperty,g as escapePath,b as getProperty,S as hasProperty,I as parsePath,k as setProperty,K as stringifyPath,_ as unflatten};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=t=>{if(typeof t!="object"||t===null)return!1;const o=Object.getPrototypeOf(t);return(o===null||o===Object.prototype||Object.getPrototypeOf(o)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as a,s as f,c as l,a as m}from"./split-path-0wTzUYQI.js";import p from"./isPlainObject-CV4RFPv0.js";const y=(t,r)=>{const s=[];for(const[n,e]of t.entries()){const o=a(r,String(n));o.some(i=>i.length===0)||s.push(c(e,o))}return s},h=(t,r)=>{const s={};for(const[n,e]of Object.entries(t)){const o=a(r,n);o.some(i=>i.length===0)||f(s,n,c(e,o))}return l(t,s),s},c=(t,r)=>Array.isArray(t)?y(t,r):p(t)?h(t,r):t,u=(t,r)=>c(t,r),g=(t,r)=>{const s=r.map(n=>m(n));return u(t,s)};export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as h,c as u,n as p,a as m}from"./split-path-0wTzUYQI.js";import a from"./isPlainObject-CV4RFPv0.js";const e=Symbol("nothing"),f=r=>{if(Array.isArray(r))return r.map(t=>f(t));if(!a(r))return r;const n={};for(const[t,s]of Object.entries(r))h(n,t,f(s));return u(r,n),n},d=(r,n)=>{const t=[];for(const[s,o]of r.entries()){const c=p(n,String(s));if(c.length===0)continue;const i=l(o,c);i!==e&&t.push(i)}return t.length>0?t:e},g=(r,n)=>{const t={};let s=!1;for(const[o,c]of Object.entries(r)){const i=p(n,o);if(i.length===0)continue;const y=l(c,i);y!==e&&(h(t,o,y),s=!0)}return s?t:e},l=(r,n)=>n.some(t=>t.length===0)?f(r):Array.isArray(r)?d(r,n):a(r)?g(r,n):e,A=(r,n)=>{const t=l(r,n);return t!==e?t:a(r)||Array.isArray(r)?{}:r},w=(r,n)=>{if(n.length===0)return{};const t=n.map(s=>m(s));return A(r,t)};export{w as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=(r,e)=>{for(const t of Object.getOwnPropertySymbols(r))Object.getOwnPropertyDescriptor(r,t)?.enumerable&&(e[t]=r[t])},c=(r,e)=>{const t=[];for(const s of r){const[o]=s;(o==="*"||o===e)&&t.push(s.slice(1))}return t},i=(r,e,t)=>{if(e==="__proto__"){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0});return}r[e]=t},f=r=>{const e=[];let t="",s=!1;for(const o of r){if(s){t+=o==="."||o==="\\"?o:`\\${o}`,s=!1;continue}if(o==="\\"){s=!0;continue}if(o==="."){e.push(t),t="";continue}t+=o}return s&&(t+="\\"),e.push(t),e};export{f as a,n as c,c as n,i as s};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/object",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "Helper functions for working with objects and arrays.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"access",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"CHANGELOG.md"
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"type-fest": "5.
|
|
61
|
+
"type-fest": "5.8.0"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": "^22.14.0 || >=24.10.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const f=e=>{const r=typeof e;return e!==null&&(r==="object"||r==="function")},g=e=>{if(!f(e))return!1;for(const r in e)if(Object.hasOwn(e,r))return!1;return!0},y=new Set(["__proto__","prototype","constructor"]),d=1e6,w=e=>e>="0"&&e<="9";function u(e){if(e==="0")return!0;if(/^[1-9]\d*$/.test(e)){const r=Number.parseInt(e,10);return r<=Number.MAX_SAFE_INTEGER&&r<=d}return!1}function c(e,r){return y.has(e)?!1:(e&&u(e)?r.push(Number.parseInt(e,10)):r.push(e),!0)}function b(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);const r=[];let n="",t="start",o=!1,i=0;for(const s of e){if(i++,o){n+=s,o=!1;continue}if(s==="\\"){if(t==="index")throw new Error(`Invalid character '${s}' in an index at position ${i}`);if(t==="indexEnd")throw new Error(`Invalid character '${s}' after an index at position ${i}`);o=!0,t=t==="start"?"property":t;continue}switch(s){case".":{if(t==="index")throw new Error(`Invalid character '${s}' in an index at position ${i}`);if(t==="indexEnd"){t="property";break}if(!c(n,r))return[];n="",t="property";break}case"[":{if(t==="index")throw new Error(`Invalid character '${s}' in an index at position ${i}`);if(t==="indexEnd"){t="index";break}if(t==="property"||t==="start"){if((n||t==="property")&&!c(n,r))return[];n=""}t="index";break}case"]":{if(t==="index"){if(n==="")n=(r.pop()||"")+"[]",t="property";else{const a=Number.parseInt(n,10);!Number.isNaN(a)&&Number.isFinite(a)&&a>=0&&a<=Number.MAX_SAFE_INTEGER&&a<=d&&n===String(a)?r.push(a):r.push(n),n="",t="indexEnd"}break}if(t==="indexEnd")throw new Error(`Invalid character '${s}' after an index at position ${i}`);n+=s;break}default:{if(t==="index"&&!w(s))throw new Error(`Invalid character '${s}' in an index at position ${i}`);if(t==="indexEnd")throw new Error(`Invalid character '${s}' after an index at position ${i}`);t==="start"&&(t="property"),n+=s}}}switch(o&&(n+="\\"),t){case"property":{if(!c(n,r))return[];break}case"index":throw new Error("Index was not closed");case"start":{r.push("");break}}return r}function p(e){if(typeof e=="string")return b(e);if(Array.isArray(e)){const r=[];for(const[n,t]of e.entries()){if(typeof t!="string"&&typeof t!="number")throw new TypeError(`Expected a string or number for path segment at index ${n}, got ${typeof t}`);if(typeof t=="number"&&!Number.isFinite(t))throw new TypeError(`Path segment at index ${n} must be a finite number, got ${t}`);if(y.has(t))return[];typeof t=="string"&&u(t)?r.push(Number.parseInt(t,10)):r.push(t)}return r}return[]}function m(e,r,n){if(!f(e)||typeof r!="string"&&!Array.isArray(r))return n===void 0?e:n;const t=p(r);if(t.length===0)return n;for(let o=0;o<t.length;o++){const i=t[o];if(e=e[i],e==null){if(o!==t.length-1)return n;break}}return e===void 0?n:e}function x(e,r,n){if(!f(e)||typeof r!="string"&&!Array.isArray(r))return e;const t=e,o=p(r);if(o.length===0)return e;for(let i=0;i<o.length;i++){const s=o[i];if(i===o.length-1)e[s]=n;else if(!f(e[s])){const a=typeof o[i+1]=="number";e[s]=a?[]:{}}e=e[s]}return t}function A(e,r){if(!f(e)||typeof r!="string"&&!Array.isArray(r))return!1;const n=p(r);if(n.length===0)return!1;for(let t=0;t<n.length;t++){const o=n[t];if(t===n.length-1)return Object.hasOwn(e,o)?(delete e[o],!0):!1;if(e=e[o],!f(e))return!1}}function I(e,r){if(!f(e)||typeof r!="string"&&!Array.isArray(r))return!1;const n=p(r);if(n.length===0)return!1;for(const t of n){if(!f(e)||!(t in e))return!1;e=e[t]}return!0}function h(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return e.replaceAll(/[\\.[]/g,String.raw`\$&`)}function E(e){const r=Object.entries(e);return Array.isArray(e)?r.map(([n,t])=>[u(n)?Number.parseInt(n,10):n,t]):r}function $(e,r={}){if(!Array.isArray(e))throw new TypeError(`Expected an array, got ${typeof e}`);const{preferDotForIndices:n=!1}=r,t=[];for(const[o,i]of e.entries()){if(typeof i!="string"&&typeof i!="number")throw new TypeError(`Expected a string or number for path segment at index ${o}, got ${typeof i}`);if(typeof i=="number")if(!Number.isInteger(i)||i<0){const s=h(String(i));t.push(o===0?s:`.${s}`)}else n&&o>0?t.push(`.${i}`):t.push(`[${i}]`);else if(typeof i=="string")if(i==="")o===0||t.push(".");else if(u(i)){const s=Number.parseInt(i,10);n&&o>0?t.push(`.${s}`):t.push(`[${s}]`)}else{const s=h(i);t.push(o===0?s:`.${s}`)}}return t.join("")}function*l(e,r=[],n=new Set){if(!f(e)||g(e)){r.length>0&&(yield $(r));return}if(!n.has(e)){n.add(e);for(const[t,o]of E(e))r.push(t),yield*l(o,r,n),r.pop();n.delete(e)}}function N(e){return[...l(e)]}function k(e){const r={};if(!f(e))return r;for(const[n,t]of Object.entries(e))x(r,n,t);return r}export{N as deepKeys,A as deleteProperty,h as escapePath,m as getProperty,I as hasProperty,b as parsePath,x as setProperty,$ as stringifyPath,k as unflatten};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const o=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as a,t as i,a as m,i as u}from"./split-path-DEreWCls.js";import p from"./isPlainObject-DqcjswLg.js";const g=(t,o)=>{const s=[];for(const[r,n]of t.entries()){const e=a(o,String(r));e.some(c=>c.length===0)||s.push(f(n,e))}return s},h=(t,o)=>{const s={};for(const[r,n]of Object.entries(t)){const e=a(o,r);e.some(c=>c.length===0)||i(s,r,f(n,e))}return m(t,s),s},f=(t,o)=>Array.isArray(t)?g(t,o):p(t)?h(t,o):t,l=(t,o)=>f(t,o),b=(t,o)=>{const s=o.map(r=>u(r));return l(t,s)};export{b as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as g,a as y,e as m,i as h}from"./split-path-DEreWCls.js";import a from"./isPlainObject-DqcjswLg.js";const s=Symbol("nothing"),f=t=>{if(Array.isArray(t))return t.map(r=>f(r));if(!a(t))return t;const e={};for(const[r,o]of Object.entries(t))g(e,r,f(o));return y(t,e),e},p=(t,e)=>{const r=[];for(const[o,c]of t.entries()){const i=m(e,String(o));if(i.length===0)continue;const n=u(c,i);n!==s&&r.push(n)}return r.length>0?r:s},A=(t,e)=>{const r={};let o=!1;for(const[c,i]of Object.entries(t)){const n=m(e,c);if(n.length===0)continue;const l=u(i,n);l!==s&&(g(r,c,l),o=!0)}return o?r:s},u=(t,e)=>e.some(r=>r.length===0)?f(t):Array.isArray(t)?p(t,e):a(t)?A(t,e):s,b=(t,e)=>{const r=u(t,e);return r!==s?r:a(t)||Array.isArray(t)?{}:t},S=(t,e)=>{if(e.length===0)return{};const r=e.map(o=>h(o));return b(t,r)};export{S as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const s=(r,t)=>{for(const e of Object.getOwnPropertySymbols(r))Object.getOwnPropertyDescriptor(r,e)?.enumerable&&(t[e]=r[e])},c=(r,t)=>{const e=[];for(const n of r){const[o]=n;(o==="*"||o===t)&&e.push(n.slice(1))}return e},u=(r,t,e)=>{if(t==="__proto__"){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0});return}r[t]=e},f=r=>{const t=[];let e="",n=!1;for(const o of r){if(n){e+=o==="."||o==="\\"?o:`\\${o}`,n=!1;continue}if(o==="\\"){n=!0;continue}if(o==="."){t.push(e),e="";continue}e+=o}return n&&(e+="\\"),t.push(e),t};export{s as a,c as e,f as i,u as t};
|