@elijahjcobb/optional
v0.0.2
Published
Replicates Swift's Optional, hold a value or undefined, written in TypeScript.
Downloads
7
Maintainers
Readme
Optional
Replicates Swift's Optional, hold a value or undefined, written in TypeScript.
Usage
import Optional from "@elijahjcobb/optional";
let optional: Optional<number> = new Optional<number>(1234);
if (optional.hasValue()) console.log(optional.getValue());
else console.log("NO VALUE");
TypeScript
All classes contain TypeScript declaration files. You can also view all the source code on GitHub.
Bugs
If you find any bugs please create an issue on GitHub or if you are old fashioned email me at [email protected].