@visulima/object 1.0.2 → 1.0.4
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 +16 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/getProperty-C5Q_YpVO.mjs +1 -0
- package/dist/packem_shared/getProperty-D34HTBAJ.cjs +1 -0
- package/dist/packem_shared/isPlainObject-BTLAczOE.cjs +1 -0
- package/dist/{shared/isPlainObject-VVOVbznO.mjs → packem_shared/isPlainObject-CFPUbgRS.mjs} +1 -1
- package/dist/packem_shared/omit-Cwc8rJUb.cjs +1 -0
- package/dist/packem_shared/omit-Df-0bpNu.mjs +1 -0
- package/dist/packem_shared/pick-CS1_JC9v.mjs +1 -0
- package/dist/packem_shared/pick-CkwC0jUm.cjs +1 -0
- package/package.json +7 -7
- package/dist/shared/getProperty-BE7cAsTa.mjs +0 -1
- package/dist/shared/getProperty-CFmO4UX4.cjs +0 -1
- package/dist/shared/isPlainObject-B0tpqX_G.cjs +0 -1
- package/dist/shared/omit-BTcVGp-C.cjs +0 -1
- package/dist/shared/omit-DClq0ugw.mjs +0 -1
- package/dist/shared/pick-C02Ru-rn.mjs +0 -1
- package/dist/shared/pick-Dc4jbs2q.cjs +0 -1
- /package/dist/{shared → packem_shared}/paths-are-equal-BgwMgI_D.mjs +0 -0
- /package/dist/{shared → packem_shared}/paths-are-equal-D8teV-Y-.cjs +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## @visulima/object [1.0.4](https://github.com/visulima/visulima/compare/@visulima/object@1.0.3...@visulima/object@1.0.4) (2024-09-11)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* fixed node10 support ([f5e78d9](https://github.com/visulima/visulima/commit/f5e78d9bff8fd603967666598b34f9338a8726b5))
|
|
6
|
+
|
|
7
|
+
### Miscellaneous Chores
|
|
8
|
+
|
|
9
|
+
* updated dev dependencies ([28b5ee5](https://github.com/visulima/visulima/commit/28b5ee5c805ca8868536418829cde7ba8c5bb8dd))
|
|
10
|
+
|
|
11
|
+
## @visulima/object [1.0.3](https://github.com/visulima/visulima/compare/@visulima/object@1.0.2...@visulima/object@1.0.3) (2024-09-07)
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* fixed broken chunk splitting from packem ([1aaf277](https://github.com/visulima/visulima/commit/1aaf27779292d637923c5f8a220e18606e78caa2))
|
|
16
|
+
|
|
1
17
|
## @visulima/object [1.0.2](https://github.com/visulima/visulima/compare/@visulima/object@1.0.1...@visulima/object@1.0.2) (2024-09-07)
|
|
2
18
|
|
|
3
19
|
### Bug Fixes
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var D=Object.defineProperty;var u=(s,p)=>D(s,"name",{value:p,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./
|
|
1
|
+
"use strict";var D=Object.defineProperty;var u=(s,p)=>D(s,"name",{value:p,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./packem_shared/omit-Cwc8rJUb.cjs"),q=require("./packem_shared/pick-CkwC0jUm.cjs"),c=require("./packem_shared/getProperty-D34HTBAJ.cjs"),M=require("./packem_shared/isPlainObject-BTLAczOE.cjs");var o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},y={},a={};Object.defineProperty(a,"__esModule",{value:!0});a.isDocumentToRecurOn=a.flatten=a.unique=void 0;function S(s){return[...new Set(s)]}u(S,"unique");a.unique=S;function T(s){return[].concat(...s)}u(T,"flatten");a.flatten=T;function E(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length}u(E,"isDocumentToRecurOn");a.isDocumentToRecurOn=E;var P={};Object.defineProperty(P,"__esModule",{value:!0});(function(s){var p=o&&o.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:u(function(){return e[t]},"get")}),Object.defineProperty(r,i,n)}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),A=o&&o.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),v=o&&o.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&p(e,r,t);return A(e,r),e},m=o&&o.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&p(e,r,t)};Object.defineProperty(s,"__esModule",{value:!0}),s.deepKeysFromList=s.deepKeys=void 0;const f=v(a);m(P,s);function d(r,e){const t=j(e);return typeof r=="object"&&r!==null?b("",r,t):[]}u(d,"deepKeys"),s.deepKeys=d;function g(r,e){const t=j(e);return r.map(i=>typeof i=="object"&&i!==null?d(i,t):[])}u(g,"deepKeysFromList"),s.deepKeysFromList=g;function b(r,e,t){const i=Object.keys(e).map(n=>{const l=_(r,O(n,t));return t.expandNestedObjects&&f.isDocumentToRecurOn(e[n])||t.arrayIndexesAsKeys&&Array.isArray(e[n])&&e[n].length?b(l,e[n],t):t.expandArrayObjects&&Array.isArray(e[n])?h(e[n],l,t):t.ignoreEmptyArrays&&Array.isArray(e[n])&&!e[n].length?[]:l});return f.flatten(i)}u(b,"generateDeepKeysList");function h(r,e,t){let i=g(r,t);return r.length?r.length&&f.flatten(i).length===0?[e]:(i=i.map(n=>Array.isArray(n)&&n.length===0?[e]:n.map(l=>_(e,O(l,t)))),f.unique(f.flatten(i))):t.ignoreEmptyArraysWhenExpanding?[]:[e]}u(h,"processArrayKeys");function O(r,e){return e.escapeNestedDots?r.replace(/\./g,"\\."):r}u(O,"escapeNestedDotsIfSpecified");function _(r,e){return r?r+"."+e:e}u(_,"buildKeyName");function j(r){return{arrayIndexesAsKeys:!1,expandNestedObjects:!0,expandArrayObjects:!1,ignoreEmptyArraysWhenExpanding:!1,escapeNestedDots:!1,ignoreEmptyArrays:!1,...r??{}}}u(j,"mergeOptions")})(y);exports.omit=w;exports.pick=q;exports.deleteProperty=c.deleteProperty;exports.escapePath=c.escapePath;exports.getProperty=c.getProperty;exports.hasProperty=c.hasProperty;exports.setProperty=c.setProperty;exports.isPlainObject=M;exports.deepKeys=y.deepKeys;exports.deepKeysFromList=y.deepKeysFromList;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var P=Object.defineProperty;var u=(s,c)=>P(s,"name",{value:c,configurable:!0});import{default as F}from"./packem_shared/omit-Df-0bpNu.mjs";import{default as q}from"./packem_shared/pick-CS1_JC9v.mjs";import{deleteProperty as I,escapePath as B,getProperty as W,hasProperty as G,setProperty as K}from"./packem_shared/getProperty-C5Q_YpVO.mjs";import{default as z}from"./packem_shared/isPlainObject-CFPUbgRS.mjs";var f=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},p={},o={};Object.defineProperty(o,"__esModule",{value:!0});o.isDocumentToRecurOn=o.flatten=o.unique=void 0;function h(s){return[...new Set(s)]}u(h,"unique");o.unique=h;function w(s){return[].concat(...s)}u(w,"flatten");o.flatten=w;function x(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length}u(x,"isDocumentToRecurOn");o.isDocumentToRecurOn=x;var j={};Object.defineProperty(j,"__esModule",{value:!0});(function(s){var c=f&&f.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:u(function(){return e[t]},"get")}),Object.defineProperty(r,i,n)}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),A=f&&f.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),m=f&&f.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&c(e,r,t);return A(e,r),e},v=f&&f.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&c(e,r,t)};Object.defineProperty(s,"__esModule",{value:!0}),s.deepKeysFromList=s.deepKeys=void 0;const a=m(o);v(j,s);function d(r,e){const t=_(e);return typeof r=="object"&&r!==null?b("",r,t):[]}u(d,"deepKeys"),s.deepKeys=d;function y(r,e){const t=_(e);return r.map(i=>typeof i=="object"&&i!==null?d(i,t):[])}u(y,"deepKeysFromList"),s.deepKeysFromList=y;function b(r,e,t){const i=Object.keys(e).map(n=>{const l=O(r,g(n,t));return t.expandNestedObjects&&a.isDocumentToRecurOn(e[n])||t.arrayIndexesAsKeys&&Array.isArray(e[n])&&e[n].length?b(l,e[n],t):t.expandArrayObjects&&Array.isArray(e[n])?D(e[n],l,t):t.ignoreEmptyArrays&&Array.isArray(e[n])&&!e[n].length?[]:l});return a.flatten(i)}u(b,"generateDeepKeysList");function D(r,e,t){let i=y(r,t);return r.length?r.length&&a.flatten(i).length===0?[e]:(i=i.map(n=>Array.isArray(n)&&n.length===0?[e]:n.map(l=>O(e,g(l,t)))),a.unique(a.flatten(i))):t.ignoreEmptyArraysWhenExpanding?[]:[e]}u(D,"processArrayKeys");function g(r,e){return e.escapeNestedDots?r.replace(/\./g,"\\."):r}u(g,"escapeNestedDotsIfSpecified");function O(r,e){return r?r+"."+e:e}u(O,"buildKeyName");function _(r){return{arrayIndexesAsKeys:!1,expandNestedObjects:!0,expandArrayObjects:!1,ignoreEmptyArraysWhenExpanding:!1,escapeNestedDots:!1,ignoreEmptyArrays:!1,...r??{}}}u(_,"mergeOptions")})(p);const E=p.deepKeys,L=p.deepKeysFromList;export{E as deepKeys,L as deepKeysFromList,I as deleteProperty,B as escapePath,W as getProperty,G as hasProperty,z as isPlainObject,F as omit,q as pick,K as setProperty};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var s=(r,n)=>c(r,"name",{value:n,configurable:!0});const a=s(r=>{const n=typeof r;return r!==null&&(n==="object"||n==="function")},"isObject"),x=s(r=>a(r)&&Object.keys(r).length===0,"isEmptyObject"),u=new Set(["__proto__","prototype","constructor"]),g=new Set("0123456789");function d(r){const n=[];let t="",e="start",i=!1;for(const f of r)switch(f){case"\\":{if(e==="index")throw new Error("Invalid character in an index");if(e==="indexEnd")throw new Error("Invalid character after an index");i&&(t+=f),e="property",i=!i;break}case".":{if(e==="index")throw new Error("Invalid character in an index");if(e==="indexEnd"){e="property";break}if(i){i=!1,t+=f;break}if(u.has(t))return[];n.push(t),t="",e="property";break}case"[":{if(e==="index")throw new Error("Invalid character in an index");if(e==="indexEnd"){e="index";break}if(i){i=!1,t+=f;break}if(e==="property"){if(u.has(t))return[];n.push(t),t=""}e="index";break}case"]":{if(e==="index"){n.push(Number.parseInt(t,10)),t="",e="indexEnd";break}if(e==="indexEnd")throw new Error("Invalid character after an index")}default:{if(e==="index"&&!g.has(f))throw new Error("Invalid character in an index");if(e==="indexEnd")throw new Error("Invalid character after an index");e==="start"&&(e="property"),i&&(i=!1,t+="\\"),t+=f}}switch(i&&(t+="\\"),e){case"property":{if(u.has(t))return[];n.push(t);break}case"index":throw new Error("Index was not closed");case"start":{n.push("");break}}return n}s(d,"getPathSegments");function l(r,n){if(typeof n!="number"&&Array.isArray(r)){const t=Number.parseInt(n,10);return Number.isInteger(t)&&r[t]===r[n]}return!1}s(l,"isStringIndex");function p(r,n){if(l(r,n))throw new Error("Cannot use string index")}s(p,"assertNotStringIndex");function I(r,n,t){if(!a(r)||typeof n!="string")return t===void 0?r:t;const e=d(n);if(e.length===0)return t;for(let i=0;i<e.length;i++){const f=e[i];if(l(r,f)?r=i===e.length-1?void 0:null:r=r[f],r==null){if(i!==e.length-1)return t;break}}return r===void 0?t:r}s(I,"getProperty");function m(r,n,t){if(!a(r)||typeof n!="string")return r;const e=r,i=d(n);for(let f=0;f<i.length;f++){const o=i[f];p(r,o),f===i.length-1?r[o]=t:a(r[o])||(r[o]=typeof i[f+1]=="number"?[]:{}),r=r[o]}return e}s(m,"setProperty");function A(r,n){if(!a(r)||typeof n!="string")return!1;const t=d(n);for(let e=0;e<t.length;e++){const i=t[e];if(p(r,i),e===t.length-1)return delete r[i],!0;if(r=r[i],!a(r))return!1}}s(A,"deleteProperty");function P(r,n){if(!a(r)||typeof n!="string")return!1;const t=d(n);if(t.length===0)return!1;for(const e of t){if(!a(r)||!(e in r)||l(r,e))return!1;r=r[e]}return!0}s(P,"hasProperty");function w(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replaceAll(/[\\.[]/g,"\\$&")}s(w,"escapePath");function h(r){const n=Object.entries(r);return Array.isArray(r)?n.map(([t,e])=>[Number(t),e]):n}s(h,"entries");function E(r){let n="";for(let[t,e]of h(r))typeof e=="number"?n+=`[${e}]`:(e=w(e),n+=t===0?e:`.${e}`);return n}s(E,"stringifyPath");function*y(r,n=[]){if(!a(r)||x(r)){n.length>0&&(yield E(n));return}for(const[t,e]of h(r))yield*y(e,[...n,t])}s(y,"deepKeysIterator");function S(r){return[...y(r)]}s(S,"deepKeys");export{S as deepKeys,A as deleteProperty,w as escapePath,I as getProperty,P as hasProperty,m as setProperty};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var g=Object.defineProperty;var f=(r,n)=>g(r,"name",{value:n,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=f(r=>{const n=typeof r;return r!==null&&(n==="object"||n==="function")},"isObject"),x=f(r=>a(r)&&Object.keys(r).length===0,"isEmptyObject"),u=new Set(["__proto__","prototype","constructor"]),w=new Set("0123456789");function d(r){const n=[];let t="",e="start",i=!1;for(const s of r)switch(s){case"\\":{if(e==="index")throw new Error("Invalid character in an index");if(e==="indexEnd")throw new Error("Invalid character after an index");i&&(t+=s),e="property",i=!i;break}case".":{if(e==="index")throw new Error("Invalid character in an index");if(e==="indexEnd"){e="property";break}if(i){i=!1,t+=s;break}if(u.has(t))return[];n.push(t),t="",e="property";break}case"[":{if(e==="index")throw new Error("Invalid character in an index");if(e==="indexEnd"){e="index";break}if(i){i=!1,t+=s;break}if(e==="property"){if(u.has(t))return[];n.push(t),t=""}e="index";break}case"]":{if(e==="index"){n.push(Number.parseInt(t,10)),t="",e="indexEnd";break}if(e==="indexEnd")throw new Error("Invalid character after an index")}default:{if(e==="index"&&!w.has(s))throw new Error("Invalid character in an index");if(e==="indexEnd")throw new Error("Invalid character after an index");e==="start"&&(e="property"),i&&(i=!1,t+="\\"),t+=s}}switch(i&&(t+="\\"),e){case"property":{if(u.has(t))return[];n.push(t);break}case"index":throw new Error("Index was not closed");case"start":{n.push("");break}}return n}f(d,"getPathSegments");function l(r,n){if(typeof n!="number"&&Array.isArray(r)){const t=Number.parseInt(n,10);return Number.isInteger(t)&&r[t]===r[n]}return!1}f(l,"isStringIndex");function p(r,n){if(l(r,n))throw new Error("Cannot use string index")}f(p,"assertNotStringIndex");function E(r,n,t){if(!a(r)||typeof n!="string")return t===void 0?r:t;const e=d(n);if(e.length===0)return t;for(let i=0;i<e.length;i++){const s=e[i];if(l(r,s)?r=i===e.length-1?void 0:null:r=r[s],r==null){if(i!==e.length-1)return t;break}}return r===void 0?t:r}f(E,"getProperty");function k(r,n,t){if(!a(r)||typeof n!="string")return r;const e=r,i=d(n);for(let s=0;s<i.length;s++){const o=i[s];p(r,o),s===i.length-1?r[o]=t:a(r[o])||(r[o]=typeof i[s+1]=="number"?[]:{}),r=r[o]}return e}f(k,"setProperty");function I(r,n){if(!a(r)||typeof n!="string")return!1;const t=d(n);for(let e=0;e<t.length;e++){const i=t[e];if(p(r,i),e===t.length-1)return delete r[i],!0;if(r=r[i],!a(r))return!1}}f(I,"deleteProperty");function m(r,n){if(!a(r)||typeof n!="string")return!1;const t=d(n);if(t.length===0)return!1;for(const e of t){if(!a(r)||!(e in r)||l(r,e))return!1;r=r[e]}return!0}f(m,"hasProperty");function y(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replaceAll(/[\\.[]/g,"\\$&")}f(y,"escapePath");function h(r){const n=Object.entries(r);return Array.isArray(r)?n.map(([t,e])=>[Number(t),e]):n}f(h,"entries");function P(r){let n="";for(let[t,e]of h(r))typeof e=="number"?n+=`[${e}]`:(e=y(e),n+=t===0?e:`.${e}`);return n}f(P,"stringifyPath");function*c(r,n=[]){if(!a(r)||x(r)){n.length>0&&(yield P(n));return}for(const[t,e]of h(r))yield*c(e,[...n,t])}f(c,"deepKeysIterator");function A(r){return[...c(r)]}f(A,"deepKeys");exports.deepKeys=A;exports.deleteProperty=I;exports.escapePath=y;exports.getProperty=E;exports.hasProperty=m;exports.setProperty=k;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r=Object.defineProperty;var e=(t,o)=>r(t,"name",{value:o,configurable:!0});function n(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)}e(n,"isPlainObject");module.exports=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var n=Object.defineProperty;var e=(t,o)=>n(t,"name",{value:o,configurable:!0});function i(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)}e(i,"isPlainObject");export{i};
|
|
1
|
+
var n=Object.defineProperty;var e=(t,o)=>n(t,"name",{value:o,configurable:!0});function i(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)}e(i,"isPlainObject");export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var v=Object.defineProperty;var t=(r,e)=>v(r,"name",{value:e,configurable:!0});const s=require("./isPlainObject-BTLAczOE.cjs"),b=require("./paths-are-equal-D8teV-Y-.cjs");var f=Object.defineProperty,y=t((r,e)=>f(r,"name",{value:e,configurable:!0}),"m$1");const u=y((r,e,l="")=>s(r)?Object.entries(r).reduce((a,[n,c])=>{let i=l;return i&&(i+="."),i+=n,e.some(m=>b.c(i,m))?a:s(c)?(a[n]=u(r[n],e,i),a):(a[n]=c,a)},{}):r,"recursiveOmit");var O=Object.defineProperty,o=t((r,e)=>O(r,"name",{value:e,configurable:!0}),"r");const j=o(r=>Array.isArray(r)&&r.length>0,"isFullArray"),p=o((r,e)=>j(e)?u(r,e):r,"omit");module.exports=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var o=(r,e)=>s(r,"name",{value:e,configurable:!0});import c from"./isPlainObject-CFPUbgRS.mjs";import{c as v}from"./paths-are-equal-BgwMgI_D.mjs";var b=Object.defineProperty,p=o((r,e)=>b(r,"name",{value:e,configurable:!0}),"m$1");const m=p((r,e,u="")=>c(r)?Object.entries(r).reduce((a,[n,t])=>{let i=u;return i&&(i+="."),i+=n,e.some(f=>v(i,f))?a:c(t)?(a[n]=m(r[n],e,i),a):(a[n]=t,a)},{}):r,"recursiveOmit");var y=Object.defineProperty,l=o((r,e)=>y(r,"name",{value:e,configurable:!0}),"r");const O=l(r=>Array.isArray(r)&&r.length>0,"isFullArray"),A=l((r,e)=>O(e)?m(r,e):r,"omit");export{A as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var j=Object.defineProperty;var a=(e,r)=>j(e,"name",{value:r,configurable:!0});import s from"./isPlainObject-CFPUbgRS.mjs";import{c as m}from"./paths-are-equal-BgwMgI_D.mjs";var d=Object.defineProperty,y=a((e,r)=>d(e,"name",{value:r,configurable:!0}),"h");const p=y((e,r,f="")=>s(e)?Object.entries(e).reduce((i,[l,c])=>{let t=f;if(t&&(t+="."),t+=l,r.length>0){let n=!1;if(r.forEach(o=>{const v=t.split(".").length,b=o.split(".").length,g=o.split(".").slice(0,v).join("."),h=t.split(".").slice(0,b).join(".");m(h,g)&&(n=!0)}),!n)return i}return s(c)?(i[l]=p(e[l],r,t),i):(i[l]=c,i)},{}):e,"recursivePick");var P=Object.defineProperty,u=a((e,r)=>P(e,"name",{value:r,configurable:!0}),"t");const O=u(e=>Array.isArray(e)&&e.length>0,"isFullArray"),x=u((e,r)=>O(r)?p(e,r):{},"pick");export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var j=Object.defineProperty;var l=(e,r)=>j(e,"name",{value:r,configurable:!0});const u=require("./isPlainObject-BTLAczOE.cjs"),y=require("./paths-are-equal-D8teV-Y-.cjs");var P=Object.defineProperty,d=l((e,r)=>P(e,"name",{value:r,configurable:!0}),"h");const o=d((e,r,f="")=>u(e)?Object.entries(e).reduce((i,[c,a])=>{let t=f;if(t&&(t+="."),t+=c,r.length>0){let n=!1;if(r.forEach(s=>{const h=t.split(".").length,v=s.split(".").length,b=s.split(".").slice(0,h).join("."),g=t.split(".").slice(0,v).join(".");y.c(g,b)&&(n=!0)}),!n)return i}return u(a)?(i[c]=o(e[c],r,t),i):(i[c]=a,i)},{}):e,"recursivePick");var A=Object.defineProperty,p=l((e,r)=>A(e,"name",{value:r,configurable:!0}),"t");const O=p(e=>Array.isArray(e)&&e.length>0,"isFullArray"),q=p((e,r)=>O(r)?o(e,r):{},"pick");module.exports=q;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/object",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Helper functions for working with objects and arrays.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"visulima",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"browser": "./dist/index.mjs",
|
|
66
66
|
"types": "dist/index.d.ts",
|
|
67
67
|
"typesVersions": {
|
|
68
|
-
"
|
|
69
|
-
"
|
|
68
|
+
">=5.0": {
|
|
69
|
+
".": [
|
|
70
70
|
"./dist/index.d.ts"
|
|
71
71
|
]
|
|
72
72
|
}
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
"@anolilab/prettier-config": "^5.0.14",
|
|
82
82
|
"@anolilab/semantic-release-pnpm": "1.1.3",
|
|
83
83
|
"@anolilab/semantic-release-preset": "^9.0.0",
|
|
84
|
-
"@arethetypeswrong/cli": "^0.
|
|
84
|
+
"@arethetypeswrong/cli": "^0.16.2",
|
|
85
85
|
"@babel/core": "^7.25.2",
|
|
86
86
|
"@rushstack/eslint-plugin-security": "^0.8.2",
|
|
87
87
|
"@secretlint/secretlint-rule-preset-recommend": "^8.2.4",
|
|
88
88
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
89
89
|
"@types/node": "18.19.39",
|
|
90
|
-
"@visulima/packem": "^1.0.0-alpha.
|
|
90
|
+
"@visulima/packem": "^1.0.0-alpha.108",
|
|
91
91
|
"@vitest/coverage-v8": "^2.0.5",
|
|
92
92
|
"@vitest/ui": "^2.0.5",
|
|
93
93
|
"conventional-changelog-conventionalcommits": "8.0.0",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"prettier": "^3.3.3",
|
|
108
108
|
"rimraf": "5.0.9",
|
|
109
109
|
"secretlint": "8.2.4",
|
|
110
|
-
"semantic-release": "^24.1.
|
|
111
|
-
"type-fest": "^4.26.
|
|
110
|
+
"semantic-release": "^24.1.1",
|
|
111
|
+
"type-fest": "^4.26.1",
|
|
112
112
|
"typescript": "5.5.4",
|
|
113
113
|
"vitest": "^2.0.5"
|
|
114
114
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var p=Object.defineProperty;var s=(r,t)=>p(r,"name",{value:t,configurable:!0});const f=s(r=>{const t=typeof r;return r!==null&&(t==="object"||t==="function")},"isObject"),u=new Set(["__proto__","prototype","constructor"]),c=new Set("0123456789");function o(r){const t=[];let e="",n="start",i=!1;for(const a of r)switch(a){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(e+=a),n="property",i=!i;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,e+=a;break}if(u.has(e))return[];t.push(e),e="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,e+=a;break}if(n==="property"){if(u.has(e))return[];t.push(e),e=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(e,10)),e="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!c.has(a))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),i&&(i=!1,e+="\\"),e+=a}}switch(i&&(e+="\\"),n){case"property":{if(u.has(e))return[];t.push(e);break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}s(o,"getPathSegments");function l(r,t){if(typeof t!="number"&&Array.isArray(r)){const e=Number.parseInt(t,10);return Number.isInteger(e)&&r[e]===r[t]}return!1}s(l,"isStringIndex");function h(r,t){if(l(r,t))throw new Error("Cannot use string index")}s(h,"assertNotStringIndex");function y(r,t,e){if(!f(r)||typeof t!="string")return e===void 0?r:e;const n=o(t);if(n.length===0)return e;for(let i=0;i<n.length;i++){const a=n[i];if(l(r,a)?r=i===n.length-1?void 0:null:r=r[a],r==null){if(i!==n.length-1)return e;break}}return r===void 0?e:r}s(y,"getProperty");function g(r,t,e){if(!f(r)||typeof t!="string")return r;const n=r,i=o(t);for(let a=0;a<i.length;a++){const d=i[a];h(r,d),a===i.length-1?r[d]=e:f(r[d])||(r[d]=typeof i[a+1]=="number"?[]:{}),r=r[d]}return n}s(g,"setProperty");function w(r,t){if(!f(r)||typeof t!="string")return!1;const e=o(t);for(let n=0;n<e.length;n++){const i=e[n];if(h(r,i),n===e.length-1)return delete r[i],!0;if(r=r[i],!f(r))return!1}}s(w,"deleteProperty");function E(r,t){if(!f(r)||typeof t!="string")return!1;const e=o(t);if(e.length===0)return!1;for(const n of e){if(!f(r)||!(n in r)||l(r,n))return!1;r=r[n]}return!0}s(E,"hasProperty");function I(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replaceAll(/[\\.[]/g,"\\$&")}s(I,"escapePath");export{w as d,I as e,y as g,E as h,g as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var h=Object.defineProperty;var s=(r,t)=>h(r,"name",{value:t,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=s(r=>{const t=typeof r;return r!==null&&(t==="object"||t==="function")},"isObject"),u=new Set(["__proto__","prototype","constructor"]),y=new Set("0123456789");function d(r){const t=[];let n="",e="start",i=!1;for(const a of r)switch(a){case"\\":{if(e==="index")throw new Error("Invalid character in an index");if(e==="indexEnd")throw new Error("Invalid character after an index");i&&(n+=a),e="property",i=!i;break}case".":{if(e==="index")throw new Error("Invalid character in an index");if(e==="indexEnd"){e="property";break}if(i){i=!1,n+=a;break}if(u.has(n))return[];t.push(n),n="",e="property";break}case"[":{if(e==="index")throw new Error("Invalid character in an index");if(e==="indexEnd"){e="index";break}if(i){i=!1,n+=a;break}if(e==="property"){if(u.has(n))return[];t.push(n),n=""}e="index";break}case"]":{if(e==="index"){t.push(Number.parseInt(n,10)),n="",e="indexEnd";break}if(e==="indexEnd")throw new Error("Invalid character after an index")}default:{if(e==="index"&&!y.has(a))throw new Error("Invalid character in an index");if(e==="indexEnd")throw new Error("Invalid character after an index");e==="start"&&(e="property"),i&&(i=!1,n+="\\"),n+=a}}switch(i&&(n+="\\"),e){case"property":{if(u.has(n))return[];t.push(n);break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}s(d,"getPathSegments");function l(r,t){if(typeof t!="number"&&Array.isArray(r)){const n=Number.parseInt(t,10);return Number.isInteger(n)&&r[n]===r[t]}return!1}s(l,"isStringIndex");function p(r,t){if(l(r,t))throw new Error("Cannot use string index")}s(p,"assertNotStringIndex");function c(r,t,n){if(!f(r)||typeof t!="string")return n===void 0?r:n;const e=d(t);if(e.length===0)return n;for(let i=0;i<e.length;i++){const a=e[i];if(l(r,a)?r=i===e.length-1?void 0:null:r=r[a],r==null){if(i!==e.length-1)return n;break}}return r===void 0?n:r}s(c,"getProperty");function g(r,t,n){if(!f(r)||typeof t!="string")return r;const e=r,i=d(t);for(let a=0;a<i.length;a++){const o=i[a];p(r,o),a===i.length-1?r[o]=n:f(r[o])||(r[o]=typeof i[a+1]=="number"?[]:{}),r=r[o]}return e}s(g,"setProperty");function x(r,t){if(!f(r)||typeof t!="string")return!1;const n=d(t);for(let e=0;e<n.length;e++){const i=n[e];if(p(r,i),e===n.length-1)return delete r[i],!0;if(r=r[i],!f(r))return!1}}s(x,"deleteProperty");function w(r,t){if(!f(r)||typeof t!="string")return!1;const n=d(t);if(n.length===0)return!1;for(const e of n){if(!f(r)||!(e in r)||l(r,e))return!1;r=r[e]}return!0}s(w,"hasProperty");function E(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replaceAll(/[\\.[]/g,"\\$&")}s(E,"escapePath");exports.deleteProperty=x;exports.escapePath=E;exports.getProperty=c;exports.hasProperty=w;exports.setProperty=g;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var n=Object.defineProperty;var o=(t,e)=>n(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(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)}o(r,"isPlainObject");exports.isPlainObject=r;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var m=Object.defineProperty;var n=(e,r)=>m(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./isPlainObject-B0tpqX_G.cjs"),v=require("./paths-are-equal-D8teV-Y-.cjs");var O=Object.defineProperty,j=n((e,r)=>O(e,"name",{value:r,configurable:!0}),"m$1");const o=j((e,r,s="")=>l.isPlainObject(e)?Object.entries(e).reduce((a,[t,c])=>{let i=s;return i&&(i+="."),i+=t,r.some(b=>v.c(i,b))?a:l.isPlainObject(c)?(a[t]=o(e[t],r,i),a):(a[t]=c,a)},{}):e,"recursiveOmit");var y=Object.defineProperty,u=n((e,r)=>y(e,"name",{value:r,configurable:!0}),"r");const f=u(e=>Array.isArray(e)&&e.length>0,"isFullArray"),P=u((e,r)=>f(r)?o(e,r):e,"omit");exports.m=P;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s=Object.defineProperty;var o=(r,e)=>s(r,"name",{value:e,configurable:!0});import{i as c}from"./isPlainObject-VVOVbznO.mjs";import{c as v}from"./paths-are-equal-BgwMgI_D.mjs";var b=Object.defineProperty,p=o((r,e)=>b(r,"name",{value:e,configurable:!0}),"m$1");const m=p((r,e,u="")=>c(r)?Object.entries(r).reduce((a,[n,t])=>{let i=u;return i&&(i+="."),i+=n,e.some(f=>v(i,f))?a:c(t)?(a[n]=m(r[n],e,i),a):(a[n]=t,a)},{}):r,"recursiveOmit");var y=Object.defineProperty,l=o((r,e)=>y(r,"name",{value:e,configurable:!0}),"r");const O=l(r=>Array.isArray(r)&&r.length>0,"isFullArray"),A=l((r,e)=>O(e)?m(r,e):r,"omit");export{A as m};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var j=Object.defineProperty;var a=(e,r)=>j(e,"name",{value:r,configurable:!0});import{i as s}from"./isPlainObject-VVOVbznO.mjs";import{c as m}from"./paths-are-equal-BgwMgI_D.mjs";var y=Object.defineProperty,P=a((e,r)=>y(e,"name",{value:r,configurable:!0}),"h");const p=P((e,r,f="")=>s(e)?Object.entries(e).reduce((t,[l,c])=>{let i=f;if(i&&(i+="."),i+=l,r.length>0){let n=!1;if(r.forEach(o=>{const v=i.split(".").length,b=o.split(".").length,g=o.split(".").slice(0,v).join("."),h=i.split(".").slice(0,b).join(".");m(h,g)&&(n=!0)}),!n)return t}return s(c)?(t[l]=p(e[l],r,i),t):(t[l]=c,t)},{}):e,"recursivePick");var d=Object.defineProperty,u=a((e,r)=>d(e,"name",{value:r,configurable:!0}),"t");const O=u(e=>Array.isArray(e)&&e.length>0,"isFullArray"),x=u((e,r)=>O(r)?p(e,r):{},"pick");export{x as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var P=Object.defineProperty;var a=(e,r)=>P(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./isPlainObject-B0tpqX_G.cjs"),h=require("./paths-are-equal-D8teV-Y-.cjs");var y=Object.defineProperty,O=a((e,r)=>y(e,"name",{value:r,configurable:!0}),"h");const o=O((e,r,p="")=>u.isPlainObject(e)?Object.entries(e).reduce((i,[l,c])=>{let t=p;if(t&&(t+="."),t+=l,r.length>0){let n=!1;if(r.forEach(s=>{const j=t.split(".").length,f=s.split(".").length,g=s.split(".").slice(0,j).join("."),v=t.split(".").slice(0,f).join(".");h.c(v,g)&&(n=!0)}),!n)return i}return u.isPlainObject(c)?(i[l]=o(e[l],r,t),i):(i[l]=c,i)},{}):e,"recursivePick");var d=Object.defineProperty,b=a((e,r)=>d(e,"name",{value:r,configurable:!0}),"t");const A=b(e=>Array.isArray(e)&&e.length>0,"isFullArray"),m=b((e,r)=>A(r)?o(e,r):{},"pick");exports.a=m;
|
|
File without changes
|
|
File without changes
|