{"action":"opened","issue":{"url":"https://api.github.com/repos/dfahlander/typeson/issues/6","repository_url":"https://api.github.com/repos/dfahlander/typeson","labels_url":"https://api.github.com/repos/dfahlander/typeson/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/dfahlander/typeson/issues/6/comments","events_url":"https://api.github.com/repos/dfahlander/typeson/issues/6/events","html_url":"https://github.com/dfahlander/typeson/issues/6","id":376000791,"node_id":"MDU6SXNzdWUzNzYwMDA3OTE=","number":6,"title":"Feature request: Support for Symbol-keys","user":{"login":"ulrichb","id":388796,"node_id":"MDQ6VXNlcjM4ODc5Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/388796?v=4","gravatar_id":"","url":"https://api.github.com/users/ulrichb","html_url":"https://github.com/ulrichb","followers_url":"https://api.github.com/users/ulrichb/followers","following_url":"https://api.github.com/users/ulrichb/following{/other_user}","gists_url":"https://api.github.com/users/ulrichb/gists{/gist_id}","starred_url":"https://api.github.com/users/ulrichb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ulrichb/subscriptions","organizations_url":"https://api.github.com/users/ulrichb/orgs","repos_url":"https://api.github.com/users/ulrichb/repos","events_url":"https://api.github.com/users/ulrichb/events{/privacy}","received_events_url":"https://api.github.com/users/ulrichb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-31T14:49:46Z","updated_at":"2018-10-31T14:49:46Z","closed_at":null,"author_association":"NONE","body":"Symbol-typed keys (and their values) are also something which [gets lost in a JSON round-trip](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Description). \r\n\r\nSo it would be nice if typeson.js also supports key-rivival (next to value-revival). \r\n\r\nThis would mean:\r\n* When iterating over object keys additionally iterate over symbols using `Object.getOwnPropertySymbols()`\r\n* Provide a possibility to register symbols to be able to test for a symbol using `key === registeredSymbol` and to use the `registeredSymbol`-value to revive it again, e.g.:\r\n```JS\r\nconst mySymbol = Symbol();\r\nconst otherSymbol = Symbol(\"symbol with description\");\r\n\r\nnew Typeson().registerSymbolKeys({\r\n    MySymbol: mySymbol,\r\n    OtherSymbol: otherSymbol,\r\n});\r\n```\r\n* Change the symbol-keys to string-keys (_avoiding conflicts with equally named string-keys_) during `encapsulate()` and reverse it during `revive()`.\r\n\r\n"}}
{"actor":{"display_login":"ulrichb"}}