Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tinrab/temelj/llms.txt
Use this file to discover all available pages before exploring further.
ok
Creates a success Result.The success value to wrap
A success Result containing the value
Example
err
Creates an error Result.The error value to wrap
An error Result containing the error
Example
isOk
Type guard that checks if a Result is a success.The Result to check
True if the Result is a success, false otherwise
Example
isErr
Type guard that checks if a Result is an error.The Result to check
True if the Result is an error, false otherwise
Example
unwrap
Extracts the success value from a Result or throws the error.The Result to unwrap
The success value if the Result is Ok
Throws the error value if the Result is Err
Example
unwrapErr
Extracts the error value from a Result or throws an error.The Result to unwrap
The error value if the Result is Err
Throws an Error if the Result is Ok
Example
unwrapOr
Extracts the success value from a Result or returns a default value.The Result to unwrap
The default value to return if the Result is an error. Can be a value or a function that returns a value.
The success value if Ok, otherwise the default value
Example
map
Maps the success value of a Result to a new value.The Result to map
Function to transform the success value
A new Result with the transformed value, or the original error
Example
mapErr
Maps the error value of a Result to a new error value.The Result to map
Function to transform the error value
A new Result with the transformed error, or the original success value
Example
fromThrowable
Calls a function that may throw and returns a Result.The synchronous function to execute
Optional function to convert the unknown thrown value to type E
A Result containing either the function’s return value or the caught error
Example
fromPromise
Calls a function that returns a Promise and returns a Promise<Result>.The async function to execute
Optional function to convert the unknown rejection reason to type E
A Promise of a Result containing either the resolved value or the caught error