Skip to content

Home > llm-ops > getData

getData() function

Obtains the value associated with a successful Result<T> or throws an exception if the result is an error.

Signature:

typescript
export declare function getData<T>(result: Result<T>): T;
export declare function getData<T>(result: Result<T>): T;

Parameters

ParameterTypeDescription
resultResult<T>The Result<T> from which to obtain the data property.

Returns:

T

The value of the data property.

Released under the MIT License.