@visulima/object 3.0.0-alpha.9 → 3.0.0

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,197 @@
1
+ ## @visulima/object [3.0.0](https://github.com/visulima/visulima/compare/@visulima/object@2.0.4...@visulima/object@3.0.0) (2026-07-03)
2
+
3
+ ### ⚠ BREAKING CHANGES
4
+
5
+ * change min node version to 22.13
6
+
7
+ ### Features
8
+
9
+ * **web:** auto-generate packages page from workspace metadata ([623e520](https://github.com/visulima/visulima/commit/623e5207693a7fe720f5f2f179593a3654c880e3))
10
+
11
+ ### Bug Fixes
12
+
13
+ * add new package image, fixed readme rendering on npm, fixed building of packages ([b790ba2](https://github.com/visulima/visulima/commit/b790ba253ea07fef83528fd822a678facf021b5f))
14
+ * **data-manipulation:** resolve eslint and type-safety issues ([f1682c2](https://github.com/visulima/visulima/commit/f1682c2611cbcc6c85d4bbea520d43464b42e7ee))
15
+ * **object:** 1 bug fix + 1 perf ([d317d30](https://github.com/visulima/visulima/commit/d317d30cf89629f3a2cea5a1f7a6e9b3967c86d4))
16
+ * **object:** fix broken types, array/escape paths and docs ([7c560b1](https://github.com/visulima/visulima/commit/7c560b175507231ba3d50a18faa372283f6fb13c))
17
+ * **object:** pass OmittedKeys/PickedKeys generics to recursive calls ([1943c39](https://github.com/visulima/visulima/commit/1943c3912844b133611fe5d207c52a0f78ef51dc))
18
+ * **object:** suppress eslint rules for recursive utility type patterns ([f68ce68](https://github.com/visulima/visulima/commit/f68ce68b45c6d03cf072bdf9d632478e7c7cd8eb))
19
+ * **object:** update package files ([5a8dad8](https://github.com/visulima/visulima/commit/5a8dad850ba0089bbd1dbd79070b49d42ea16b88))
20
+ * **object:** update packem to 2.0.0-alpha.54 ([a539ca7](https://github.com/visulima/visulima/commit/a539ca75ba8307c4402edc9e79d192dbb4aecf06))
21
+ * Remove JSR configuration generation script and generated jsr.json files ([#616](https://github.com/visulima/visulima/issues/616)) ([533744b](https://github.com/visulima/visulima/commit/533744b103b74896941db5b727173e617a27a63b))
22
+ * **storage-client:** percent-encode user fields in defaultFingerprint ([7c78a0f](https://github.com/visulima/visulima/commit/7c78a0f9512e2a673b941d80839e9f1e86b7b5d0))
23
+ * update Node.js engine version requirement to >=22.13 in multiple package.json files for improved compatibility ([b828e9a](https://github.com/visulima/visulima/commit/b828e9aeaebfc798eecddccd90e6ec7560c6d36a))
24
+ * update package OG images across multiple packages ([f08e4dd](https://github.com/visulima/visulima/commit/f08e4dd2b105ccb29c8412020a9c2be36d6c1e9e))
25
+ * **web:** improve build setup with incremental stats caching and prod install ([fe33e75](https://github.com/visulima/visulima/commit/fe33e75827586779b4b3a0c6d57b39f889ee6207))
26
+
27
+ ### Documentation
28
+
29
+ * **object,redact,colorize,path,fs:** add comprehensive Fumadocs documentation ([19c3840](https://github.com/visulima/visulima/commit/19c384041db855e1c2de41ce2067458b39737565))
30
+
31
+ ### Styles
32
+
33
+ * cs fixes ([2a960bb](https://github.com/visulima/visulima/commit/2a960bb1772c9dc70080e2d75d3a0d827034e294))
34
+
35
+ ### Miscellaneous Chores
36
+
37
+ * add fallow code-intelligence across all packages ([a3b4821](https://github.com/visulima/visulima/commit/a3b48215002e86fed20f2973038b5d4a0aa1ce04))
38
+ * **api-platform:** apply pending lint and source updates ([3fb0043](https://github.com/visulima/visulima/commit/3fb0043a4cf35f752ca89a09a077100ae0142da8))
39
+ * apply eslint + prettier autofixes across packages ([c1bb784](https://github.com/visulima/visulima/commit/c1bb7848a0d93d0dfe2960c77e3cda22239c79a0))
40
+ * apply linting and formatting fixes across packages ([5d150a5](https://github.com/visulima/visulima/commit/5d150a578f9ce861c791843c683deeb849b774a9))
41
+ * apply safe prettier and eslint formatting ([05120af](https://github.com/visulima/visulima/commit/05120af8c898d18c495575680f01134681e29b65))
42
+ * bump engines.node to ^22.14.0 || >=24.10.0 ([c3d0931](https://github.com/visulima/visulima/commit/c3d0931d1504e4f21ebf50ea680cfa7ce4ba15ce))
43
+ * **ci-stability:** green CI across vis, native, lint, tests, attw ([#651](https://github.com/visulima/visulima/issues/651)) ([d4eb684](https://github.com/visulima/visulima/commit/d4eb684b5f75c818c9251048c605a0ed54a268e3))
44
+ * **data-manipulation:** remove empty dependency objects from package.json ([c0e8f76](https://github.com/visulima/visulima/commit/c0e8f7689a2da413f771494f6ecb07babc4b5e06))
45
+ * **data-manipulation:** update dependencies ([49458ab](https://github.com/visulima/visulima/commit/49458ab8f8e17d875840b1b4fe8b5efe12ff3513))
46
+ * **fallow:** resolve dead-code findings ([c4125d5](https://github.com/visulima/visulima/commit/c4125d53e03ac9d90115399634535991927a96cc))
47
+ * fixed jsr.json ([5d85e51](https://github.com/visulima/visulima/commit/5d85e5179de38e284ec433b14d77c71a1619c8d6))
48
+ * fixed project.json names and schema path ([964722f](https://github.com/visulima/visulima/commit/964722f691db205c7edb9aa6db29e849a647500b))
49
+ * jsr.json update and lock file ([73fce38](https://github.com/visulima/visulima/commit/73fce38c7cb4603f3fffb88609b1b18e2feb4937))
50
+ * moved all packages into groups ([0615e9d](https://github.com/visulima/visulima/commit/0615e9d14a8a886e11da529ce150cf31ca973c10))
51
+ * **object:** add tsconfig.eslint.json for type-aware linting ([f22e998](https://github.com/visulima/visulima/commit/f22e998b368ad0de17cf8b71280a67c9d98070d0))
52
+ * **object:** apply auto-fix formatting ([2e94ac5](https://github.com/visulima/visulima/commit/2e94ac5afa7cf890d1f37a5fa7a7a0cf961087e4))
53
+ * **object:** apply formatter sweep and clean license attribution ([697adb2](https://github.com/visulima/visulima/commit/697adb268bb007cf4f6983f4a89a1258a9ff208d))
54
+ * **object:** apply pending changes ([0420964](https://github.com/visulima/visulima/commit/0420964a5ddbc16a02e5e2a80d65efaf0464fcca))
55
+ * **object:** apply prettier and eslint quote-style auto-fix ([fb4c54f](https://github.com/visulima/visulima/commit/fb4c54f719e6ca1d03ac56c7f9f9067f9731f17e))
56
+ * **object:** apply prettier formatting ([893b38f](https://github.com/visulima/visulima/commit/893b38f86b7f22f9f65bb8a02812bf5b1de1e051))
57
+ * **object:** fix lint errors ([386c5f0](https://github.com/visulima/visulima/commit/386c5f0f6e36d0491e674c03196710a40f1e91c0))
58
+ * **object:** housekeeping cleanup ([99d38b2](https://github.com/visulima/visulima/commit/99d38b214e62548810b2b362bd8b9483e242fdcc))
59
+ * **object:** migrate .prettierrc.cjs to prettier.config.js ([6fd82bc](https://github.com/visulima/visulima/commit/6fd82bcb393bcc3e8f7223210dc18f421949ab17))
60
+ * **object:** migrate deps to pnpm catalogs ([690cca3](https://github.com/visulima/visulima/commit/690cca39fa4903d1538e830340c07392e4d358ae))
61
+ * **object:** update dependencies ([5ebd3d5](https://github.com/visulima/visulima/commit/5ebd3d5c6a7001877b4ad4f8e877f1dc78b60d1e))
62
+ * **object:** update dependencies ([173c843](https://github.com/visulima/visulima/commit/173c843f32aa8d019ba08fc6a2571a2bca22884e))
63
+ * **object:** update dependencies ([8a9ce76](https://github.com/visulima/visulima/commit/8a9ce763a67693643324f8c31850dcd88938fffc))
64
+ * **object:** upgrade packem to 2.0.0-alpha.76 ([729158f](https://github.com/visulima/visulima/commit/729158f5a0d8a445227c7df7170f3bd7654e0546))
65
+ * re-sort workspace package.json files via vis sort-package-json ([f625696](https://github.com/visulima/visulima/commit/f625696cfac974325774b3243e1a83c3d23acbd7))
66
+ * **release:** @visulima/object@3.0.0-alpha.1 [skip ci]\n\n## @visulima/object [3.0.0-alpha.1](https://github.com/visulima/visulima/compare/@visulima/object@2.0.4...@visulima/object@3.0.0-alpha.1) (2025-12-04) ([5530e73](https://github.com/visulima/visulima/commit/5530e735c232fa08179ff0707d331fcd0081ee4b))
67
+ * **release:** @visulima/object@3.0.0-alpha.10 [skip ci]\n\n## @visulima/object [3.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.9...@visulima/object@3.0.0-alpha.10) (2026-04-21) ([6376df2](https://github.com/visulima/visulima/commit/6376df20141b4c3644974fa6847ace12269d9028))
68
+ * **release:** @visulima/object@3.0.0-alpha.11 [skip ci]\n\n## @visulima/object [3.0.0-alpha.11](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.10...@visulima/object@3.0.0-alpha.11) (2026-04-21) ([6663b21](https://github.com/visulima/visulima/commit/6663b21cd7e14dfe5fa2f827930903a9cab78707))
69
+ * **release:** @visulima/object@3.0.0-alpha.12 [skip ci]\n\n## @visulima/object [3.0.0-alpha.12](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.11...@visulima/object@3.0.0-alpha.12) (2026-04-21) ([f1a95da](https://github.com/visulima/visulima/commit/f1a95da7b600f7ba275ff080f2cebd40e3e41252))
70
+ * **release:** @visulima/object@3.0.0-alpha.13 [skip ci]\n\n## @visulima/object [3.0.0-alpha.13](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.12...@visulima/object@3.0.0-alpha.13) (2026-04-22) ([0edad43](https://github.com/visulima/visulima/commit/0edad43693bd6fd675504f429981f9f96e904ae9))
71
+ * **release:** @visulima/object@3.0.0-alpha.14 [skip ci]\n\n## @visulima/object [3.0.0-alpha.14](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.13...@visulima/object@3.0.0-alpha.14) (2026-05-27) ([ac34a16](https://github.com/visulima/visulima/commit/ac34a163c8854fa64ea2dde3505dd9d5183c326f))
72
+ * **release:** @visulima/object@3.0.0-alpha.15 [skip ci]\n\n## @visulima/object [3.0.0-alpha.15](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.14...@visulima/object@3.0.0-alpha.15) (2026-06-04) ([0797e85](https://github.com/visulima/visulima/commit/0797e8557fc20d167fd9f1f025e2de1bd5cbafa8))
73
+ * **release:** @visulima/object@3.0.0-alpha.16 [skip ci]\n\n## @visulima/object [3.0.0-alpha.16](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.15...@visulima/object@3.0.0-alpha.16) (2026-06-13) ([cec532e](https://github.com/visulima/visulima/commit/cec532edb16a6509add8ec6ca9a829ed2f92fdfc))
74
+ * **release:** @visulima/object@3.0.0-alpha.2 [skip ci]\n\n## @visulima/object [3.0.0-alpha.2](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.1...@visulima/object@3.0.0-alpha.2) (2025-12-06) ([91ca232](https://github.com/visulima/visulima/commit/91ca23293784224f967300a2c73f52c8bfe14aeb))
75
+ * **release:** @visulima/object@3.0.0-alpha.3 [skip ci]\n\n## @visulima/object [3.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.2...@visulima/object@3.0.0-alpha.3) (2025-12-11) ([4f05860](https://github.com/visulima/visulima/commit/4f0586043a22f4326538d7d6fcef190eebc9c906))
76
+ * **release:** @visulima/object@3.0.0-alpha.4 [skip ci]\n\n## @visulima/object [3.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.3...@visulima/object@3.0.0-alpha.4) (2025-12-27) ([38422e7](https://github.com/visulima/visulima/commit/38422e7f227289aa8eb1a465068241259dfca50e))
77
+ * **release:** @visulima/object@3.0.0-alpha.5 [skip ci]\n\n## @visulima/object [3.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.4...@visulima/object@3.0.0-alpha.5) (2026-03-06) ([a20524f](https://github.com/visulima/visulima/commit/a20524fc406ad09a66797c078fba6cda4ae05925))
78
+ * **release:** @visulima/object@3.0.0-alpha.6 [skip ci]\n\n## @visulima/object [3.0.0-alpha.6](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.5...@visulima/object@3.0.0-alpha.6) (2026-03-26) ([dcc53ea](https://github.com/visulima/visulima/commit/dcc53eaad4e2a13ef741fcadcd6348a15dcf2b52))
79
+ * **release:** @visulima/object@3.0.0-alpha.7 [skip ci]\n\n## @visulima/object [3.0.0-alpha.7](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.6...@visulima/object@3.0.0-alpha.7) (2026-03-26) ([3fcb79f](https://github.com/visulima/visulima/commit/3fcb79fd3dc5843f049278d23031e2659c9746c0))
80
+ * **release:** @visulima/object@3.0.0-alpha.8 [skip ci]\n\n## @visulima/object [3.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.7...@visulima/object@3.0.0-alpha.8) (2026-04-08) ([220e61f](https://github.com/visulima/visulima/commit/220e61f242574284d797e4f2d95c5e2c4424bdfd))
81
+ * **release:** @visulima/object@3.0.0-alpha.9 [skip ci]\n\n## @visulima/object [3.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.8...@visulima/object@3.0.0-alpha.9) (2026-04-15) ([1f5b595](https://github.com/visulima/visulima/commit/1f5b5958695ffac7eb5913f69015633c5f2fbfd5))
82
+ * **repo:** sort package.json keys across all packages ([e1fd9ab](https://github.com/visulima/visulima/commit/e1fd9ab467ef96a98c777da1572ff6a50fcf7e71))
83
+ * sorted package.json ([b47c545](https://github.com/visulima/visulima/commit/b47c545591600fdab17d5cd3a3fbc68b61e199da))
84
+ * update @anolilab/semantic-release-pnpm and @anolilab/semantic-release-preset to versions 3.2.2 and 12.1.2 across multiple package.json files for improved compatibility ([3921626](https://github.com/visulima/visulima/commit/3921626141fe5da398749bf0ba675f1596f18afb))
85
+ * update dependencies across multiple packages to improve compatibility and performance, including upgrading `@anolilab/semantic-release-pnpm` and `@anolilab/semantic-release-preset` to versions 3.2.0 and 12.1.0 respectively, and updating `react`, `react-dom`, and `next` versions to 19.2.1 and 16.0.7 in various package.json files ([aee8fcd](https://github.com/visulima/visulima/commit/aee8fcd796ae9b8d055903260e7150996ea9f53d))
86
+ * update lock file maintenance ([d83e716](https://github.com/visulima/visulima/commit/d83e71697b75d24704185b66bb521a934d2db02d))
87
+ * update the jsr.json ([864ab7e](https://github.com/visulima/visulima/commit/864ab7e71c4b5ae82f64792d1ae8debfea2c539b))
88
+ * visulima website ([#591](https://github.com/visulima/visulima/issues/591)) ([59ab2e2](https://github.com/visulima/visulima/commit/59ab2e2befb03e51cd2088956f83d9b87de6d033))
89
+ * year update ([47f4105](https://github.com/visulima/visulima/commit/47f410596ce7190cfea36a073db32e0cec50bbcd))
90
+
91
+ ### Code Refactoring
92
+
93
+ * **docs:** migrate Nextra components to fumadocs-ui, remove Nextra stripping ([484878f](https://github.com/visulima/visulima/commit/484878f01879363ef5e9a0282904dc4627d6060c))
94
+ * **object:** apply prettier/eslint formatting cleanup ([b293527](https://github.com/visulima/visulima/commit/b293527bc95a2b260665c98f5b7206996f23ac91))
95
+
96
+ ### Tests
97
+
98
+ * **object:** add safe-assign coverage ([0dc5c7b](https://github.com/visulima/visulima/commit/0dc5c7bb14a59595b3ec2f5f37f64842eefad26e))
99
+ * **object:** cover recursive pick/omit non-plain-object and empty-keys branches ([79c3498](https://github.com/visulima/visulima/commit/79c34986008e0633e61a4be39dc18c2b02589e3d))
100
+ * **repo:** add dist runtime + types integration tests ([32ee300](https://github.com/visulima/visulima/commit/32ee300b7184117a0ddf9f9d390f75f8932d5ed9))
101
+
102
+ ### Build System
103
+
104
+ * regenerate bundled-license manifests and types ordering ([af26588](https://github.com/visulima/visulima/commit/af26588d75aaa937fd4862800560bd4070a4878c))
105
+
106
+ ### Continuous Integration
107
+
108
+ * **fallow:** make fallow:health advisory (--report-only) ([d57148e](https://github.com/visulima/visulima/commit/d57148ea0e3556b4c24d8d336b9fa14987f5dc7d))
109
+
110
+ ## @visulima/object [3.0.0-alpha.16](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.15...@visulima/object@3.0.0-alpha.16) (2026-06-13)
111
+
112
+ ### Bug Fixes
113
+
114
+ * **object:** fix broken types, array/escape paths and docs ([7c560b1](https://github.com/visulima/visulima/commit/7c560b175507231ba3d50a18faa372283f6fb13c))
115
+
116
+ ### Miscellaneous Chores
117
+
118
+ * apply safe prettier and eslint formatting ([05120af](https://github.com/visulima/visulima/commit/05120af8c898d18c495575680f01134681e29b65))
119
+
120
+ ### Code Refactoring
121
+
122
+ * **object:** apply prettier/eslint formatting cleanup ([b293527](https://github.com/visulima/visulima/commit/b293527bc95a2b260665c98f5b7206996f23ac91))
123
+
124
+ ### Tests
125
+
126
+ * **object:** add safe-assign coverage ([0dc5c7b](https://github.com/visulima/visulima/commit/0dc5c7bb14a59595b3ec2f5f37f64842eefad26e))
127
+
128
+ ### Build System
129
+
130
+ * regenerate bundled-license manifests and types ordering ([af26588](https://github.com/visulima/visulima/commit/af26588d75aaa937fd4862800560bd4070a4878c))
131
+
132
+ ## @visulima/object [3.0.0-alpha.15](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.14...@visulima/object@3.0.0-alpha.15) (2026-06-04)
133
+
134
+ ### Bug Fixes
135
+
136
+ * **object:** 1 bug fix + 1 perf ([d317d30](https://github.com/visulima/visulima/commit/d317d30cf89629f3a2cea5a1f7a6e9b3967c86d4))
137
+
138
+ ### Miscellaneous Chores
139
+
140
+ * apply eslint + prettier autofixes across packages ([c1bb784](https://github.com/visulima/visulima/commit/c1bb7848a0d93d0dfe2960c77e3cda22239c79a0))
141
+
142
+ ### Tests
143
+
144
+ * **object:** cover recursive pick/omit non-plain-object and empty-keys branches ([79c3498](https://github.com/visulima/visulima/commit/79c34986008e0633e61a4be39dc18c2b02589e3d))
145
+
146
+ ## @visulima/object [3.0.0-alpha.14](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.13...@visulima/object@3.0.0-alpha.14) (2026-05-27)
147
+
148
+ ### Bug Fixes
149
+
150
+ * **storage-client:** percent-encode user fields in defaultFingerprint ([7c78a0f](https://github.com/visulima/visulima/commit/7c78a0f9512e2a673b941d80839e9f1e86b7b5d0))
151
+
152
+ ### Miscellaneous Chores
153
+
154
+ * **ci-stability:** green CI across vis, native, lint, tests, attw ([#651](https://github.com/visulima/visulima/issues/651)) ([d4eb684](https://github.com/visulima/visulima/commit/d4eb684b5f75c818c9251048c605a0ed54a268e3))
155
+ * **object:** apply formatter sweep and clean license attribution ([697adb2](https://github.com/visulima/visulima/commit/697adb268bb007cf4f6983f4a89a1258a9ff208d))
156
+ * **object:** apply prettier and eslint quote-style auto-fix ([fb4c54f](https://github.com/visulima/visulima/commit/fb4c54f719e6ca1d03ac56c7f9f9067f9731f17e))
157
+ * **object:** fix lint errors ([386c5f0](https://github.com/visulima/visulima/commit/386c5f0f6e36d0491e674c03196710a40f1e91c0))
158
+ * **object:** housekeeping cleanup ([99d38b2](https://github.com/visulima/visulima/commit/99d38b214e62548810b2b362bd8b9483e242fdcc))
159
+ * **object:** upgrade packem to 2.0.0-alpha.76 ([729158f](https://github.com/visulima/visulima/commit/729158f5a0d8a445227c7df7170f3bd7654e0546))
160
+ * re-sort workspace package.json files via vis sort-package-json ([f625696](https://github.com/visulima/visulima/commit/f625696cfac974325774b3243e1a83c3d23acbd7))
161
+ * **repo:** sort package.json keys across all packages ([e1fd9ab](https://github.com/visulima/visulima/commit/e1fd9ab467ef96a98c777da1572ff6a50fcf7e71))
162
+ * sorted package.json ([b47c545](https://github.com/visulima/visulima/commit/b47c545591600fdab17d5cd3a3fbc68b61e199da))
163
+
164
+ ### Tests
165
+
166
+ * **repo:** add dist runtime + types integration tests ([32ee300](https://github.com/visulima/visulima/commit/32ee300b7184117a0ddf9f9d390f75f8932d5ed9))
167
+
168
+ ## @visulima/object [3.0.0-alpha.13](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.12...@visulima/object@3.0.0-alpha.13) (2026-04-22)
169
+
170
+ ### Bug Fixes
171
+
172
+ * Remove JSR configuration generation script and generated jsr.json files ([#616](https://github.com/visulima/visulima/issues/616)) ([533744b](https://github.com/visulima/visulima/commit/533744b103b74896941db5b727173e617a27a63b))
173
+
174
+ ## @visulima/object [3.0.0-alpha.12](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.11...@visulima/object@3.0.0-alpha.12) (2026-04-21)
175
+
176
+ ### Miscellaneous Chores
177
+
178
+ * jsr.json update and lock file ([73fce38](https://github.com/visulima/visulima/commit/73fce38c7cb4603f3fffb88609b1b18e2feb4937))
179
+
180
+ ## @visulima/object [3.0.0-alpha.11](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.10...@visulima/object@3.0.0-alpha.11) (2026-04-21)
181
+
182
+ ### Miscellaneous Chores
183
+
184
+ * update the jsr.json ([864ab7e](https://github.com/visulima/visulima/commit/864ab7e71c4b5ae82f64792d1ae8debfea2c539b))
185
+
186
+ ## @visulima/object [3.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.9...@visulima/object@3.0.0-alpha.10) (2026-04-21)
187
+
188
+ ### Miscellaneous Chores
189
+
190
+ * **api-platform:** apply pending lint and source updates ([3fb0043](https://github.com/visulima/visulima/commit/3fb0043a4cf35f752ca89a09a077100ae0142da8))
191
+ * bump engines.node to ^22.14.0 || >=24.10.0 ([c3d0931](https://github.com/visulima/visulima/commit/c3d0931d1504e4f21ebf50ea680cfa7ce4ba15ce))
192
+ * fixed jsr.json ([5d85e51](https://github.com/visulima/visulima/commit/5d85e5179de38e284ec433b14d77c71a1619c8d6))
193
+ * **object:** apply pending changes ([0420964](https://github.com/visulima/visulima/commit/0420964a5ddbc16a02e5e2a80d65efaf0464fcca))
194
+
1
195
  ## @visulima/object [3.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/object@3.0.0-alpha.8...@visulima/object@3.0.0-alpha.9) (2026-04-15)
2
196
 
3
197
  ### Bug Fixes
package/LICENSE.md CHANGED
@@ -49,44 +49,23 @@ Repository: sindresorhus/dot-prop
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
- ---------------------------------------
53
-
54
- ## is-plain-obj
55
- License: MIT
56
- By: Sindre Sorhus
57
- Repository: sindresorhus/is-plain-obj
58
-
59
- > MIT License
60
- >
61
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
62
- >
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
- >
65
- > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
66
- >
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
-
69
52
  <!-- /DEPENDENCIES -->
70
53
 
71
54
  <!-- TYPE_DEPENDENCIES -->
72
55
 
73
56
  # Licenses of bundled types
74
-
75
57
  The published @visulima/object artifact additionally contains code with the following licenses:
76
58
  MIT
77
59
 
78
60
  # Bundled types:
79
-
80
61
  ## deeks
81
-
82
62
  License: MIT
83
63
  By: mrodrig
84
64
  Repository: git+https://github.com/mrodrig/deeks.git
85
65
 
86
- ---
66
+ ---------------------------------------
87
67
 
88
68
  ## dot-prop
89
-
90
69
  License: MIT
91
70
  By: Sindre Sorhus
92
71
  Repository: sindresorhus/dot-prop
@@ -101,22 +80,4 @@ Repository: sindresorhus/dot-prop
101
80
  >
102
81
  > 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.
103
82
 
104
- ---
105
-
106
- ## is-plain-obj
107
-
108
- License: MIT
109
- By: Sindre Sorhus
110
- Repository: sindresorhus/is-plain-obj
111
-
112
- > MIT License
113
- >
114
- > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
115
- >
116
- > 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:
117
- >
118
- > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
119
- >
120
- > 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.
121
-
122
83
  <!-- /TYPE_DEPENDENCIES -->
package/README.md CHANGED
@@ -50,56 +50,113 @@ pnpm add @visulima/object
50
50
 
51
51
  ## Usage
52
52
 
53
- ### deleteProperty
54
-
55
- ### escapePath
56
-
57
- ### getProperty
58
-
59
- ### hasProperty
60
-
61
- ### setProperty
62
-
63
- ### deepKeys
64
-
65
- ### deepKeysFromList
66
-
67
- ### isPlainObject
53
+ `@visulima/object` exposes two local helpers (`pick`, `omit`) plus a curated set
54
+ of re-exports from [`dot-prop`](https://github.com/sindresorhus/dot-prop) and
55
+ [`deeks`](https://github.com/mrodrig/deeks).
68
56
 
69
57
  ### pick
70
58
 
71
- With `pick` you pass an object and an array of keys of an object - **the props which may stay**.
59
+ With `pick` you pass an object and an array of keys - **the props which may stay**.
72
60
 
73
61
  ```js
74
62
  import { pick } from "@visulima/object";
75
63
 
76
64
  const squirtle = { id: "007", name: "Squirtle", type: "water" };
77
65
 
78
- const newObject = pick(squirtle, ["name", "type"]);
79
- // returns { name: 'Squirtle', type: 'water' }
66
+ pick(squirtle, ["name", "type"]);
67
+ // => { name: 'Squirtle', type: 'water' }
80
68
 
81
69
  const doc = { items: { keep: "📌", discard: "✂️" } };
82
70
 
83
71
  pick(doc, ["items.keep"]);
84
- // returns {items: {keep: '📌'}}
72
+ // => { items: { keep: '📌' } }
85
73
  ```
86
74
 
75
+ `pick` returns a **new object** and never shares structure with the input. An
76
+ empty key list returns `{}`.
77
+
87
78
  ### omit
88
79
 
89
- With `omit` you pass an object and an array of keys of an object - the props which should be removed.
80
+ With `omit` you pass an object and an array of keys - the props which should be removed.
90
81
 
91
82
  ```js
92
83
  import { omit } from "@visulima/object";
93
84
 
94
85
  const squirtle = { id: "007", name: "Squirtle", type: "water" };
95
86
 
96
- const withoutId = omit(squirtle, ["id"]);
97
- // returns { name: 'Squirtle', type: 'water' }
87
+ omit(squirtle, ["id"]);
88
+ // => { name: 'Squirtle', type: 'water' }
98
89
 
99
90
  const doc = { items: { keep: "📌", discard: "✂️" } };
100
91
 
101
92
  omit(doc, ["items.discard"]);
102
- // returns {items: {keep: '📌'}}
93
+ // => { items: { keep: '📌' } }
94
+ ```
95
+
96
+ `omit` always returns a **fresh deep copy** — even when the key list is empty —
97
+ so mutating the result never affects the input.
98
+
99
+ ### Path features (`pick` / `omit`)
100
+
101
+ Both helpers share the same path dialect:
102
+
103
+ - **Dot-notation** for nested props: `nested.prop`.
104
+ - **Wildcard segments** with `*` to match any single key: `items.*.secret`.
105
+ - **Array traversal** by index or wildcard: `users.0.password`, `users.*.password`.
106
+ - **Backslash-escaped dots** for keys that literally contain a `.`: `omit(obj, ["a\\.b"])`
107
+ targets the key named `"a.b"` (compatible with the re-exported `escapePath`).
108
+ - **Symbol-keyed properties** are always preserved (string paths can never name them).
109
+
110
+ ```js
111
+ omit({ users: [{ name: "a", password: "x" }] }, ["users.*.password"]);
112
+ // => { users: [{ name: "a" }] }
113
+ ```
114
+
115
+ ### isPlainObject
116
+
117
+ Returns `true` only for objects created from `{}` or `Object.create(null)`
118
+ (arrays, class instances, `Map`/`Set`, etc. return `false`).
119
+
120
+ ```js
121
+ import { isPlainObject } from "@visulima/object";
122
+
123
+ isPlainObject({}); // => true
124
+ isPlainObject([]); // => false
125
+ isPlainObject(new Map()); // => false
126
+ ```
127
+
128
+ ### getProperty / setProperty / hasProperty / deleteProperty / escapePath
129
+
130
+ Re-exported from [`dot-prop`](https://github.com/sindresorhus/dot-prop) for
131
+ get/set/has/delete on nested objects using a dot path (this uses dot-prop's own
132
+ `a.b[0].c` array syntax). `escapePath` escapes a string so dots inside it are
133
+ treated as literal characters.
134
+
135
+ ```js
136
+ import { getProperty, setProperty, hasProperty, deleteProperty, escapePath } from "@visulima/object";
137
+
138
+ getProperty({ foo: { bar: "baz" } }, "foo.bar"); // => "baz"
139
+ setProperty({}, "foo.bar", "baz"); // => { foo: { bar: "baz" } }
140
+ hasProperty({ foo: { bar: "baz" } }, "foo.bar"); // => true
141
+ deleteProperty({ foo: { bar: "baz" } }, "foo.bar"); // => true (mutates input)
142
+ escapePath("foo.bar"); // => "foo\\.bar"
143
+ ```
144
+
145
+ > Note: the `dot-prop` helpers use dot-prop's own path/array syntax, while
146
+ > `pick`/`omit` use the dialect described above. Use `escapePath` for the
147
+ > dot-prop helpers and `\\.`-escaping for `pick`/`omit`.
148
+
149
+ ### deepKeys / deepKeysFromList
150
+
151
+ Re-exported from [`deeks`](https://github.com/mrodrig/deeks) — collect every
152
+ dot-notation key path from a single object (`deepKeys`) or an array of objects
153
+ (`deepKeysFromList`). Accepts a `DeepKeysOptions` object.
154
+
155
+ ```js
156
+ import { deepKeys, deepKeysFromList } from "@visulima/object";
157
+
158
+ deepKeys({ a: { b: 1, c: 2 } }); // => ["a.b", "a.c"]
159
+ deepKeysFromList([{ a: 1 }, { b: { c: 2 } }]); // => [["a"], ["b.c"]]
103
160
  ```
104
161
 
105
162
  ## Related
package/dist/index.d.ts CHANGED
@@ -1,7 +1,207 @@
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";
1
+ import { Paths, OmitDeep, PickDeep, Get } from 'type-fest';
2
+ export type { OmitDeep, Paths, PickDeep, Split } from 'type-fest';
3
+ /**
4
+ * Omit returns a new object without the props you omit.
5
+ *
6
+ * Supports dot-notation for nested props (e.g. `nested.prop`), `*` wildcard
7
+ * segments (e.g. `items.*.secret`), array traversal (e.g. `users.0.password`
8
+ * or `users.*.password`), and backslash-escaped dots for keys that literally
9
+ * contain a `.` (e.g. `a\\.b`). Symbol-keyed properties are always preserved.
10
+ * @template T
11
+ * @template K
12
+ * @param object the target object to omit props from
13
+ * @param keys the prop names you want to omit
14
+ * @returns a new object without the omitted props
15
+ * @example
16
+ * ```js
17
+ * omit({ id: "1", name: "n", secret: "x" }, ["secret"]);
18
+ * // => { id: "1", name: "n" }
19
+ *
20
+ * omit({ users: [{ name: "a", password: "p" }] }, ["users.*.password"]);
21
+ * // => { users: [{ name: "a" }] }
22
+ * ```
23
+ */
24
+ declare const omit: <T extends { [key in string]: unknown }, const K extends Paths<T>>(object: T, keys: ReadonlyArray<K>) => OmitDeep<T, K>;
25
+ /**
26
+ * Pick returns a new object with only the props you pick.
27
+ *
28
+ * Supports dot-notation for nested props (e.g. `nested.prop` keeps just
29
+ * `{ nested: { prop: 1 } }`), `*` wildcard segments (e.g. `items.*.id`), array
30
+ * traversal (e.g. `users.0.name` or `users.*.name`), and backslash-escaped
31
+ * dots for keys that literally contain a `.` (e.g. `a\\.b`).
32
+ * @template T
33
+ * @template K
34
+ * @param object the target object to pick props from
35
+ * @param keys an array of prop names you want to keep
36
+ * @returns a new object with just the picked props
37
+ * @example
38
+ * ```js
39
+ * pick({ id: "1", name: "n", secret: "x" }, ["id", "name"]);
40
+ * // => { id: "1", name: "n" }
41
+ *
42
+ * pick({ users: [{ name: "a", password: "p" }] }, ["users.*.name"]);
43
+ * // => { users: [{ name: "a" }] }
44
+ * ```
45
+ */
46
+ declare const pick: <T extends { [key in string]: unknown }, const K extends Paths<T>>(object: T, keys: ReadonlyArray<K>) => PickDeep<T, K>;
47
+ /**
48
+ * Determines whether a value is a plain object (i.e. created from `{}` or `Object.create(null)`).
49
+ * @param value Value to inspect.
50
+ * @returns `true` if the value is a plain object, otherwise `false`.
51
+ */
52
+ declare const isPlainObject: (value: unknown) => value is Record<string, unknown>;
53
+ interface DeeksOptions {
54
+ /** @default false */
55
+ arrayIndexesAsKeys?: boolean;
56
+ /** @default true */
57
+ expandNestedObjects?: boolean;
58
+ /** @default false */
59
+ expandArrayObjects?: boolean;
60
+ /** @default false */
61
+ ignoreEmptyArraysWhenExpanding?: boolean;
62
+ /** @default false */
63
+ escapeNestedDots?: boolean;
64
+ /** @default false */
65
+ ignoreEmptyArrays?: boolean;
66
+ }
67
+ /**
68
+ * Return the deep keys list for a single document
69
+ * @param object
70
+ * @param options
71
+ * @returns {Array}
72
+ */
73
+ declare function deepKeys(object: object, options?: DeeksOptions): string[];
74
+ /**
75
+ * Return the deep keys list for all documents in the provided list
76
+ * @param list
77
+ * @param options
78
+ * @returns Array[Array[String]]
79
+ */
80
+ declare function deepKeysFromList(list: object[], options?: DeeksOptions, visited?: WeakSet<object>): string[][];
81
+ /**
82
+ Get the value of the property at the given path.
83
+
84
+ @param object - Object or array to get the `path` value.
85
+ @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]`).
86
+ @param defaultValue - Default value.
87
+
88
+ @example
89
+ ```
90
+ import {getProperty} from 'dot-prop';
91
+
92
+ getProperty({foo: {bar: 'unicorn'}}, 'foo.bar');
93
+ //=> 'unicorn'
94
+
95
+ getProperty({foo: {bar: 'a'}}, 'foo.notDefined.deep');
96
+ //=> undefined
97
+
98
+ getProperty({foo: {bar: 'a'}}, 'foo.notDefined.deep', 'default value');
99
+ //=> 'default value'
100
+
101
+ getProperty({foo: {'dot.dot': 'unicorn'}}, 'foo.dot\\.dot');
102
+ //=> 'unicorn'
103
+
104
+ getProperty({foo: [{bar: 'unicorn'}]}, 'foo[0].bar');
105
+ //=> 'unicorn'
106
+
107
+ getProperty({foo: [{bar: 'unicorn'}]}, 'foo.0.bar');
108
+ //=> 'unicorn'
109
+ ```
110
+ */
111
+ declare function getProperty<ObjectType, PathType extends string, DefaultValue = undefined>(object: ObjectType, path: PathType | ReadonlyArray<string | number>, defaultValue?: DefaultValue): ObjectType extends Record<string, unknown> | unknown[] ? (unknown extends Get<ObjectType, PathType> ? DefaultValue : Get<ObjectType, PathType>) : DefaultValue extends undefined ? unknown : DefaultValue;
112
+ /**
113
+ Set the property at the given path to the given value.
114
+
115
+ @param object - Object or array to set the `path` value.
116
+ @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]`).
117
+ @param value - Value to set at `path`.
118
+ @returns The object.
119
+
120
+ @example
121
+ ```
122
+ import {setProperty} from 'dot-prop';
123
+
124
+ const object = {foo: {bar: 'a'}};
125
+ setProperty(object, 'foo.bar', 'b');
126
+ console.log(object);
127
+ //=> {foo: {bar: 'b'}}
128
+
129
+ const foo = setProperty({}, 'foo.bar', 'c');
130
+ console.log(foo);
131
+ //=> {foo: {bar: 'c'}}
132
+
133
+ setProperty(object, 'foo.baz', 'x');
134
+ console.log(object);
135
+ //=> {foo: {bar: 'b', baz: 'x'}}
136
+
137
+ setProperty(object, 'foo.biz[0]', 'a');
138
+ console.log(object);
139
+ //=> {foo: {bar: 'b', baz: 'x', biz: ['a']}}
140
+
141
+ setProperty(object, 'foo.items.0', 'first');
142
+ console.log(object);
143
+ //=> {foo: {bar: 'b', baz: 'x', biz: ['a'], items: ['first']}}
144
+ ```
145
+ */
146
+ declare function setProperty<ObjectType extends (Record<string, any> | unknown[])>(object: ObjectType, path: string | ReadonlyArray<string | number>, value: unknown): ObjectType;
147
+ /**
148
+ Check whether the property at the given path exists.
149
+
150
+ @param object - Object or array to test the `path` value.
151
+ @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]`).
152
+
153
+ @example
154
+ ```
155
+ import {hasProperty} from 'dot-prop';
156
+
157
+ hasProperty({foo: {bar: 'unicorn'}}, 'foo.bar');
158
+ //=> true
159
+ ```
160
+ */
161
+ declare function hasProperty(object: Record<string, any> | unknown[] | undefined, path: string | ReadonlyArray<string | number>): boolean;
162
+ /**
163
+ Delete the property at the given path.
164
+
165
+ @param object - Object or array to delete the `path` value.
166
+ @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]`).
167
+ @returns A boolean of whether the property existed before being deleted.
168
+
169
+ @example
170
+ ```
171
+ import {deleteProperty} from 'dot-prop';
172
+
173
+ const object = {foo: {bar: 'a'}};
174
+ deleteProperty(object, 'foo.bar');
175
+ console.log(object);
176
+ //=> {foo: {}}
177
+
178
+ object.foo.bar = {x: 'y', y: 'x'};
179
+ deleteProperty(object, 'foo.bar.x');
180
+ console.log(object);
181
+ //=> {foo: {bar: {y: 'x'}}}
182
+ ```
183
+ */
184
+ declare function deleteProperty(object: Record<string, any> | unknown[], path: string | ReadonlyArray<string | number>): boolean;
185
+ /**
186
+ Escape special characters in a path. Useful for sanitizing user input.
187
+
188
+ @param path - The dot path to sanitize.
189
+
190
+ @example
191
+ ```
192
+ import {getProperty, escapePath} from 'dot-prop';
193
+
194
+ const object = {
195
+ foo: {
196
+ bar: '👸🏻 You found me Mario!',
197
+ },
198
+ 'foo.bar' : '🍄 The princess is in another castle!',
199
+ };
200
+ const escapedPath = escapePath('foo.bar');
201
+
202
+ console.log(getProperty(object, escapedPath));
203
+ //=> '🍄 The princess is in another castle!'
204
+ ```
205
+ */
206
+ declare function escapePath(path: string): string;
207
+ export { type DeeksOptions as DeepKeysOptions, deepKeys, deepKeysFromList, deleteProperty, escapePath, getProperty, hasProperty, isPlainObject, omit, pick, setProperty };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var T=Object.defineProperty;var a=(t,c)=>T(t,"name",{value:c,configurable:!0});import{default as $}from"./packem_shared/omit-BfV-sPAM.js";import{default as te}from"./packem_shared/pick-CT4qE7de.js";import{deleteProperty as ne,escapePath as ae,getProperty as oe,hasProperty as se,setProperty as ue}from"./packem_shared/getProperty-DPNB_aKG.js";import{default as ie}from"./packem_shared/isPlainObject-CLTs8VdF.js";var W=Object.defineProperty,j=a((t,c)=>W(t,"name",{value:c,configurable:!0}),"t");function B(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}a(B,"getDefaultExportFromCjs");j(B,"getDefaultExportFromCjs");function C(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}a(C,"getDefaultExportFromNamespaceIfPresent");j(C,"getDefaultExportFromNamespaceIfPresent");function U(t){return t&&Object.prototype.hasOwnProperty.call(t,"default")&&Object.keys(t).length===1?t.default:t}a(U,"getDefaultExportFromNamespaceIfNotNamed");j(U,"getDefaultExportFromNamespaceIfNotNamed");function z(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var c=t.default;if(typeof c=="function"){var u=j(a(function p(){var y=!1;try{y=this instanceof p}catch{}return y?Reflect.construct(c,arguments,this.constructor):c.apply(this,arguments)},"a"),"a");u.prototype=c.prototype}else u={};return Object.defineProperty(u,"__esModule",{value:!0}),Object.keys(t).forEach(function(p){var y=Object.getOwnPropertyDescriptor(t,p);Object.defineProperty(u,p,y.get?y:{enumerable:!0,get:j(function(){return t[p]},"get")})}),u}a(z,"getAugmentedNamespace");j(z,"getAugmentedNamespace");var l={},b={},S;function G(){if(S)return b;S=1;var t=Object.defineProperty,c=a((f,D)=>t(f,"name",{value:D,configurable:!0}),"t");Object.defineProperty(b,"__esModule",{value:!0}),b.isDocumentToRecurOn=b.flatten=b.unique=void 0;function u(f){return[...new Set(f)]}a(u,"unique"),c(u,"unique"),b.unique=u;function p(f){return[].concat(...f)}a(p,"flatten"),c(p,"flatten"),b.flatten=p;function y(f){return typeof f=="object"&&f!==null&&!Array.isArray(f)&&Object.keys(f).length}return a(y,"isDocumentToRecurOn"),c(y,"isDocumentToRecurOn"),b.isDocumentToRecurOn=y,b}a(G,"requireUtils");var E={},I;function H(){return I||(I=1,Object.defineProperty(E,"__esModule",{value:!0})),E}a(H,"requireTypes");var R;function J(){return R||(R=1,(function(t){var c=Object.defineProperty,u=a((e,r)=>c(e,"name",{value:r,configurable:!0}),"u"),p=l&&l.__createBinding||(Object.create?(function(e,r,n,o){o===void 0&&(o=n);var s=Object.getOwnPropertyDescriptor(r,n);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:u(function(){return r[n]},"get")}),Object.defineProperty(e,o,s)}):(function(e,r,n,o){o===void 0&&(o=n),e[o]=r[n]})),y=l&&l.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),f=l&&l.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&p(r,e,n);return y(r,e),r},D=l&&l.__exportStar||function(e,r){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(r,n)&&p(r,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.deepKeysFromList=t.deepKeys=void 0;const v=f(G());D(H(),t);function q(e,r){const n=N(r);return typeof e=="object"&&e!==null?k("",e,n,new WeakSet):[]}a(q,"deepKeys"),u(q,"deepKeys"),t.deepKeys=q;function K(e,r,n){const o=N(r),s=n??new WeakSet;return e.map(d=>typeof d=="object"&&d!==null?s.has(d)?[]:k("",d,o,s):[])}a(K,"deepKeysFromList"),u(K,"deepKeysFromList"),t.deepKeysFromList=K;function k(e,r,n,o){const s=[],d=Object.keys(r);o.add(r);const m=[{obj:r,keys:d,i:0,basePath:e}];for(;m.length;){const O=m[m.length-1];if(O.i>=O.keys.length){m.pop();continue}const F=O.keys[O.i++],i=O.obj[F],P=_(O.basePath,x(F,n));if(n.expandNestedObjects&&v.isDocumentToRecurOn(i)||n.arrayIndexesAsKeys&&Array.isArray(i)&&i.length)if(n.arrayIndexesAsKeys&&Array.isArray(i)){const A=i;for(let h=A.length-1;h>=0;h--){const g=A[h],M=_(P,String(h));typeof g=="object"&&g!==null&&!Array.isArray(g)?o.has(g)||(o.add(g),m.push({obj:g,keys:Object.keys(g),i:0,basePath:M})):s.push(M)}}else o.has(i)||(o.add(i),m.push({obj:i,keys:Object.keys(i),i:0,basePath:P}));else if(n.expandArrayObjects&&Array.isArray(i)){const A=w(i,P,n,o);for(const h of A)s.push(h)}else{if(n.ignoreEmptyArrays&&Array.isArray(i)&&!i.length)continue;s.push(P)}}return v.unique(s)}a(k,"generateDeepKeysList"),u(k,"generateDeepKeysList");function w(e,r,n,o){let s=K(e,n,o);return e.length?e.length&&v.flatten(s).length===0?[r]:(s=s.map(d=>Array.isArray(d)&&d.length===0?[r]:d.map(m=>_(r,x(m,n)))),v.unique(v.flatten(s))):n.ignoreEmptyArraysWhenExpanding?[]:[r]}a(w,"processArrayKeys"),u(w,"processArrayKeys");function x(e,r){return r.escapeNestedDots?e.replace(/\./g,"\\."):e}a(x,"escapeNestedDotsIfSpecified"),u(x,"escapeNestedDotsIfSpecified");function _(e,r){return e?e+"."+r:r}a(_,"buildKeyName"),u(_,"buildKeyName");function N(e){return{arrayIndexesAsKeys:!1,expandNestedObjects:!0,expandArrayObjects:!1,ignoreEmptyArraysWhenExpanding:!1,escapeNestedDots:!1,ignoreEmptyArrays:!1,...e??{}}}a(N,"mergeOptions"),u(N,"mergeOptions")})(l)),l}a(J,"requireDeeks");var L=J();const V=L.deepKeys,X=L.deepKeysFromList;export{V as deepKeys,X as deepKeysFromList,ne as deleteProperty,ae as escapePath,oe as getProperty,se as hasProperty,ie as isPlainObject,$ as omit,te as pick,ue as setProperty};
1
+ import{default as U}from"./packem_shared/omit-DUxizCOe.js";import{default as C}from"./packem_shared/pick-L4PJlDoB.js";import{default as H}from"./packem_shared/isPlainObject-DqcjswLg.js";import{deleteProperty as Q,escapePath as V,getProperty as X,hasProperty as Y,setProperty as Z}from"./packem_shared/deleteProperty-y5ClNSkn.js";var o={},c={},x;function L(){if(x)return c;x=1,Object.defineProperty(c,"__esModule",{value:!0}),c.isDocumentToRecurOn=c.flatten=c.unique=void 0;function y(u){return[...new Set(u)]}c.unique=y;function h(u){return[].concat(...u)}c.flatten=h;function m(u){return typeof u=="object"&&u!==null&&!Array.isArray(u)&&Object.keys(u).length}return c.isDocumentToRecurOn=m,c}var _={},q;function N(){return q||(q=1,Object.defineProperty(_,"__esModule",{value:!0})),_}var S;function T(){return S||(S=1,(function(y){var h=o&&o.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),m=o&&o.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),u=o&&o.__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)&&h(t,e,r);return m(t,e),t},E=o&&o.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&h(t,e,r)};Object.defineProperty(y,"__esModule",{value:!0}),y.deepKeysFromList=y.deepKeys=void 0;const b=u(L());E(N(),y);function M(e,t){const r=k(t);return typeof e=="object"&&e!==null?v("",e,r,new WeakSet):[]}y.deepKeys=M;function A(e,t,r){const n=k(t),s=r??new WeakSet;return e.map(i=>typeof i=="object"&&i!==null?s.has(i)?[]:v("",i,n,s):[])}y.deepKeysFromList=A;function v(e,t,r,n){const s=[],i=Object.keys(t);n.add(t);const f=[{obj:t,keys:i,i:0,basePath:e}];for(;f.length;){const p=f[f.length-1];if(p.i>=p.keys.length){f.pop();continue}const K=p.keys[p.i++],a=p.obj[K],g=O(p.basePath,P(K,r));if(r.expandNestedObjects&&b.isDocumentToRecurOn(a)||r.arrayIndexesAsKeys&&Array.isArray(a)&&a.length)if(r.arrayIndexesAsKeys&&Array.isArray(a)){const j=a;for(let d=j.length-1;d>=0;d--){const l=j[d],D=O(g,String(d));typeof l=="object"&&l!==null&&!Array.isArray(l)?n.has(l)||(n.add(l),f.push({obj:l,keys:Object.keys(l),i:0,basePath:D})):s.push(D)}}else n.has(a)||(n.add(a),f.push({obj:a,keys:Object.keys(a),i:0,basePath:g}));else if(r.expandArrayObjects&&Array.isArray(a)){const j=R(a,g,r,n);for(const d of j)s.push(d)}else{if(r.ignoreEmptyArrays&&Array.isArray(a)&&!a.length)continue;s.push(g)}}return b.unique(s)}function R(e,t,r,n){let s=A(e,r,n);return e.length?e.length&&b.flatten(s).length===0?[t]:(s=s.map(i=>Array.isArray(i)&&i.length===0?[t]:i.map(f=>O(t,P(f,r)))),b.unique(b.flatten(s))):r.ignoreEmptyArraysWhenExpanding?[]:[t]}function P(e,t){return t.escapeNestedDots?e.replace(/\./g,"\\."):e}function O(e,t){return e?e+"."+t:t}function k(e){return{arrayIndexesAsKeys:!1,expandNestedObjects:!0,expandArrayObjects:!1,ignoreEmptyArraysWhenExpanding:!1,escapeNestedDots:!1,ignoreEmptyArrays:!1,...e??{}}}})(o)),o}var w=T();const F=w.deepKeys,I=w.deepKeysFromList;export{F as deepKeys,I as deepKeysFromList,Q as deleteProperty,V as escapePath,X as getProperty,Y as hasProperty,H as isPlainObject,U as omit,C as pick,Z as setProperty};
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
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};
@@ -0,0 +1 @@
1
+ import a from"./isPlainObject-DqcjswLg.js";import{o as m,t as u,i as y}from"./safe-assign-Dy7OR5kT.js";const b=(t,o)=>{for(const r of Object.getOwnPropertySymbols(t))Object.getOwnPropertyDescriptor(t,r)?.enumerable&&(o[r]=t[r])},i=(t,o,r)=>{if(Array.isArray(t)){const s=[];for(const[f,c]of t.entries()){const n=[...r,String(f)];o.some(p=>m(n,p))||s.push(i(c,o,n))}return s}if(!a(t))return t;const e={};for(const[s,f]of Object.entries(t)){const c=[...r,s];o.some(n=>m(c,n))||u(e,s,i(f,o,c))}return b(t,e),e},O=(t,o)=>i(t,o,[]),l=(t,o)=>{const r=o.map(e=>y(e));return O(t,r)};export{l as default};
@@ -0,0 +1 @@
1
+ import m from"./isPlainObject-DqcjswLg.js";import{t as u,o as a,i as h}from"./safe-assign-Dy7OR5kT.js";const l=(o,t)=>t.some(e=>{const r=Math.min(o.length,e.length);return a(o.slice(0,r),e.slice(0,r))}),c=(o,t,e)=>{if(Array.isArray(o)){const n=[];for(const[i,s]of o.entries()){const f=[...e,String(i)];t.length>0&&!l(f,t)||n.push(c(s,t,f))}return n}if(!m(o))return o;const r={};for(const[n,i]of Object.entries(o)){const s=[...e,n];t.length>0&&!l(s,t)||u(r,n,c(i,t,s))}return r},g=(o,t)=>c(o,t,[]),A=(o,t)=>{if(t.length===0)return{};const e=t.map(r=>h(r));return g(o,e)};export{A as default};
@@ -0,0 +1 @@
1
+ const u=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},f=(r,t)=>{if(r.length!==t.length)return!1;for(const[e,n]of t.entries())if(n!=="*"&&n!==r[e])return!1;return!0},i=(r,t,e)=>{if(t==="__proto__"){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0});return}r[t]=e};export{u as i,f as o,i as t};
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "@visulima/object",
3
- "version": "3.0.0-alpha.9",
3
+ "version": "3.0.0",
4
4
  "description": "Helper functions for working with objects and arrays.",
5
5
  "keywords": [
6
- "visulima",
7
6
  "access",
8
7
  "del",
9
8
  "delete",
10
- "dot notation",
11
9
  "dot",
10
+ "dot notation",
12
11
  "dotty",
13
12
  "get",
14
13
  "notation",
@@ -19,12 +18,11 @@
19
18
  "property",
20
19
  "set",
21
20
  "transform",
22
- "typescript"
21
+ "typescript",
22
+ "visulima"
23
23
  ],
24
24
  "homepage": "https://visulima.com/packages/object",
25
- "bugs": {
26
- "url": "https://github.com/visulima/visulima/issues"
27
- },
25
+ "bugs": "https://github.com/visulima/visulima/issues",
28
26
  "repository": {
29
27
  "type": "git",
30
28
  "url": "git+https://github.com/visulima/visulima.git",
@@ -60,10 +58,10 @@
60
58
  "CHANGELOG.md"
61
59
  ],
62
60
  "dependencies": {
63
- "type-fest": "5.5.0"
61
+ "type-fest": "5.7.0"
64
62
  },
65
63
  "engines": {
66
- "node": ">=22.13 <=25.x"
64
+ "node": "^22.14.0 || >=24.10.0"
67
65
  },
68
66
  "publishConfig": {
69
67
  "access": "public",
package/dist/omit.d.ts DELETED
@@ -1,18 +0,0 @@
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;
@@ -1 +0,0 @@
1
- var $=Object.defineProperty;var f=(e,r)=>$(e,"name",{value:r,configurable:!0});var A=Object.defineProperty,a=f((e,r)=>A(e,"name",{value:r,configurable:!0}),"f");const p=a(e=>{const r=typeof e;return e!==null&&(r==="object"||r==="function")},"isObject"),I=a(e=>{if(!p(e))return!1;for(const r in e)if(Object.hasOwn(e,r))return!1;return!0},"isEmptyObject"),g=new Set(["__proto__","prototype","constructor"]),b=1e6,N=a(e=>e>="0"&&e<="9","isDigit");function c(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<=b}return!1}f(c,"p");a(c,"shouldCoerceToNumber");function h(e,r){return g.has(e)?!1:(e&&c(e)?r.push(Number.parseInt(e,10)):r.push(e),!0)}f(h,"y");a(h,"processSegment");function w(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(!h(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")&&!h(n,r))return[];n=""}t="index";break}case"]":{if(t==="index"){if(n==="")n=(r.pop()||"")+"[]",t="property";else{const u=Number.parseInt(n,10);!Number.isNaN(u)&&Number.isFinite(u)&&u>=0&&u<=Number.MAX_SAFE_INTEGER&&u<=b&&n===String(u)?r.push(u):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"&&!N(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(!h(n,r))return[];break}case"index":throw new Error("Index was not closed");case"start":{r.push("");break}}return r}f(w,"parsePath");a(w,"parsePath");function y(e){if(typeof e=="string")return w(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(g.has(t))return[];typeof t=="string"&&c(t)?r.push(Number.parseInt(t,10)):r.push(t)}return r}return[]}f(y,"d");a(y,"normalizePath");function P(e,r,n){if(!p(e)||typeof r!="string"&&!Array.isArray(r))return n===void 0?e:n;const t=y(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}f(P,"getProperty");a(P,"getProperty");function E(e,r,n){if(!p(e)||typeof r!="string"&&!Array.isArray(r))return e;const t=e,o=y(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(!p(e[s])){const u=typeof o[i+1]=="number";e[s]=u?[]:{}}e=e[s]}return t}f(E,"setProperty");a(E,"setProperty");function v(e,r){if(!p(e)||typeof r!="string"&&!Array.isArray(r))return!1;const n=y(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],!p(e))return!1}}f(v,"deleteProperty");a(v,"deleteProperty");function j(e,r){if(!p(e)||typeof r!="string"&&!Array.isArray(r))return!1;const n=y(r);if(n.length===0)return!1;for(const t of n){if(!p(e)||!(t in e))return!1;e=e[t]}return!0}f(j,"hasProperty");a(j,"hasProperty");function l(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return e.replaceAll(/[\\.[]/g,String.raw`\$&`)}f(l,"escapePath");a(l,"escapePath");function m(e){const r=Object.entries(e);return Array.isArray(e)?r.map(([n,t])=>[c(n)?Number.parseInt(n,10):n,t]):r}f(m,"m");a(m,"normalizeEntries");function x(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=l(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(c(i)){const s=Number.parseInt(i,10);n&&o>0?t.push(`.${s}`):t.push(`[${s}]`)}else{const s=l(i);t.push(o===0?s:`.${s}`)}}return t.join("")}f(x,"stringifyPath");a(x,"stringifyPath");function*d(e,r=[],n=new Set){if(!p(e)||I(e)){r.length>0&&(yield x(r));return}if(!n.has(e)){n.add(e);for(const[t,o]of m(e))r.push(t),yield*d(o,r,n),r.pop();n.delete(e)}}f(d,"x");a(d,"deepKeysIterator");function k(e){return[...d(e)]}f(k,"deepKeys");a(k,"deepKeys");function O(e){const r={};if(!p(e))return r;for(const[n,t]of Object.entries(e))E(r,n,t);return r}f(O,"unflatten");a(O,"unflatten");export{k as deepKeys,v as deleteProperty,l as escapePath,P as getProperty,j as hasProperty,w as parsePath,E as setProperty,x as stringifyPath,O as unflatten};
@@ -1 +0,0 @@
1
- var r=Object.defineProperty;var o=(e,t)=>r(e,"name",{value:t,configurable:!0});var n=Object.defineProperty,l=o((e,t)=>n(e,"name",{value:t,configurable:!0}),"e");function a(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}o(a,"r");l(a,"isPlainObject");export{a as default};
@@ -1 +0,0 @@
1
- var v=Object.defineProperty;var i=(r,e)=>v(r,"name",{value:e,configurable:!0});import m from"./isPlainObject-CLTs8VdF.js";import{c as s}from"./paths-are-equal-BYur8Hqc.js";var b=Object.defineProperty,p=i((r,e)=>b(r,"name",{value:e,configurable:!0}),"m$1");const u=p((r,e,l="")=>m(r)?Object.entries(r).reduce((a,[o,n])=>{let t=l;return t&&(t+="."),t+=o,e.some(f=>s(t,f))?a:m(n)?(a[o]=u(r[o],e,t),a):(a[o]=n,a)},{}):r,"recursiveOmit");var y=Object.defineProperty,c=i((r,e)=>y(r,"name",{value:e,configurable:!0}),"r");const d=c(r=>Array.isArray(r)&&r.length>0,"isFullArray"),A=c((r,e)=>d(e)?u(r,e):r,"omit");export{A as default};
@@ -1 +0,0 @@
1
- var s=Object.defineProperty;var n=(r,e)=>s(r,"name",{value:e,configurable:!0});var p=Object.defineProperty,l=n((r,e)=>p(r,"name",{value:e,configurable:!0}),"n");const d=l((r,e)=>{const o=e.split(".");return r.split(".").reduce((t,u,a)=>{const c=o[a]==="*"?"*":u;return t.push(c),t},[]).join(".")===e},"pathsAreEqual");export{d as c};
@@ -1 +0,0 @@
1
- var b=Object.defineProperty;var a=(e,r)=>b(e,"name",{value:r,configurable:!0});import u from"./isPlainObject-CLTs8VdF.js";import{c as d}from"./paths-are-equal-BYur8Hqc.js";var j=Object.defineProperty,y=a((e,r)=>j(e,"name",{value:r,configurable:!0}),"h");const s=y((e,r,p="")=>u(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(o=>{const v=t.split(".").length,g=o.split(".").length,h=o.split(".").slice(0,v).join("."),m=t.split(".").slice(0,g).join(".");d(m,h)&&(n=!0)}),!n)return i}return u(c)?(i[l]=s(e[l],r,t),i):(i[l]=c,i)},{}):e,"recursivePick");var P=Object.defineProperty,f=a((e,r)=>P(e,"name",{value:r,configurable:!0}),"t");const A=f(e=>Array.isArray(e)&&e.length>0,"isFullArray"),E=f((e,r)=>A(r)?s(e,r):{},"pick");export{E as default};
package/dist/pick.d.ts DELETED
@@ -1,18 +0,0 @@
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;
@@ -1,15 +0,0 @@
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;
@@ -1,3 +0,0 @@
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;
@@ -1,3 +0,0 @@
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;