@visulima/object 3.0.0-alpha.9 → 3.1.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 +196 -0
- package/LICENSE.md +1 -40
- package/README.md +80 -23
- package/dist/index.d.ts +207 -7
- package/dist/index.js +1 -1
- package/dist/packem_shared/deleteProperty-y5ClNSkn.js +1 -0
- package/dist/packem_shared/isPlainObject-DqcjswLg.js +1 -0
- package/dist/packem_shared/omit-BVHtDcCP.js +1 -0
- package/dist/packem_shared/pick-Fkm4vY-x.js +1 -0
- package/dist/packem_shared/split-path-DEreWCls.js +1 -0
- package/package.json +7 -9
- package/dist/omit.d.ts +0 -18
- package/dist/packem_shared/getProperty-DPNB_aKG.js +0 -1
- package/dist/packem_shared/isPlainObject-CLTs8VdF.js +0 -1
- package/dist/packem_shared/omit-BfV-sPAM.js +0 -1
- package/dist/packem_shared/paths-are-equal-BYur8Hqc.js +0 -1
- package/dist/packem_shared/pick-CT4qE7de.js +0 -1
- package/dist/pick.d.ts +0 -18
- package/dist/utils/paths-are-equal.d.ts +0 -15
- package/dist/utils/recursive-omit.d.ts +0 -3
- package/dist/utils/recursive-pick.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,199 @@
|
|
|
1
|
+
## @visulima/object [3.1.0](https://github.com/visulima/visulima/compare/%40visulima%2Fobject%403.0.0...%40visulima%2Fobject%403.1.0) (2026-08-02)
|
|
2
|
+
|
|
3
|
+
## @visulima/object [3.0.0](https://github.com/visulima/visulima/compare/@visulima/object@2.0.4...@visulima/object@3.0.0) (2026-07-03)
|
|
4
|
+
|
|
5
|
+
### ⚠ BREAKING CHANGES
|
|
6
|
+
|
|
7
|
+
* change min node version to 22.13
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **web:** auto-generate packages page from workspace metadata ([623e520](https://github.com/visulima/visulima/commit/623e5207693a7fe720f5f2f179593a3654c880e3))
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* add new package image, fixed readme rendering on npm, fixed building of packages ([b790ba2](https://github.com/visulima/visulima/commit/b790ba253ea07fef83528fd822a678facf021b5f))
|
|
16
|
+
* **data-manipulation:** resolve eslint and type-safety issues ([f1682c2](https://github.com/visulima/visulima/commit/f1682c2611cbcc6c85d4bbea520d43464b42e7ee))
|
|
17
|
+
* **object:** 1 bug fix + 1 perf ([d317d30](https://github.com/visulima/visulima/commit/d317d30cf89629f3a2cea5a1f7a6e9b3967c86d4))
|
|
18
|
+
* **object:** fix broken types, array/escape paths and docs ([7c560b1](https://github.com/visulima/visulima/commit/7c560b175507231ba3d50a18faa372283f6fb13c))
|
|
19
|
+
* **object:** pass OmittedKeys/PickedKeys generics to recursive calls ([1943c39](https://github.com/visulima/visulima/commit/1943c3912844b133611fe5d207c52a0f78ef51dc))
|
|
20
|
+
* **object:** suppress eslint rules for recursive utility type patterns ([f68ce68](https://github.com/visulima/visulima/commit/f68ce68b45c6d03cf072bdf9d632478e7c7cd8eb))
|
|
21
|
+
* **object:** update package files ([5a8dad8](https://github.com/visulima/visulima/commit/5a8dad850ba0089bbd1dbd79070b49d42ea16b88))
|
|
22
|
+
* **object:** update packem to 2.0.0-alpha.54 ([a539ca7](https://github.com/visulima/visulima/commit/a539ca75ba8307c4402edc9e79d192dbb4aecf06))
|
|
23
|
+
* 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))
|
|
24
|
+
* **storage-client:** percent-encode user fields in defaultFingerprint ([7c78a0f](https://github.com/visulima/visulima/commit/7c78a0f9512e2a673b941d80839e9f1e86b7b5d0))
|
|
25
|
+
* 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))
|
|
26
|
+
* update package OG images across multiple packages ([f08e4dd](https://github.com/visulima/visulima/commit/f08e4dd2b105ccb29c8412020a9c2be36d6c1e9e))
|
|
27
|
+
* **web:** improve build setup with incremental stats caching and prod install ([fe33e75](https://github.com/visulima/visulima/commit/fe33e75827586779b4b3a0c6d57b39f889ee6207))
|
|
28
|
+
|
|
29
|
+
### Documentation
|
|
30
|
+
|
|
31
|
+
* **object,redact,colorize,path,fs:** add comprehensive Fumadocs documentation ([19c3840](https://github.com/visulima/visulima/commit/19c384041db855e1c2de41ce2067458b39737565))
|
|
32
|
+
|
|
33
|
+
### Styles
|
|
34
|
+
|
|
35
|
+
* cs fixes ([2a960bb](https://github.com/visulima/visulima/commit/2a960bb1772c9dc70080e2d75d3a0d827034e294))
|
|
36
|
+
|
|
37
|
+
### Miscellaneous Chores
|
|
38
|
+
|
|
39
|
+
* add fallow code-intelligence across all packages ([a3b4821](https://github.com/visulima/visulima/commit/a3b48215002e86fed20f2973038b5d4a0aa1ce04))
|
|
40
|
+
* **api-platform:** apply pending lint and source updates ([3fb0043](https://github.com/visulima/visulima/commit/3fb0043a4cf35f752ca89a09a077100ae0142da8))
|
|
41
|
+
* apply eslint + prettier autofixes across packages ([c1bb784](https://github.com/visulima/visulima/commit/c1bb7848a0d93d0dfe2960c77e3cda22239c79a0))
|
|
42
|
+
* apply linting and formatting fixes across packages ([5d150a5](https://github.com/visulima/visulima/commit/5d150a578f9ce861c791843c683deeb849b774a9))
|
|
43
|
+
* apply safe prettier and eslint formatting ([05120af](https://github.com/visulima/visulima/commit/05120af8c898d18c495575680f01134681e29b65))
|
|
44
|
+
* bump engines.node to ^22.14.0 || >=24.10.0 ([c3d0931](https://github.com/visulima/visulima/commit/c3d0931d1504e4f21ebf50ea680cfa7ce4ba15ce))
|
|
45
|
+
* **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))
|
|
46
|
+
* **data-manipulation:** remove empty dependency objects from package.json ([c0e8f76](https://github.com/visulima/visulima/commit/c0e8f7689a2da413f771494f6ecb07babc4b5e06))
|
|
47
|
+
* **data-manipulation:** update dependencies ([49458ab](https://github.com/visulima/visulima/commit/49458ab8f8e17d875840b1b4fe8b5efe12ff3513))
|
|
48
|
+
* **fallow:** resolve dead-code findings ([c4125d5](https://github.com/visulima/visulima/commit/c4125d53e03ac9d90115399634535991927a96cc))
|
|
49
|
+
* fixed jsr.json ([5d85e51](https://github.com/visulima/visulima/commit/5d85e5179de38e284ec433b14d77c71a1619c8d6))
|
|
50
|
+
* fixed project.json names and schema path ([964722f](https://github.com/visulima/visulima/commit/964722f691db205c7edb9aa6db29e849a647500b))
|
|
51
|
+
* jsr.json update and lock file ([73fce38](https://github.com/visulima/visulima/commit/73fce38c7cb4603f3fffb88609b1b18e2feb4937))
|
|
52
|
+
* moved all packages into groups ([0615e9d](https://github.com/visulima/visulima/commit/0615e9d14a8a886e11da529ce150cf31ca973c10))
|
|
53
|
+
* **object:** add tsconfig.eslint.json for type-aware linting ([f22e998](https://github.com/visulima/visulima/commit/f22e998b368ad0de17cf8b71280a67c9d98070d0))
|
|
54
|
+
* **object:** apply auto-fix formatting ([2e94ac5](https://github.com/visulima/visulima/commit/2e94ac5afa7cf890d1f37a5fa7a7a0cf961087e4))
|
|
55
|
+
* **object:** apply formatter sweep and clean license attribution ([697adb2](https://github.com/visulima/visulima/commit/697adb268bb007cf4f6983f4a89a1258a9ff208d))
|
|
56
|
+
* **object:** apply pending changes ([0420964](https://github.com/visulima/visulima/commit/0420964a5ddbc16a02e5e2a80d65efaf0464fcca))
|
|
57
|
+
* **object:** apply prettier and eslint quote-style auto-fix ([fb4c54f](https://github.com/visulima/visulima/commit/fb4c54f719e6ca1d03ac56c7f9f9067f9731f17e))
|
|
58
|
+
* **object:** apply prettier formatting ([893b38f](https://github.com/visulima/visulima/commit/893b38f86b7f22f9f65bb8a02812bf5b1de1e051))
|
|
59
|
+
* **object:** fix lint errors ([386c5f0](https://github.com/visulima/visulima/commit/386c5f0f6e36d0491e674c03196710a40f1e91c0))
|
|
60
|
+
* **object:** housekeeping cleanup ([99d38b2](https://github.com/visulima/visulima/commit/99d38b214e62548810b2b362bd8b9483e242fdcc))
|
|
61
|
+
* **object:** migrate .prettierrc.cjs to prettier.config.js ([6fd82bc](https://github.com/visulima/visulima/commit/6fd82bcb393bcc3e8f7223210dc18f421949ab17))
|
|
62
|
+
* **object:** migrate deps to pnpm catalogs ([690cca3](https://github.com/visulima/visulima/commit/690cca39fa4903d1538e830340c07392e4d358ae))
|
|
63
|
+
* **object:** update dependencies ([5ebd3d5](https://github.com/visulima/visulima/commit/5ebd3d5c6a7001877b4ad4f8e877f1dc78b60d1e))
|
|
64
|
+
* **object:** update dependencies ([173c843](https://github.com/visulima/visulima/commit/173c843f32aa8d019ba08fc6a2571a2bca22884e))
|
|
65
|
+
* **object:** update dependencies ([8a9ce76](https://github.com/visulima/visulima/commit/8a9ce763a67693643324f8c31850dcd88938fffc))
|
|
66
|
+
* **object:** upgrade packem to 2.0.0-alpha.76 ([729158f](https://github.com/visulima/visulima/commit/729158f5a0d8a445227c7df7170f3bd7654e0546))
|
|
67
|
+
* re-sort workspace package.json files via vis sort-package-json ([f625696](https://github.com/visulima/visulima/commit/f625696cfac974325774b3243e1a83c3d23acbd7))
|
|
68
|
+
* **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))
|
|
69
|
+
* **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))
|
|
70
|
+
* **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))
|
|
71
|
+
* **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))
|
|
72
|
+
* **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))
|
|
73
|
+
* **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))
|
|
74
|
+
* **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))
|
|
75
|
+
* **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))
|
|
76
|
+
* **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))
|
|
77
|
+
* **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))
|
|
78
|
+
* **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))
|
|
79
|
+
* **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))
|
|
80
|
+
* **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))
|
|
81
|
+
* **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))
|
|
82
|
+
* **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))
|
|
83
|
+
* **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))
|
|
84
|
+
* **repo:** sort package.json keys across all packages ([e1fd9ab](https://github.com/visulima/visulima/commit/e1fd9ab467ef96a98c777da1572ff6a50fcf7e71))
|
|
85
|
+
* sorted package.json ([b47c545](https://github.com/visulima/visulima/commit/b47c545591600fdab17d5cd3a3fbc68b61e199da))
|
|
86
|
+
* 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))
|
|
87
|
+
* 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))
|
|
88
|
+
* update lock file maintenance ([d83e716](https://github.com/visulima/visulima/commit/d83e71697b75d24704185b66bb521a934d2db02d))
|
|
89
|
+
* update the jsr.json ([864ab7e](https://github.com/visulima/visulima/commit/864ab7e71c4b5ae82f64792d1ae8debfea2c539b))
|
|
90
|
+
* visulima website ([#591](https://github.com/visulima/visulima/issues/591)) ([59ab2e2](https://github.com/visulima/visulima/commit/59ab2e2befb03e51cd2088956f83d9b87de6d033))
|
|
91
|
+
* year update ([47f4105](https://github.com/visulima/visulima/commit/47f410596ce7190cfea36a073db32e0cec50bbcd))
|
|
92
|
+
|
|
93
|
+
### Code Refactoring
|
|
94
|
+
|
|
95
|
+
* **docs:** migrate Nextra components to fumadocs-ui, remove Nextra stripping ([484878f](https://github.com/visulima/visulima/commit/484878f01879363ef5e9a0282904dc4627d6060c))
|
|
96
|
+
* **object:** apply prettier/eslint formatting cleanup ([b293527](https://github.com/visulima/visulima/commit/b293527bc95a2b260665c98f5b7206996f23ac91))
|
|
97
|
+
|
|
98
|
+
### Tests
|
|
99
|
+
|
|
100
|
+
* **object:** add safe-assign coverage ([0dc5c7b](https://github.com/visulima/visulima/commit/0dc5c7bb14a59595b3ec2f5f37f64842eefad26e))
|
|
101
|
+
* **object:** cover recursive pick/omit non-plain-object and empty-keys branches ([79c3498](https://github.com/visulima/visulima/commit/79c34986008e0633e61a4be39dc18c2b02589e3d))
|
|
102
|
+
* **repo:** add dist runtime + types integration tests ([32ee300](https://github.com/visulima/visulima/commit/32ee300b7184117a0ddf9f9d390f75f8932d5ed9))
|
|
103
|
+
|
|
104
|
+
### Build System
|
|
105
|
+
|
|
106
|
+
* regenerate bundled-license manifests and types ordering ([af26588](https://github.com/visulima/visulima/commit/af26588d75aaa937fd4862800560bd4070a4878c))
|
|
107
|
+
|
|
108
|
+
### Continuous Integration
|
|
109
|
+
|
|
110
|
+
* **fallow:** make fallow:health advisory (--report-only) ([d57148e](https://github.com/visulima/visulima/commit/d57148ea0e3556b4c24d8d336b9fa14987f5dc7d))
|
|
111
|
+
|
|
112
|
+
## @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)
|
|
113
|
+
|
|
114
|
+
### Bug Fixes
|
|
115
|
+
|
|
116
|
+
* **object:** fix broken types, array/escape paths and docs ([7c560b1](https://github.com/visulima/visulima/commit/7c560b175507231ba3d50a18faa372283f6fb13c))
|
|
117
|
+
|
|
118
|
+
### Miscellaneous Chores
|
|
119
|
+
|
|
120
|
+
* apply safe prettier and eslint formatting ([05120af](https://github.com/visulima/visulima/commit/05120af8c898d18c495575680f01134681e29b65))
|
|
121
|
+
|
|
122
|
+
### Code Refactoring
|
|
123
|
+
|
|
124
|
+
* **object:** apply prettier/eslint formatting cleanup ([b293527](https://github.com/visulima/visulima/commit/b293527bc95a2b260665c98f5b7206996f23ac91))
|
|
125
|
+
|
|
126
|
+
### Tests
|
|
127
|
+
|
|
128
|
+
* **object:** add safe-assign coverage ([0dc5c7b](https://github.com/visulima/visulima/commit/0dc5c7bb14a59595b3ec2f5f37f64842eefad26e))
|
|
129
|
+
|
|
130
|
+
### Build System
|
|
131
|
+
|
|
132
|
+
* regenerate bundled-license manifests and types ordering ([af26588](https://github.com/visulima/visulima/commit/af26588d75aaa937fd4862800560bd4070a4878c))
|
|
133
|
+
|
|
134
|
+
## @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)
|
|
135
|
+
|
|
136
|
+
### Bug Fixes
|
|
137
|
+
|
|
138
|
+
* **object:** 1 bug fix + 1 perf ([d317d30](https://github.com/visulima/visulima/commit/d317d30cf89629f3a2cea5a1f7a6e9b3967c86d4))
|
|
139
|
+
|
|
140
|
+
### Miscellaneous Chores
|
|
141
|
+
|
|
142
|
+
* apply eslint + prettier autofixes across packages ([c1bb784](https://github.com/visulima/visulima/commit/c1bb7848a0d93d0dfe2960c77e3cda22239c79a0))
|
|
143
|
+
|
|
144
|
+
### Tests
|
|
145
|
+
|
|
146
|
+
* **object:** cover recursive pick/omit non-plain-object and empty-keys branches ([79c3498](https://github.com/visulima/visulima/commit/79c34986008e0633e61a4be39dc18c2b02589e3d))
|
|
147
|
+
|
|
148
|
+
## @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)
|
|
149
|
+
|
|
150
|
+
### Bug Fixes
|
|
151
|
+
|
|
152
|
+
* **storage-client:** percent-encode user fields in defaultFingerprint ([7c78a0f](https://github.com/visulima/visulima/commit/7c78a0f9512e2a673b941d80839e9f1e86b7b5d0))
|
|
153
|
+
|
|
154
|
+
### Miscellaneous Chores
|
|
155
|
+
|
|
156
|
+
* **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))
|
|
157
|
+
* **object:** apply formatter sweep and clean license attribution ([697adb2](https://github.com/visulima/visulima/commit/697adb268bb007cf4f6983f4a89a1258a9ff208d))
|
|
158
|
+
* **object:** apply prettier and eslint quote-style auto-fix ([fb4c54f](https://github.com/visulima/visulima/commit/fb4c54f719e6ca1d03ac56c7f9f9067f9731f17e))
|
|
159
|
+
* **object:** fix lint errors ([386c5f0](https://github.com/visulima/visulima/commit/386c5f0f6e36d0491e674c03196710a40f1e91c0))
|
|
160
|
+
* **object:** housekeeping cleanup ([99d38b2](https://github.com/visulima/visulima/commit/99d38b214e62548810b2b362bd8b9483e242fdcc))
|
|
161
|
+
* **object:** upgrade packem to 2.0.0-alpha.76 ([729158f](https://github.com/visulima/visulima/commit/729158f5a0d8a445227c7df7170f3bd7654e0546))
|
|
162
|
+
* re-sort workspace package.json files via vis sort-package-json ([f625696](https://github.com/visulima/visulima/commit/f625696cfac974325774b3243e1a83c3d23acbd7))
|
|
163
|
+
* **repo:** sort package.json keys across all packages ([e1fd9ab](https://github.com/visulima/visulima/commit/e1fd9ab467ef96a98c777da1572ff6a50fcf7e71))
|
|
164
|
+
* sorted package.json ([b47c545](https://github.com/visulima/visulima/commit/b47c545591600fdab17d5cd3a3fbc68b61e199da))
|
|
165
|
+
|
|
166
|
+
### Tests
|
|
167
|
+
|
|
168
|
+
* **repo:** add dist runtime + types integration tests ([32ee300](https://github.com/visulima/visulima/commit/32ee300b7184117a0ddf9f9d390f75f8932d5ed9))
|
|
169
|
+
|
|
170
|
+
## @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)
|
|
171
|
+
|
|
172
|
+
### Bug Fixes
|
|
173
|
+
|
|
174
|
+
* 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))
|
|
175
|
+
|
|
176
|
+
## @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)
|
|
177
|
+
|
|
178
|
+
### Miscellaneous Chores
|
|
179
|
+
|
|
180
|
+
* jsr.json update and lock file ([73fce38](https://github.com/visulima/visulima/commit/73fce38c7cb4603f3fffb88609b1b18e2feb4937))
|
|
181
|
+
|
|
182
|
+
## @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)
|
|
183
|
+
|
|
184
|
+
### Miscellaneous Chores
|
|
185
|
+
|
|
186
|
+
* update the jsr.json ([864ab7e](https://github.com/visulima/visulima/commit/864ab7e71c4b5ae82f64792d1ae8debfea2c539b))
|
|
187
|
+
|
|
188
|
+
## @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)
|
|
189
|
+
|
|
190
|
+
### Miscellaneous Chores
|
|
191
|
+
|
|
192
|
+
* **api-platform:** apply pending lint and source updates ([3fb0043](https://github.com/visulima/visulima/commit/3fb0043a4cf35f752ca89a09a077100ae0142da8))
|
|
193
|
+
* bump engines.node to ^22.14.0 || >=24.10.0 ([c3d0931](https://github.com/visulima/visulima/commit/c3d0931d1504e4f21ebf50ea680cfa7ce4ba15ce))
|
|
194
|
+
* fixed jsr.json ([5d85e51](https://github.com/visulima/visulima/commit/5d85e5179de38e284ec433b14d77c71a1619c8d6))
|
|
195
|
+
* **object:** apply pending changes ([0420964](https://github.com/visulima/visulima/commit/0420964a5ddbc16a02e5e2a80d65efaf0464fcca))
|
|
196
|
+
|
|
1
197
|
## @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
198
|
|
|
3
199
|
### 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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
|
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
|
-
|
|
79
|
-
//
|
|
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
|
-
//
|
|
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
|
|
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
|
-
|
|
97
|
-
//
|
|
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
|
-
//
|
|
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
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
1
|
+
import{default as U}from"./packem_shared/omit-BVHtDcCP.js";import{default as C}from"./packem_shared/pick-Fkm4vY-x.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{e as a,t as i,a as m,i as u}from"./split-path-DEreWCls.js";import p from"./isPlainObject-DqcjswLg.js";const g=(t,o)=>{const s=[];for(const[r,n]of t.entries()){const e=a(o,String(r));e.some(c=>c.length===0)||s.push(f(n,e))}return s},h=(t,o)=>{const s={};for(const[r,n]of Object.entries(t)){const e=a(o,r);e.some(c=>c.length===0)||i(s,r,f(n,e))}return m(t,s),s},f=(t,o)=>Array.isArray(t)?g(t,o):p(t)?h(t,o):t,l=(t,o)=>f(t,o),b=(t,o)=>{const s=o.map(r=>u(r));return l(t,s)};export{b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as g,a as y,e as m,i as h}from"./split-path-DEreWCls.js";import a from"./isPlainObject-DqcjswLg.js";const s=Symbol("nothing"),f=t=>{if(Array.isArray(t))return t.map(r=>f(r));if(!a(t))return t;const e={};for(const[r,o]of Object.entries(t))g(e,r,f(o));return y(t,e),e},p=(t,e)=>{const r=[];for(const[o,c]of t.entries()){const i=m(e,String(o));if(i.length===0)continue;const n=u(c,i);n!==s&&r.push(n)}return r.length>0?r:s},A=(t,e)=>{const r={};let o=!1;for(const[c,i]of Object.entries(t)){const n=m(e,c);if(n.length===0)continue;const l=u(i,n);l!==s&&(g(r,c,l),o=!0)}return o?r:s},u=(t,e)=>e.some(r=>r.length===0)?f(t):Array.isArray(t)?p(t,e):a(t)?A(t,e):s,b=(t,e)=>{const r=u(t,e);return r!==s?r:a(t)||Array.isArray(t)?{}:t},S=(t,e)=>{if(e.length===0)return{};const r=e.map(o=>h(o));return b(t,r)};export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const s=(r,t)=>{for(const e of Object.getOwnPropertySymbols(r))Object.getOwnPropertyDescriptor(r,e)?.enumerable&&(t[e]=r[e])},c=(r,t)=>{const e=[];for(const n of r){const[o]=n;(o==="*"||o===t)&&e.push(n.slice(1))}return e},u=(r,t,e)=>{if(t==="__proto__"){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,value:e,writable:!0});return}r[t]=e},f=r=>{const t=[];let e="",n=!1;for(const o of r){if(n){e+=o==="."||o==="\\"?o:`\\${o}`,n=!1;continue}if(o==="\\"){n=!0;continue}if(o==="."){t.push(e),e="";continue}e+=o}return n&&(e+="\\"),t.push(e),t};export{s as a,c as e,f as i,u as t};
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/object",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.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.
|
|
61
|
+
"type-fest": "5.7.0"
|
|
64
62
|
},
|
|
65
63
|
"engines": {
|
|
66
|
-
"node": "
|
|
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;
|