Skip to content

Instantly share code, notes, and snippets.

@shiftgeist
Created January 23, 2024 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shiftgeist/6812791f74cb374851fff8339b4ed509 to your computer and use it in GitHub Desktop.
Save shiftgeist/6812791f74cb374851fff8339b4ed509 to your computer and use it in GitHub Desktop.
Enum with Const + Type
const Permission = {
Read: 'r',
Write: 'w',
Execute: 'x'
} as const;
type Permission = typeof Permission[keyof typeof Permission];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment