Include support for symbols
aw-davidson opened this issue · comments
Summary
Symbols are not included in sizeof calculations.
Example
> sizeof({abc: 'def'})
12
> sizeof({[Symbol('abc')]: 'def'})
0
Solution
Use Object.getOwnPropertySymbols
to get the obj's symbols to iterate over.
Let me know if this would be useful and I can make a pr.
Absolutely.
On Wed, 1 Apr 2020 at 17:15, aw-davidson ***@***.***> wrote:
Summary
Symbols are not included in sizeof calculations.
Example
> sizeof({abc: 'def'})12> sizeof({[Symbol('abc')]: 'def'})0
Solution
Use Object.getOwnPropertySymbols to get the obj's symbols to iterate over.
Let me know if this would be useful and I can make a pr.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#42>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABWKOSIAGYPQJC5J7EM2P3RKNLC5ANCNFSM4LZBYTVA>
.
--
Andrei Karpushonak
thank you, @aw-davidson !