monads::ghost: TypeScript 的Option、Result 和Either 类型; 受 Rust 的启发

时间:2021-08-04 14:26:53
【文件属性】:
文件名称:monads::ghost: TypeScript 的Option、Result 和Either 类型; 受 Rust 的启发
文件大小:125KB
文件格式:ZIP
更新时间:2021-08-04 14:26:53
nodejs javascript rust monads node 如果您使用此 repo,请为它加星标 :sparkles: :ghost: JavaScript 的选项、结果和任一类型 受启发 零依赖 :flexed_biceps: 安装 Node.js 和浏览器 npm install @sniptt/monads 德诺 import { Some } from 'https://deno.land/x/monads/mod.ts' Some ( 'air' ) . unwrapOr ( 'baloon' ) // "air" None . unwrapOr ( 'baloon' ) // "baloon" 用法 Option import { Option , Some , None } from '@sniptt/monads' ; const divide = ( numerator : number , denominator : number ) : Option < number>
【文件预览】:
monads-main
----deno()
--------mod.ts(28B)
--------option()
--------result()
--------LICENSE(1KB)
--------either()
--------README.md(2KB)
--------index.ts(215B)
----docs()
--------interfaces()
--------README.md(5KB)
----package.json(2KB)
----.github()
--------FUNDING.yml(63B)
--------assets()
--------workflows()
----test()
--------_support()
--------option()
--------result()
--------either()
----.prettierrc(69B)
----.prettierignore(2KB)
----.nycrc(211B)
----LICENSE(1KB)
----package-lock.json(311KB)
----tsconfig.json(582B)
----.gitignore(2KB)
----lib()
--------option()
--------result()
--------either()
--------index.ts(206B)
----README.md(2KB)

网友评论