Skip to main content

core.assertok

Home > @medplum/core > assertOk

assertOk() function

Asserts that the operation completed successfully and that the resource is defined.

Signature:

export declare function assertOk<T>(outcome: OperationOutcome, resource: T | undefined): asserts resource is T;

Parameters

ParameterTypeDescription
outcomeOperationOutcomeThe operation outcome.
resourceT | undefinedThe resource that may or may not have been returned.

Returns:

asserts resource is T