Skip to content

Support symbols or strings as milestone keys - #12

Merged
dfreeman merged 1 commit into
masterfrom
symbol-keys
Sep 10, 2018
Merged

dfreeman merged 1 commit into
masterfrom
symbol-keys

Conversation

@dfreeman

@dfreeman dfreeman commented Sep 5, 2018

Copy link
Copy Markdown
Member

Per #9, this allows for the use of symbols as milestone keys. In terms of the actual runtime code, there were only a couple of small changes to the implementation:

  • We had a couple uses of Object.keys that had to be replaced with something more generic, as that only returns string keys
  • We were interpolating keys directly into strings in places, which will blow up as symbols don't like to be implicitly coerced to strings, so there are now some explicit .toString() calls (thanks TypeScript, I would have forgotten about that!)

One note: TS doesn't currently allow symbols in an index type (i.e. { [key: symbol]: any } isn't a thing), so there's a few as anys sprinkled in to bypass that. If microsoft/TypeScript#26797 lands, we ought to be able to clean that up.

@deverstalmage

@dfreeman
dfreeman merged commit 671da8c into master Sep 10, 2018
@dfreeman
dfreeman deleted the symbol-keys branch September 10, 2018 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants