Skip to content

Return the enum name in errors

Compare
Choose a tag to compare
@w3nl w3nl released this 24 Jan 08:04
· 174 commits to main since this release
0caff5f
class Encoding extends Enum {
  static 'utf-8' = 'UTF-8'
}

try {
  Encoding.fromKey('UTF-8')
} catch (error) {
  console.log(error.message) // Invalid Encoding key UTF-8
}