## assertOk() function

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

**Signature:**

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

## Parameters

| Parameter | Type            | Description                          |
|-----------|-----------------|--------------------------------------|
| outcome   | OperationOutcome | The operation outcome.               |
| resource  | T \| undefined  | The resource that may or may not have been returned. |

**Returns:**

asserts resource is T

- [assertOk() function](/content/docs/sdk/core.assertok#assertok-function/index.html)  
- [Parameters](/content/docs/sdk/core.assertok#parameters/index.html)
