-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Hey YuChao!
I noticed some edge cases are not handled by your method:
> const dc = require('nest-object-deep-copy')
undefined
> const B = {z: new Float64Array([1,2,3])}
undefined
> B
{ z: Float64Array(3) [ 1, 2, 3 ] }
> dc(B)
{ z: { '0': 1, '1': 2, '2': 3 } }
> const D = {m:new Date}
undefined
> D
{ m: 2021-04-04T02:14:35.170Z }
> dc(D)
{ m: {} }
> class Person {
... #age
... get age() { return this.#age; }
... set age(newAge) { this.#age = newAge; }
... }
undefined
> const p = new Person()
undefined
> p.age
undefined
> p.age = 123
123
> p.age
123
> P = dc(p)
Person {}
> P.age
Uncaught:
TypeError: Cannot read private member #age from an object whose class did not declare it
at Person.get age [as age] (REPL56:3:25)yuwu9145
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working