@visulima/object 2.0.1 → 2.0.3

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,27 @@
1
+ ## @visulima/object [2.0.3](https://github.com/visulima/visulima/compare/@visulima/object@2.0.2...@visulima/object@2.0.3) (2025-11-12)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **deps:** update type-fest dependency across multiple packages ([93e13be](https://github.com/visulima/visulima/commit/93e13be5248207968a96303710db2a0604d16b9b))
6
+ * update package configurations and TypeScript definitions ([b59aa59](https://github.com/visulima/visulima/commit/b59aa59dac1508216b944f4b917fb4a7ab1f70a4))
7
+
8
+ ### Miscellaneous Chores
9
+
10
+ * Add jsr file to all packages for release ([#565](https://github.com/visulima/visulima/issues/565)) ([ec91652](https://github.com/visulima/visulima/commit/ec91652b4e4112adf14ba152c1239a7703ba425a))
11
+ * update license files and clean up TypeScript definitions ([fe668cc](https://github.com/visulima/visulima/commit/fe668cc26de23591d4df54a0954455ebbe31b22d))
12
+ * update npm and pnpm configurations for monorepo optimization ([#564](https://github.com/visulima/visulima/issues/564)) ([5512b42](https://github.com/visulima/visulima/commit/5512b42f672c216b6a3c9e39035199a4ebd9a4b8))
13
+
14
+ ## @visulima/object [2.0.2](https://github.com/visulima/visulima/compare/@visulima/object@2.0.1...@visulima/object@2.0.2) (2025-11-05)
15
+
16
+ ### Bug Fixes
17
+
18
+ * update dependencies across multiple packages ([36a47f2](https://github.com/visulima/visulima/commit/36a47f26d65d25a7b4d8371186710e7d0ab61a2b))
19
+ * Upgraded `type-fest` to version `5.2.0` ([bd6cd53](https://github.com/visulima/visulima/commit/bd6cd5367ff102a7487372dc1ca7742a41c69ea9))
20
+
21
+ ### Miscellaneous Chores
22
+
23
+ * update package dependencies and configurations ([7bfe7e7](https://github.com/visulima/visulima/commit/7bfe7e71869580900aab50efb064b4293994ed9a))
24
+
1
25
  ## @visulima/object [2.0.1](https://github.com/visulima/visulima/compare/@visulima/object@2.0.0...@visulima/object@2.0.1) (2025-10-21)
2
26
 
3
27
  ### Bug Fixes
@@ -19,7 +43,7 @@
19
43
  ### Bug Fixes
20
44
 
21
45
  * Adjusted the node engine requirement to support versions 20.19 and above ([6773ae4](https://github.com/visulima/visulima/commit/6773ae42e12453389298dea329016a8b30e8cfe8))
22
- * update @visulima/packem to 2.0.0-alpha.30 across multiple packages for improved compatibility ([27b346e](https://github.com/visulima/visulima/commit/27b346eaa1c0fb0e420d9a9824482028307f4249))
46
+ * update @visulima/packem to 2.0.0-alpha.32 across multiple packages for improved compatibility ([27b346e](https://github.com/visulima/visulima/commit/27b346eaa1c0fb0e420d9a9824482028307f4249))
23
47
 
24
48
  ### Miscellaneous Chores
25
49
 
package/LICENSE.md CHANGED
@@ -71,18 +71,22 @@ Repository: sindresorhus/is-plain-obj
71
71
  <!-- TYPE_DEPENDENCIES -->
72
72
 
73
73
  # Licenses of bundled types
74
+
74
75
  The published @visulima/object artifact additionally contains code with the following licenses:
75
76
  MIT
76
77
 
77
78
  # Bundled types:
79
+
78
80
  ## deeks
81
+
79
82
  License: MIT
80
83
  By: mrodrig
81
84
  Repository: git+https://github.com/mrodrig/deeks.git
82
85
 
83
- ---------------------------------------
86
+ ---
84
87
 
85
88
  ## dot-prop
89
+
86
90
  License: MIT
87
91
  By: Sindre Sorhus
88
92
  Repository: sindresorhus/dot-prop
@@ -97,9 +101,10 @@ Repository: sindresorhus/dot-prop
97
101
  >
98
102
  > 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
103
 
100
- ---------------------------------------
104
+ ---
101
105
 
102
106
  ## is-plain-obj
107
+
103
108
  License: MIT
104
109
  By: Sindre Sorhus
105
110
  Repository: sindresorhus/is-plain-obj
package/dist/index.d.ts CHANGED
@@ -1,216 +1,7 @@
1
- import { Paths, OmitDeep, PickDeep, Get } from 'type-fest';
2
- export { OmitDeep, Paths, PickDeep, Split } from 'type-fest';
3
-
4
- declare const omit: <T extends { [key in string]: unknown; }, K extends string>(object: T, keys: Paths<T>[]) => OmitDeep<T, K>;
5
-
6
- declare const pick: <T extends { [key in string]: unknown; }, K extends Paths<T>>(object: T, keys: Paths<T>[]) => PickDeep<T, K>;
7
-
8
- interface DeeksOptions {
9
- /** @default false */
10
- arrayIndexesAsKeys?: boolean;
11
- /** @default true */
12
- expandNestedObjects?: boolean;
13
- /** @default false */
14
- expandArrayObjects?: boolean;
15
- /** @default false */
16
- ignoreEmptyArraysWhenExpanding?: boolean;
17
- /** @default false */
18
- escapeNestedDots?: boolean;
19
- /** @default false */
20
- ignoreEmptyArrays?: boolean;
21
- }
22
-
23
- /**
24
- * Return the deep keys list for a single document
25
- * @param object
26
- * @param options
27
- * @returns {Array}
28
- */
29
- declare function deepKeys(object: object, options?: DeeksOptions): string[];
30
- /**
31
- * Return the deep keys list for all documents in the provided list
32
- * @param list
33
- * @param options
34
- * @returns Array[Array[String]]
35
- */
36
- declare function deepKeysFromList(list: object[], options?: DeeksOptions): string[][];
37
-
38
- /**
39
- Get the value of the property at the given path.
40
-
41
- @param object - Object or array to get the `path` value.
42
- @param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key. Array indices can be accessed using bracket notation (`'users[0].name'`) or dot notation (`'users.0.name'`). Both syntaxes are equivalent and will create arrays when setting values. Numeric strings in dot notation (like `'users.0.name'`) are automatically coerced to numbers. When using array paths, numeric strings are normalized to numbers for simplicity (treating `['users', '0']` the same as `['users', 0]`).
43
- @param defaultValue - Default value.
44
-
45
- @example
46
- ```
47
- import {getProperty} from 'dot-prop';
48
-
49
- getProperty({foo: {bar: 'unicorn'}}, 'foo.bar');
50
- //=> 'unicorn'
51
-
52
- getProperty({foo: {bar: 'a'}}, 'foo.notDefined.deep');
53
- //=> undefined
54
-
55
- getProperty({foo: {bar: 'a'}}, 'foo.notDefined.deep', 'default value');
56
- //=> 'default value'
57
-
58
- getProperty({foo: {'dot.dot': 'unicorn'}}, 'foo.dot\\.dot');
59
- //=> 'unicorn'
60
-
61
- getProperty({foo: [{bar: 'unicorn'}]}, 'foo[0].bar');
62
- //=> 'unicorn'
63
-
64
- getProperty({foo: [{bar: 'unicorn'}]}, 'foo.0.bar');
65
- //=> 'unicorn'
66
- ```
67
- */
68
- declare function getProperty<ObjectType, PathType extends string, DefaultValue = undefined>(
69
- object: ObjectType,
70
- path: PathType | ReadonlyArray<string | number>,
71
- defaultValue?: DefaultValue
72
- ): ObjectType extends Record<string, unknown> | unknown[]
73
- ? (unknown extends Get<ObjectType, PathType> ? DefaultValue : Get<ObjectType, PathType>)
74
- : DefaultValue extends undefined ? unknown : DefaultValue;
75
-
76
- /**
77
- Set the property at the given path to the given value.
78
-
79
- @param object - Object or array to set the `path` value.
80
- @param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key. Array indices can be accessed using bracket notation (`'users[0].name'`) or dot notation (`'users.0.name'`). Both syntaxes are equivalent and will create arrays when setting values. Numeric strings in dot notation (like `'users.0.name'`) are automatically coerced to numbers. When using array paths, numeric strings are normalized to numbers for simplicity (treating `['users', '0']` the same as `['users', 0]`).
81
- @param value - Value to set at `path`.
82
- @returns The object.
83
-
84
- @example
85
- ```
86
- import {setProperty} from 'dot-prop';
87
-
88
- const object = {foo: {bar: 'a'}};
89
- setProperty(object, 'foo.bar', 'b');
90
- console.log(object);
91
- //=> {foo: {bar: 'b'}}
92
-
93
- const foo = setProperty({}, 'foo.bar', 'c');
94
- console.log(foo);
95
- //=> {foo: {bar: 'c'}}
96
-
97
- setProperty(object, 'foo.baz', 'x');
98
- console.log(object);
99
- //=> {foo: {bar: 'b', baz: 'x'}}
100
-
101
- setProperty(object, 'foo.biz[0]', 'a');
102
- console.log(object);
103
- //=> {foo: {bar: 'b', baz: 'x', biz: ['a']}}
104
-
105
- setProperty(object, 'foo.items.0', 'first');
106
- console.log(object);
107
- //=> {foo: {bar: 'b', baz: 'x', biz: ['a'], items: ['first']}}
108
- ```
109
- */
110
- declare function setProperty<ObjectType extends (Record<string, any> | unknown[])>(
111
- object: ObjectType,
112
- path: string | ReadonlyArray<string | number>,
113
- value: unknown
114
- ): ObjectType;
115
-
116
- /**
117
- Check whether the property at the given path exists.
118
-
119
- @param object - Object or array to test the `path` value.
120
- @param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key. Array indices can be accessed using bracket notation (`'users[0].name'`) or dot notation (`'users.0.name'`). Both syntaxes are equivalent and will create arrays when setting values. Numeric strings in dot notation (like `'users.0.name'`) are automatically coerced to numbers. When using array paths, numeric strings are normalized to numbers for simplicity (treating `['users', '0']` the same as `['users', 0]`).
121
-
122
- @example
123
- ```
124
- import {hasProperty} from 'dot-prop';
125
-
126
- hasProperty({foo: {bar: 'unicorn'}}, 'foo.bar');
127
- //=> true
128
- ```
129
- */
130
- declare function hasProperty(object: Record<string, any> | unknown[] | undefined, path: string | ReadonlyArray<string | number>): boolean;
131
-
132
- /**
133
- Delete the property at the given path.
134
-
135
- @param object - Object or array to delete the `path` value.
136
- @param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key. Array indices can be accessed using bracket notation (`'users[0].name'`) or dot notation (`'users.0.name'`). Both syntaxes are equivalent and will create arrays when setting values. Numeric strings in dot notation (like `'users.0.name'`) are automatically coerced to numbers. When using array paths, numeric strings are normalized to numbers for simplicity (treating `['users', '0']` the same as `['users', 0]`).
137
- @returns A boolean of whether the property existed before being deleted.
138
-
139
- @example
140
- ```
141
- import {deleteProperty} from 'dot-prop';
142
-
143
- const object = {foo: {bar: 'a'}};
144
- deleteProperty(object, 'foo.bar');
145
- console.log(object);
146
- //=> {foo: {}}
147
-
148
- object.foo.bar = {x: 'y', y: 'x'};
149
- deleteProperty(object, 'foo.bar.x');
150
- console.log(object);
151
- //=> {foo: {bar: {y: 'x'}}}
152
- ```
153
- */
154
- declare function deleteProperty(object: Record<string, any> | unknown[], path: string | ReadonlyArray<string | number>): boolean;
155
-
156
- /**
157
- Escape special characters in a path. Useful for sanitizing user input.
158
-
159
- @param path - The dot path to sanitize.
160
-
161
- @example
162
- ```
163
- import {getProperty, escapePath} from 'dot-prop';
164
-
165
- const object = {
166
- foo: {
167
- bar: '👸🏻 You found me Mario!',
168
- },
169
- 'foo.bar' : '🍄 The princess is in another castle!',
170
- };
171
- const escapedPath = escapePath('foo.bar');
172
-
173
- console.log(getProperty(object, escapedPath));
174
- //=> '🍄 The princess is in another castle!'
175
- ```
176
- */
177
- declare function escapePath(path: string): string;
178
-
179
- /**
180
- Check if a value is a plain object.
181
-
182
- An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`.
183
-
184
- @example
185
- ```
186
- import isPlainObject from 'is-plain-obj';
187
- import {runInNewContext} from 'node:vm';
188
-
189
- isPlainObject({foo: 'bar'});
190
- //=> true
191
-
192
- isPlainObject(new Object());
193
- //=> true
194
-
195
- isPlainObject(Object.create(null));
196
- //=> true
197
-
198
- // This works across realms
199
- isPlainObject(runInNewContext('({})'));
200
- //=> true
201
-
202
- isPlainObject([1, 2, 3]);
203
- //=> false
204
-
205
- class Unicorn {}
206
- isPlainObject(new Unicorn());
207
- //=> false
208
-
209
- isPlainObject(Math);
210
- //=> false
211
- ```
212
- */
213
- declare function isPlainObject<Value>(value: unknown): value is Record<PropertyKey, Value>;
214
-
215
- export { deepKeys, deepKeysFromList, deleteProperty, escapePath, getProperty, hasProperty, isPlainObject, omit, pick, setProperty };
216
- export type { DeeksOptions as DeepKeysOptions };
1
+ export { default as omit } from "./omit.d.ts";
2
+ export { default as pick } from "./pick.d.ts";
3
+ export type { DeeksOptions as DeepKeysOptions } from "deeks";
4
+ export { deepKeys, deepKeysFromList } from "deeks";
5
+ export { deleteProperty, escapePath, getProperty, hasProperty, setProperty } from "dot-prop";
6
+ export { default as isPlainObject } from "is-plain-obj";
7
+ export type { OmitDeep, Paths, PickDeep, Split } from "type-fest";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var L=Object.defineProperty;var u=(c,p)=>L(c,"name",{value:p,configurable:!0});import{default as w}from"./packem_shared/omit-BfV-sPAM.js";import{default as B}from"./packem_shared/pick-CT4qE7de.js";import{deleteProperty as W,escapePath as z,getProperty as C,hasProperty as G,setProperty as H}from"./packem_shared/getProperty-DPNB_aKG.js";import{default as Q}from"./packem_shared/isPlainObject-CLTs8VdF.js";var i={},f={},D;function N(){if(D)return f;D=1;var c=Object.defineProperty,p=u((o,b)=>c(o,"name",{value:b,configurable:!0}),"t");Object.defineProperty(f,"__esModule",{value:!0}),f.isDocumentToRecurOn=f.flatten=f.unique=void 0;function s(o){return[...new Set(o)]}u(s,"unique"),p(s,"unique"),f.unique=s;function l(o){return[].concat(...o)}u(l,"flatten"),p(l,"flatten"),f.flatten=l;function m(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.keys(o).length}return u(m,"isDocumentToRecurOn"),p(m,"isDocumentToRecurOn"),f.isDocumentToRecurOn=m,f}u(N,"requireUtils");var K={},P;function R(){return P||(P=1,Object.defineProperty(K,"__esModule",{value:!0})),K}u(R,"requireTypes");var q;function k(){return q||(q=1,(function(c){var p=Object.defineProperty,s=u((t,e)=>p(t,"name",{value:e,configurable:!0}),"i"),l=i&&i.__createBinding||(Object.create?(function(t,e,r,a){a===void 0&&(a=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:s(function(){return e[r]},"get")}),Object.defineProperty(t,a,n)}):(function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]})),m=i&&i.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),o=i&&i.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&l(e,t,r);return m(e,t),e},b=i&&i.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&l(e,t,r)};Object.defineProperty(c,"__esModule",{value:!0}),c.deepKeysFromList=c.deepKeys=void 0;const y=o(N());b(R(),c);function O(t,e){const r=A(e);return typeof t=="object"&&t!==null?v("",t,r):[]}u(O,"deepKeys"),s(O,"deepKeys"),c.deepKeys=O;function g(t,e){const r=A(e);return t.map(a=>typeof a=="object"&&a!==null?O(a,r):[])}u(g,"deepKeysFromList"),s(g,"deepKeysFromList"),c.deepKeysFromList=g;function v(t,e,r){const a=Object.keys(e).map(n=>{const d=j(t,_(n,r));return r.expandNestedObjects&&y.isDocumentToRecurOn(e[n])||r.arrayIndexesAsKeys&&Array.isArray(e[n])&&e[n].length?v(d,e[n],r):r.expandArrayObjects&&Array.isArray(e[n])?h(e[n],d,r):r.ignoreEmptyArrays&&Array.isArray(e[n])&&!e[n].length?[]:d});return y.flatten(a)}u(v,"generateDeepKeysList"),s(v,"generateDeepKeysList");function h(t,e,r){let a=g(t,r);return t.length?t.length&&y.flatten(a).length===0?[e]:(a=a.map(n=>Array.isArray(n)&&n.length===0?[e]:n.map(d=>j(e,_(d,r)))),y.unique(y.flatten(a))):r.ignoreEmptyArraysWhenExpanding?[]:[e]}u(h,"processArrayKeys"),s(h,"processArrayKeys");function _(t,e){return e.escapeNestedDots?t.replace(/\./g,"\\."):t}u(_,"escapeNestedDotsIfSpecified"),s(_,"escapeNestedDotsIfSpecified");function j(t,e){return t?t+"."+e:e}u(j,"buildKeyName"),s(j,"buildKeyName");function A(t){return{arrayIndexesAsKeys:!1,expandNestedObjects:!0,expandArrayObjects:!1,ignoreEmptyArraysWhenExpanding:!1,escapeNestedDots:!1,ignoreEmptyArrays:!1,...t??{}}}u(A,"mergeOptions"),s(A,"mergeOptions")})(i)),i}u(k,"requireDeeks");var x=k();const M=x.deepKeys,S=x.deepKeysFromList;export{M as deepKeys,S as deepKeysFromList,W as deleteProperty,z as escapePath,C as getProperty,G as hasProperty,Q as isPlainObject,w as omit,B as pick,H as setProperty};
1
+ var F=Object.defineProperty;var s=(y,d)=>F(y,"name",{value:d,configurable:!0});import{default as J}from"./packem_shared/omit-BfV-sPAM.js";import{default as V}from"./packem_shared/pick-CT4qE7de.js";import{deleteProperty as Y,escapePath as Z,getProperty as $,hasProperty as ee,setProperty as te}from"./packem_shared/getProperty-DPNB_aKG.js";import{default as ne}from"./packem_shared/isPlainObject-CLTs8VdF.js";var c={},p={},w;function I(){if(w)return p;w=1;var y=Object.defineProperty,d=s((u,K)=>y(u,"name",{value:K,configurable:!0}),"t");Object.defineProperty(p,"__esModule",{value:!0}),p.isDocumentToRecurOn=p.flatten=p.unique=void 0;function i(u){return[...new Set(u)]}s(i,"unique"),d(i,"unique"),p.unique=i;function m(u){return[].concat(...u)}s(m,"flatten"),d(m,"flatten"),p.flatten=m;function j(u){return typeof u=="object"&&u!==null&&!Array.isArray(u)&&Object.keys(u).length}return s(j,"isDocumentToRecurOn"),d(j,"isDocumentToRecurOn"),p.isDocumentToRecurOn=j,p}s(I,"requireUtils");var x={},E;function W(){return E||(E=1,Object.defineProperty(x,"__esModule",{value:!0})),x}s(W,"requireTypes");var M;function B(){return M||(M=1,(function(y){var d=Object.defineProperty,i=s((e,t)=>d(e,"name",{value:t,configurable:!0}),"u"),m=c&&c.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:i(function(){return t[r]},"get")}),Object.defineProperty(e,n,a)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),j=c&&c.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),u=c&&c.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&m(t,e,r);return j(t,e),t},K=c&&c.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&m(t,e,r)};Object.defineProperty(y,"__esModule",{value:!0}),y.deepKeysFromList=y.deepKeys=void 0;const O=u(I());K(W(),y);function S(e,t){const r=q(t);return typeof e=="object"&&e!==null?k("",e,r,new WeakSet):[]}s(S,"deepKeys"),i(S,"deepKeys"),y.deepKeys=S;function P(e,t,r){const n=q(t),a=r??new WeakSet;return e.map(f=>typeof f=="object"&&f!==null?a.has(f)?[]:k("",f,n,a):[])}s(P,"deepKeysFromList"),i(P,"deepKeysFromList"),y.deepKeysFromList=P;function k(e,t,r,n){const a=[],f=Object.keys(t);n.add(t);const l=[{obj:t,keys:f,i:0,basePath:e}];for(;l.length;){const g=l[l.length-1];if(g.i>=g.keys.length){l.pop();continue}const N=g.keys[g.i++],o=g.obj[N],_=v(g.basePath,D(N,r));if(r.expandNestedObjects&&O.isDocumentToRecurOn(o)||r.arrayIndexesAsKeys&&Array.isArray(o)&&o.length)if(r.arrayIndexesAsKeys&&Array.isArray(o)){const A=o;for(let h=A.length-1;h>=0;h--){const b=A[h],R=v(_,String(h));typeof b=="object"&&b!==null&&!Array.isArray(b)?n.has(b)||(n.add(b),l.push({obj:b,keys:Object.keys(b),i:0,basePath:R})):a.push(R)}}else n.has(o)||(n.add(o),l.push({obj:o,keys:Object.keys(o),i:0,basePath:_}));else if(r.expandArrayObjects&&Array.isArray(o)){const A=L(o,_,r,n);for(const h of A)a.push(h)}else{if(r.ignoreEmptyArrays&&Array.isArray(o)&&!o.length)continue;a.push(_)}}return O.unique(a)}s(k,"generateDeepKeysList"),i(k,"generateDeepKeysList");function L(e,t,r,n){let a=P(e,r,n);return e.length?e.length&&O.flatten(a).length===0?[t]:(a=a.map(f=>Array.isArray(f)&&f.length===0?[t]:f.map(l=>v(t,D(l,r)))),O.unique(O.flatten(a))):r.ignoreEmptyArraysWhenExpanding?[]:[t]}s(L,"processArrayKeys"),i(L,"processArrayKeys");function D(e,t){return t.escapeNestedDots?e.replace(/\./g,"\\."):e}s(D,"escapeNestedDotsIfSpecified"),i(D,"escapeNestedDotsIfSpecified");function v(e,t){return e?e+"."+t:t}s(v,"buildKeyName"),i(v,"buildKeyName");function q(e){return{arrayIndexesAsKeys:!1,expandNestedObjects:!0,expandArrayObjects:!1,ignoreEmptyArraysWhenExpanding:!1,escapeNestedDots:!1,ignoreEmptyArrays:!1,...e??{}}}s(q,"mergeOptions"),i(q,"mergeOptions")})(c)),c}s(B,"requireDeeks");var T=B();const z=T.deepKeys,C=T.deepKeysFromList;export{z as deepKeys,C as deepKeysFromList,Y as deleteProperty,Z as escapePath,$ as getProperty,ee as hasProperty,ne as isPlainObject,J as omit,V as pick,te as setProperty};
package/dist/omit.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Modified copy of https://github.com/mesqueeb/filter-anything/blob/main/src/index.ts
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2018 Luca Ban - Mesqueeb
7
+ */
8
+ import type { OmitDeep, Paths } from "type-fest";
9
+ /**
10
+ * Omit returns a new object without the props you omit.
11
+ * @template T
12
+ * @template K
13
+ * @param object the target object to omit props from
14
+ * @param keys the prop names you want to omit
15
+ * @returns a new object without the omitted props
16
+ */
17
+ declare const omit: <T extends { [key in string]: unknown; }, K extends string>(object: T, keys: Paths<T>[]) => OmitDeep<T, K>;
18
+ export default omit;
package/dist/pick.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Modified copy of https://github.com/mesqueeb/filter-anything/blob/main/src/index.ts
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2018 Luca Ban - Mesqueeb
7
+ */
8
+ import type { Paths, PickDeep } from "type-fest";
9
+ /**
10
+ * Pick returns a new object with only the props you pick.
11
+ * @template T
12
+ * @template K
13
+ * @param object the target object to pick props from
14
+ * @param keys an array of prop names you want to keep - allows dot-notation for nested props, eg. `nested.prop` will keep just `{ nested: { prop: 1 } }`
15
+ * @returns a new object with just the picked props
16
+ */
17
+ declare const pick: <T extends { [key in string]: unknown; }, K extends Paths<T>>(object: T, keys: Paths<T>[]) => PickDeep<T, K>;
18
+ export default pick;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Modified copy of https://github.com/mesqueeb/filter-anything/blob/main/src/pathsAreEqual.ts
3
+ *
4
+ * MIT License
5
+ *
6
+ * Copyright (c) 2018 Luca Ban - Mesqueeb
7
+ */
8
+ /**
9
+ * PathsAreEqual returns true if the path and wildcardPath are equal.
10
+ * @param path The path to compare
11
+ * @param wildcardPath The wildcard path to compare
12
+ * @returns True if the path and wildcardPath are equal, false otherwise.
13
+ */
14
+ declare const pathsAreEqual: (path: string, wildcardPath: string) => boolean;
15
+ export default pathsAreEqual;
@@ -0,0 +1,3 @@
1
+ import type { Paths } from "type-fest";
2
+ declare const recursiveOmit: <T extends { [key in string]: unknown; }, OmittedKeys extends Paths<T>[]>(object: T, omittedKeys: OmittedKeys, pathUntilNow?: string) => T;
3
+ export default recursiveOmit;
@@ -0,0 +1,3 @@
1
+ import type { Paths } from "type-fest";
2
+ declare const recursivePick: <T extends { [key in string]: unknown; }, PickedKeys extends Paths<T>[]>(object: T, pickedKeys: PickedKeys, pathUntilNow?: string) => T;
3
+ export default recursivePick;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/object",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Helper functions for working with objects and arrays.",
5
5
  "keywords": [
6
6
  "visulima",
@@ -59,9 +59,6 @@
59
59
  "README.md",
60
60
  "CHANGELOG.md"
61
61
  ],
62
- "dependencies": {
63
- "type-fest": "^5.1.0"
64
- },
65
62
  "engines": {
66
63
  "node": ">=20.19 <=25.x"
67
64
  },