Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/@rescript/runtime/Stdlib_Null.resi
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,12 @@ external toOption: t<'a> => option<'a> = "#null_to_opt"

/**
Turns an `option` into a `Null.t`. `None` will be converted to `null`.
`None` compiles to `undefined`, but after calling `Null.fromOption`, the result will be `null` instead of `undefined`.

## Examples
```rescript
let optString: option<string> = None
let asNull = optString->Null.fromOption // Null.t<string>
let asNull = optString->Null.fromOption // Null.t<string>, will compile to 'null'
Console.log(asNull == Null.null) // Logs `true` to the console.
```
*/
Expand Down
1 change: 1 addition & 0 deletions packages/@rescript/runtime/Stdlib_Nullable.resi
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ external toOption: t<'a> => option<'a> = "#nullable_to_opt"

/**
Turns an `option` into a `Nullable.t`.
`None` compiles to `undefined` and after running `Nullable.fromOption` on it, it will continue to be `undefined`.

## Examples
```rescript
Expand Down
Loading