humps
humps copied to clipboard
invalid moment object when converting string to moment inside camelizeKeys
when i try to camelize my object, i want to convert one of the field (string) into moment object, like this
const p = camelizeKeys({
...myobject,
timestamp: moment(purchase.timestamp),
});
the camelization is ok, no error.
the thing is, moment object suppose to have .format
function defined on the object.
but when i try to access it from p.timestamp.format
it said that format
is undefined.
what is the cause of that? how to do it 'properly' ?