【文件属性】:
文件名称:vanilla-enum::books: 一个使用 Enum 的原生 JavaScript 库
文件大小:87KB
文件格式:ZIP
更新时间:2021-05-30 07:29:51
JavaScript
安装
npm install --save vanilla-enum
# or with yarn
yarn add vanilla-enum
基本用法
Enum(object[, options]) import Enum from 'vanilla-enum'
const GENDER = new Enum ( {
Male : {
value : 1 ,
description : "Male :man_raising_hand:"
} ,
Female : {
value : 2 ,
description : "Female :woman_raising_hand:"
}
} , {
ignoreCase : false // default
} )
GENDER . Male // 1
GENDER . getDescription ( 2 ) // "Female :woman_raising_hand:"
GE
【文件预览】:
vanilla-enum-master
----utils()
--------capitalize.js(89B)
----.babelrc(27B)
----lib()
--------vanilla-enum.js(3KB)
----.travis.yml(101B)
----LICENSE(1KB)
----__tests__()
--------enum.test.js(1KB)
----README.md(2KB)
----docs()
--------.keep(1B)
--------logo.png(25KB)
----.gitignore(17B)
----package-lock.json(306KB)
----package.json(867B)