【文件属性】:
文件名称:etre:Javascript中的模式匹配
文件大小:11KB
文件格式:ZIP
更新时间:2021-05-03 04:04:58
JavaScript
埃特
一个简单的模式匹配库
警告这可能不是很有效
安装
$ npm install --save etre
这个怎么运作
import etre, {
STRING,
NUMBER,
} from "etre"
const greeter = etre(
// [pattern, function]
["gary", () => "LOL, gary why are you on the table"],
["pat", () => "Post man pat and his black and white cat"],
[STRING, name => `Hello ${ name }, how are you?`],
[NUMBER, n => "hmm... is your name really ${ n }? That seems lik
【文件预览】:
etre-master
----.gitignore(26B)
----.babelrc(209B)
----package.json(749B)
----src()
--------index.js(1KB)
----dist()
--------etre.js(23KB)
----LICENSE(2KB)
----README.md(1KB)
----tests()
--------index_test.js(1KB)