Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dates, typed arrays and class #9

Open
o0101 opened this issue Apr 4, 2021 · 0 comments
Open

dates, typed arrays and class #9

o0101 opened this issue Apr 4, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@o0101
Copy link

o0101 commented Apr 4, 2021

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 yuwu9145 added the bug Something isn't working label Apr 4, 2021
@yuwu9145 yuwu9145 changed the title dates, typed arrays and other stuffs dates, typed arrays and class Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants