【文件属性】:
文件名称:switch-exp:切换为 JavaScript 的表达式
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-29 14:17:23
javascript experiment switch JavaScript
切换表达式
在 Javascript 中作为表达式切换,灵感来自 @FGRibreau 的 。
安装
npm install switch-exp
## 用法
import _switch from 'switch-exp' ;
const a = _switch ( thing )
. case ( condition1 )
. then ( 'value1' )
. case ( condition2 )
. then ( 'value2' )
. default ( 'defaultValue' ) ;
【文件预览】:
switch-exp-master
----.gitignore(20B)
----README.md(560B)
----test()
--------specs()
--------tests.js(37B)
----.jshintrc(2KB)
----package.json(775B)
----src()
--------switch-exp.js(743B)
----.travis.yml(86B)
----index.html(611B)
----gulpfile.js(1KB)