Handle non-enumerable/writable/configurable properties
Rich-Harris opened this issue · 0 comments
Rich-Harris commented
Currently, devalue will ignore non-enumerable properties. It could use Object.getOwnPropertyDescriptors
instead and handle those, correctly setting writable
, enumerable
and configurable
.
With that, { foo: 1 }
would just be the (common) special case where writable
, enumerable
and configurable
are all true
.
At the same time, we would throw on getters and setters, since devalue doesn't serialize functions.