78f75ec7d1
fix: allow to use another type than an object when possible
...
CodeQL / Analyze (javascript) (push) Has started running
Signed-off-by: Avior <git@avior.me>
2024-06-12 12:44:44 +02:00
fe2e5a3bdc
fix: when path is empty it should return the current object
...
Signed-off-by: Avior <git@avior.me>
2024-06-10 23:36:53 +02:00
dc8b25b803
fix(object-util): objectGet with an empty path throwing the incorrect error
...
Signed-off-by: Avior <git@avior.me>
2024-06-06 17:14:37 +02:00
0062c02255
feat(object-util): add an objectGet function
...
Signed-off-by: Avior <git@avior.me>
2024-06-03 17:30:02 +02:00
a1cd24f399
feat: Add objectFind
to the object-util lib
...
Signed-off-by: Florian BOUILLON <f.bouillon@aptatio.com>
2023-09-04 13:44:24 +02:00
cfbc85580c
fix: Test for deep clone when option is manually set
...
Signed-off-by: Avior <f.bouillon@aptatio.com>
2023-03-14 11:00:49 +01:00
446355b451
feat: Add option to clean falsy values in object clean
...
Add a new option to `objectClean` function which allows to clean falsy values (including `undefined` and `null`) from an object when set to `true`. This is achieved by deleting all the falsy values from the object when the option is enabled.
The change also includes updates to the corresponding tests.
Signed-off-by: Avior <f.bouillon@aptatio.com>
2023-03-14 11:00:19 +01:00
fd24924d10
feat: introduce objectRemap function
...
This commit introduces a new function `objectRemap` in `object-util` package. It takes an object as input and applies the provided mapping function to each key-value pair. It produces a new object with transformed keys and values.
The `objectRemap` function is more advanced than `objectMap` as it transforms an object back into another object. It works on objects and arrays. If multiple keys are the same, only the last value will be set by default, but enabling the `strict` option will throw an error if the same key is set twice.
This commit also updates the import statement in tests for this new function.
Signed-off-by: Avior <f.bouillon@aptatio.com>
2023-03-14 10:54:46 +01:00
c664af98ba
fix: Add tests to have a better array support
...
Signed-off-by: Avior <f.bouillon@aptatio.com>
2023-03-14 10:49:49 +01:00
a1304e7349
fix: handle arrays with empty elements
...
Signed-off-by: Avior <f.bouillon@aptatio.com>
2023-02-22 16:31:52 +01:00
f515091ac5
Updated tests and documentation to be more clear
...
Signed-off-by: Avior <github@avior.me>
2021-11-18 17:38:19 +01:00
9f608a52fc
Fixed Object.freeze throwing error with objectOmit ( #46 )
...
Signed-off-by: Avior <github@avior.me>
2021-09-29 17:15:52 +02:00
cb97ded195
Add objectOmit function
...
- also bump deps (not parcel because 2 is not the way I want to continue using it)
Signed-off-by: Avior <github@avior.me>
2021-09-28 11:47:33 +02:00
4efb33c0cb
Added objectClean and isObject functions
...
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
2021-09-21 21:39:16 +02:00
73ac335ea8
Moved deprecated tests to a new file
...
Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
2021-05-21 16:21:52 +02:00
0b084833a3
Added addional tests
...
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
2021-04-11 01:37:35 +02:00
acd5b781cf
Merge branch 'master' of github.com:dzeiocom/libs
...
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
2021-04-11 00:37:50 +02:00
76e2263812
Updated objectSort to support an Array containing a specific order
...
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
2021-04-11 00:34:14 +02:00
980caaf3b3
Implement fix + tests ( #14 )
...
Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
2021-02-08 10:53:17 +01:00
f87e3047fc
Fixed bug where null were considered as objects
...
Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
2020-11-23 02:27:16 +01:00
5c230d74e5
Added Tests and Documentation
...
Signed-off-by: Florian Bouillon <florian.bouillon@delta-wings.net>
2020-10-20 15:11:30 +02:00
7e3fe2f7f1
Added ObjectUtil
...
Signed-off-by: Florian Bouillon <florian.bouillon@delta-wings.net>
2020-09-11 10:43:07 +02:00