@cprussin/option-result
Version:
Yet another Typescript clone of the rust `Option` & `Result` enums.
46 lines (24 loc) • 871 B
Markdown
[**@cprussin/option-result v2.0.1**](../README.md)
***
# Function: Ok()
> **Ok**\<`T`, `E`\>(`value`): [`Result`](../classes/Result.md)\<`T`, `E`\>
Defined in: [result.ts:580](https://github.com/cprussin/cprussin-monorepo/blob/45be92bc13a41d9f46c6ab9ed2d9a61167827e46/packages/option-result/src/result.ts#L580)
Construct a [Result](../classes/Result.md) containing a success value.
## Type Parameters
### T
`T` *extends* `object`
the type of the value
### E
`E` *extends* `object`
the type of error results
## Parameters
### value
`T`
the value contained by the [Result](../classes/Result.md)
## Returns
[`Result`](../classes/Result.md)\<`T`, `E`\>
a [Result](../classes/Result.md) containing `value`
## See
- [Result.Err](../classes/Result.md#err-2)
- [Result.wrap](../classes/Result.md#wrap)
- [Result.wrapAsync](../classes/Result.md#wrapasync)