Skip to content

tranvansang/mkenum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mkenum: make enum type in javascript

npm version

Install

Install via npm package:

yarn add mkenum

Usage

import makeEnum, {type IEnum} from 'mkenum'
// or
const makeEnum = require('mkenum')

const Env = makeEnum('a', 'b', 'c') // type {a: 'a', b: 'b', c: 'c'}
const a = Env.a // type 'a'
type EnvEnum = IEnum<typeof Env> // type 'a' | 'b' | 'c'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published