Skip to content

Commit

Permalink
feat: Optional type is no longer exported
Browse files Browse the repository at this point in the history
  • Loading branch information
yifanwww committed Mar 3, 2024
1 parent 9ee8c28 commit c595dc2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
*
* This type doesn't use the name `Option`,
* by giving it a different name we can easily know that this is not Rust-like Option.
*
* This type is not exported since there's no convention for using `Optional` type in TypeScript world.
* People just simply write `T | undefined`.
*/
export type Optional<T> = T | undefined;
type Optional<T> = T | undefined;

/**
* The interface of `Result` that defines the methods that `Result` should support.
Expand Down

0 comments on commit c595dc2

Please sign in to comment.