cast-unknown: 将未知值转换为所需类型

使用cast-unknown库可以将未知值转换为所需的类型,若值无效则引发CastError异常。当前支持的转换目标包括数字、日期、持续时间、毫秒、可重复项和非null值。

zip
cast-unknown-master.zip 预估大小:36个文件
folder
cast-unknown-master 文件夹
file
webpack.dev.js 463B
file
.mocharc.yml 90B
folder
.github 文件夹
folder
workflows 文件夹
file
nodejs.yml 522B
file
mochapack.opts 51B
file
webpack.prod.js 405B
file
.eslintrc.js 551B
folder
src 文件夹
file
index.ts 89B
file
index.cast.ts 3KB
file
babel.config.js 227B
file
tsconfig.json 449B
file
LICENSE 1KB
file
.prettierrc 68B
file
webpack.common.js 560B
file
README.md 2KB
file
Makefile 165B
file
mocha-require.js 225B
file
renovate.json 107B
folder
tests 文件夹
file
string.spec.ts 460B
file
promise.spec.ts 1KB
file
.eslintrc 83B
file
one.spec.ts 1KB
file
duration.spec.ts 536B
file
iterable.spec.ts 1KB
file
non-null.spec.ts 464B
file
env.ts 183B
file
tsconfig.json 102B
file
number.spec.ts 751B
file
date.spec.ts 284B
file
object.spec.ts 369B
file
array.spec.ts 659B
file
milliseconds.spec.ts 433B
file
.gitignore 79B
file
CHANGELOG.md 2KB
file
.eslintignore 10B
file
package-lock.json 674KB
file
package.json 2KB
zip 文件大小:164.35KB