Skip to content

API Cleanup (breaking changes!)

Compare
Choose a tag to compare
@UselessPickles UselessPickles released this 20 Feb 04:14
· 135 commits to master since this release

I talked myself into cleaning up the API to improve clarity.

Removed the following methods:

  • EnumWrapper.prototype.has - Use isKey instead
  • EnumWrapper.prototype.get - Use getValueOrDefault (or getValueOrThrow) instead

Renamed the following methods:

  • EnumWrapper.prototype.asKey -> asKeyOrThrow
  • EnumWrapper.prototype.getKey -> getKeyOrThrow
  • EnumWrapper.prototype.asValue -> asValueOrThrow
  • EnumWrapper.prototype.getValue -> getValueOrThrow

Read the conversation I had with myself here: https://www.reddit.com/r/typescript/comments/7ykp3j/typescript_enum_utils_strictly_typed_wrapper/duhrqq5/