NuriYuri/ts-marshal

Add support to read Hash as Map when calling load()

Closed this issue · 0 comments

To not break retro-compatibility we can add an option stating how Hash should be treated:

  1. legacy will be loaded as a JS object (default)
  2. mapWhenBadKeys will be loaded as a JS object if keys are all string or symbol, otherwise loaded as Map
  3. alwaysMap will be loaded as Map

There could be a global option & local option for Hash loading so it's not annoying to specify it.