0.0.3 • Published 2 years ago

mkenum v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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'
0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago