@visulima/object 1.0.0 → 1.0.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 CHANGED
@@ -1,3 +1,30 @@
1
+ ## @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
+
3
+ ### Bug Fixes
4
+
5
+ * added types support for node10 ([604583f](https://github.com/visulima/visulima/commit/604583fa3c24b950fafad45d17e7a1333040fd76))
6
+
7
+ ### Styles
8
+
9
+ * cs fixes ([f5c4af7](https://github.com/visulima/visulima/commit/f5c4af7cfa9fc79b6d3fa60c1e48d88bffab5a08))
10
+
11
+ ### Miscellaneous Chores
12
+
13
+ * update dev dependencies ([0738f98](https://github.com/visulima/visulima/commit/0738f9810478bb215ce4b2571dc8874c4c503089))
14
+ * updated dev dependencies ([45c2a76](https://github.com/visulima/visulima/commit/45c2a76bc974ecb2c6b172c3af03373d4cc6a5ce))
15
+ * updated dev dependencies ([da46d8e](https://github.com/visulima/visulima/commit/da46d8ef8a964c086060944172f1bd931b7bde9a))
16
+
17
+ ## @visulima/object [1.0.1](https://github.com/visulima/visulima/compare/@visulima/object@1.0.0...@visulima/object@1.0.1) (2024-08-01)
18
+
19
+ ### Bug Fixes
20
+
21
+ * upgraded @visulima/packem ([dc0cb57](https://github.com/visulima/visulima/commit/dc0cb5701b30f3f81404346c909fd4daf891b894))
22
+
23
+ ### Miscellaneous Chores
24
+
25
+ * updated dev dependencies ([ac67ec1](https://github.com/visulima/visulima/commit/ac67ec1bcba16175d225958e318199f60b10d179))
26
+ * updated dev dependencies and sorted the package.json ([9571572](https://github.com/visulima/visulima/commit/95715725a8ed053ca24fd1405a55205c79342ecb))
27
+
1
28
  ## @visulima/object 1.0.0 (2024-07-16)
2
29
 
3
30
  ### Features
package/LICENSE.md CHANGED
@@ -40,13 +40,13 @@ By: Sindre Sorhus
40
40
  Repository: sindresorhus/dot-prop
41
41
 
42
42
  > MIT License
43
- >
43
+ >
44
44
  > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
45
- >
45
+ >
46
46
  > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
47
- >
47
+ >
48
48
  > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
49
- >
49
+ >
50
50
  > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
51
51
 
52
52
  ---------------------------------------
@@ -57,13 +57,13 @@ By: Sindre Sorhus
57
57
  Repository: sindresorhus/is-plain-obj
58
58
 
59
59
  > MIT License
60
- >
60
+ >
61
61
  > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
62
- >
62
+ >
63
63
  > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
64
- >
64
+ >
65
65
  > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
66
- >
66
+ >
67
67
  > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
68
68
 
69
69
  <!-- DEPENDENCIES -->
@@ -88,13 +88,13 @@ By: Sindre Sorhus
88
88
  Repository: sindresorhus/dot-prop
89
89
 
90
90
  > MIT License
91
- >
91
+ >
92
92
  > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
93
- >
93
+ >
94
94
  > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
95
- >
95
+ >
96
96
  > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
97
- >
97
+ >
98
98
  > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
99
99
 
100
100
  ---------------------------------------
@@ -105,13 +105,13 @@ By: Sindre Sorhus
105
105
  Repository: sindresorhus/is-plain-obj
106
106
 
107
107
  > MIT License
108
- >
108
+ >
109
109
  > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
110
- >
110
+ >
111
111
  > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
112
- >
112
+ >
113
113
  > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
114
- >
114
+ >
115
115
  > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
116
116
 
117
117
  ---------------------------------------
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var M=Object.defineProperty;var u=(e,r)=>M(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function w(e){if(typeof e!="object"||e===null)return!1;const r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}u(w,"isPlainObject");var F=Object.defineProperty,L=u((e,r)=>F(e,"name",{value:r,configurable:!0}),"n$1");const S=L((e,r)=>{const t=r.split(".");return e.split(".").reduce((n,a,o)=>{const l=t[o]==="*"?"*":a;return n.push(l),n},[]).join(".")===r},"pathsAreEqual");var q=Object.defineProperty,R=u((e,r)=>q(e,"name",{value:r,configurable:!0}),"m$2");const k=R((e,r,t="")=>w(e)?Object.entries(e).reduce((n,[a,o])=>{let l=t;return l&&(l+="."),l+=a,r.some(g=>S(l,g))?n:w(o)?(n[a]=k(e[a],r,l),n):(n[a]=o,n)},{}):e,"recursiveOmit");var B=Object.defineProperty,D=u((e,r)=>B(e,"name",{value:r,configurable:!0}),"r");const K=D(e=>Array.isArray(e)&&e.length>0,"isFullArray"),W=D((e,r)=>K(r)?k(e,r):e,"omit"),C=W;var G=Object.defineProperty,z=u((e,r)=>G(e,"name",{value:r,configurable:!0}),"h");const T=z((e,r,t="")=>w(e)?Object.entries(e).reduce((n,[a,o])=>{let l=t;if(l&&(l+="."),l+=a,r.length>0){let g=!1;if(r.forEach(O=>{const _=l.split(".").length,x=O.split(".").length,m=O.split(".").slice(0,_).join("."),A=l.split(".").slice(0,x).join(".");S(A,m)&&(g=!0)}),!g)return n}return w(o)?(n[a]=T(e[a],r,l),n):(n[a]=o,n)},{}):e,"recursivePick");var H=Object.defineProperty,$=u((e,r)=>H(e,"name",{value:r,configurable:!0}),"t");const J=$(e=>Array.isArray(e)&&e.length>0,"isFullArray"),Q=$((e,r)=>J(r)?T(e,r):{},"pick"),U=Q;var p=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},E={},y={};Object.defineProperty(y,"__esModule",{value:!0});y.isDocumentToRecurOn=y.flatten=y.unique=void 0;function V(e){return[...new Set(e)]}u(V,"unique");y.unique=V;function X(e){return[].concat(...e)}u(X,"flatten");y.flatten=X;function Y(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.keys(e).length}u(Y,"isDocumentToRecurOn");y.isDocumentToRecurOn=Y;var N={};Object.defineProperty(N,"__esModule",{value:!0});(function(e){var r=p&&p.__createBinding||(Object.create?function(s,i,f,d){d===void 0&&(d=f);var c=Object.getOwnPropertyDescriptor(i,f);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:u(function(){return i[f]},"get")}),Object.defineProperty(s,d,c)}:function(s,i,f,d){d===void 0&&(d=f),s[d]=i[f]}),t=p&&p.__setModuleDefault||(Object.create?function(s,i){Object.defineProperty(s,"default",{enumerable:!0,value:i})}:function(s,i){s.default=i}),n=p&&p.__importStar||function(s){if(s&&s.__esModule)return s;var i={};if(s!=null)for(var f in s)f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)&&r(i,s,f);return t(i,s),i},a=p&&p.__exportStar||function(s,i){for(var f in s)f!=="default"&&!Object.prototype.hasOwnProperty.call(i,f)&&r(i,s,f)};Object.defineProperty(e,"__esModule",{value:!0}),e.deepKeysFromList=e.deepKeys=void 0;const o=n(y);a(N,e);function l(s,i){const f=A(i);return typeof s=="object"&&s!==null?O("",s,f):[]}u(l,"deepKeys"),e.deepKeys=l;function g(s,i){const f=A(i);return s.map(d=>typeof d=="object"&&d!==null?l(d,f):[])}u(g,"deepKeysFromList"),e.deepKeysFromList=g;function O(s,i,f){const d=Object.keys(i).map(c=>{const b=m(s,x(c,f));return f.expandNestedObjects&&o.isDocumentToRecurOn(i[c])||f.arrayIndexesAsKeys&&Array.isArray(i[c])&&i[c].length?O(b,i[c],f):f.expandArrayObjects&&Array.isArray(i[c])?_(i[c],b,f):f.ignoreEmptyArrays&&Array.isArray(i[c])&&!i[c].length?[]:b});return o.flatten(d)}u(O,"generateDeepKeysList");function _(s,i,f){let d=g(s,f);return s.length?s.length&&o.flatten(d).length===0?[i]:(d=d.map(c=>Array.isArray(c)&&c.length===0?[i]:c.map(b=>m(i,x(b,f)))),o.unique(o.flatten(d))):f.ignoreEmptyArraysWhenExpanding?[]:[i]}u(_,"processArrayKeys");function x(s,i){return i.escapeNestedDots?s.replace(/\./g,"\\."):s}u(x,"escapeNestedDotsIfSpecified");function m(s,i){return s?s+"."+i:i}u(m,"buildKeyName");function A(s){return{arrayIndexesAsKeys:!1,expandNestedObjects:!0,expandArrayObjects:!1,ignoreEmptyArraysWhenExpanding:!1,escapeNestedDots:!1,ignoreEmptyArrays:!1,...s??{}}}u(A,"mergeOptions")})(E);const h=u(e=>{const r=typeof e;return e!==null&&(r==="object"||r==="function")},"isObject"),P=new Set(["__proto__","prototype","constructor"]),Z=new Set("0123456789");function v(e){const r=[];let t="",n="start",a=!1;for(const o of e)switch(o){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");a&&(t+=o),n="property",a=!a;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(a){a=!1,t+=o;break}if(P.has(t))return[];r.push(t),t="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(a){a=!1,t+=o;break}if(n==="property"){if(P.has(t))return[];r.push(t),t=""}n="index";break}case"]":{if(n==="index"){r.push(Number.parseInt(t,10)),t="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Z.has(o))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),a&&(a=!1,t+="\\"),t+=o}}switch(a&&(t+="\\"),n){case"property":{if(P.has(t))return[];r.push(t);break}case"index":throw new Error("Index was not closed");case"start":{r.push("");break}}return r}u(v,"getPathSegments");function I(e,r){if(typeof r!="number"&&Array.isArray(e)){const t=Number.parseInt(r,10);return Number.isInteger(t)&&e[t]===e[r]}return!1}u(I,"isStringIndex");function j(e,r){if(I(e,r))throw new Error("Cannot use string index")}u(j,"assertNotStringIndex");function ee(e,r,t){if(!h(e)||typeof r!="string")return t===void 0?e:t;const n=v(r);if(n.length===0)return t;for(let a=0;a<n.length;a++){const o=n[a];if(I(e,o)?e=a===n.length-1?void 0:null:e=e[o],e==null){if(a!==n.length-1)return t;break}}return e===void 0?t:e}u(ee,"getProperty");function re(e,r,t){if(!h(e)||typeof r!="string")return e;const n=e,a=v(r);for(let o=0;o<a.length;o++){const l=a[o];j(e,l),o===a.length-1?e[l]=t:h(e[l])||(e[l]=typeof a[o+1]=="number"?[]:{}),e=e[l]}return n}u(re,"setProperty");function ne(e,r){if(!h(e)||typeof r!="string")return!1;const t=v(r);for(let n=0;n<t.length;n++){const a=t[n];if(j(e,a),n===t.length-1)return delete e[a],!0;if(e=e[a],!h(e))return!1}}u(ne,"deleteProperty");function te(e,r){if(!h(e)||typeof r!="string")return!1;const t=v(r);if(t.length===0)return!1;for(const n of t){if(!h(e)||!(n in e)||I(e,n))return!1;e=e[n]}return!0}u(te,"hasProperty");function ie(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replaceAll(/[\\.[]/g,"\\$&")}u(ie,"escapePath");exports.deepKeys=E.deepKeys;exports.deepKeysFromList=E.deepKeysFromList;exports.deleteProperty=ne;exports.escapePath=ie;exports.getProperty=ee;exports.hasProperty=te;exports.isPlainObject=w;exports.omit=C;exports.pick=U;exports.setProperty=re;
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("./shared/omit-BTcVGp-C.cjs"),q=require("./shared/pick-Dc4jbs2q.cjs"),c=require("./shared/getProperty-CFmO4UX4.cjs"),M=require("./shared/isPlainObject-B0tpqX_G.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?g("",r,t):[]}u(d,"deepKeys"),s.deepKeys=d;function b(r,e){const t=j(e);return r.map(i=>typeof i=="object"&&i!==null?d(i,t):[])}u(b,"deepKeysFromList"),s.deepKeysFromList=b;function g(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?g(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(g,"generateDeepKeysList");function h(r,e,t){let i=b(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.m;exports.pick=q.a;exports.deleteProperty=c.deleteProperty;exports.escapePath=c.escapePath;exports.getProperty=c.getProperty;exports.hasProperty=c.hasProperty;exports.setProperty=c.setProperty;exports.isPlainObject=M.isPlainObject;exports.deepKeys=y.deepKeys;exports.deepKeysFromList=y.deepKeysFromList;