deep-map-keys
deep-map-keys copied to clipboard
Stripping dates
The library appears to strip dates from the values of the object.
let thing = {time:new Date()}; let transformed = deepMapKeys(thing, item=>item); console.log(thing); console.log(transformed);
The "time" value comes back blank.
The reason is because Date is not a primitive, so it tries to go through the values of the Date and transform its keys. This is probably not the behavior most users expect. I'm going to add a feature that allows users to customize whether or not an object gets transformed. I'll probably also change the default behavior so that Date does not get transformed.
Thanks for raising the issue.
ETA?