hfg-gmuend / gmynd

A utility library for working with data in Javascript
15 stars 1 forks source link

combining deleteProps() and deletePropsInData() #9

Closed caitoor closed 3 years ago

caitoor commented 3 years ago

Would you mind combining deleteProps() and deletePropsInData()? We would only have to check the data type of the first parameter and - in the case of a passed object - convert this object into an array of objects with length 1. We would use deletePropsInData(), which could then be renamed deleteProps().

bohnacker commented 3 years ago

Good idea to combine both!

bohnacker commented 3 years ago

Still, it would be good to return an object (and not an array of length 1) if an object was passed as the first parameter.

caitoor commented 3 years ago

done; the mutated array/object is now returned (or unchanged data if prop type is wrong). Before, the passed data was mutated and not returned.