Skip to content
module@warp-drive/legacy/compat/utils @legacy

Function expectId() ​

ts
function expectId(id: string | number): string;
function expectId(id: null): never;

Call Signature ​

ts
function expectId(id: string | number): string;

Defined in: warp-drive-packages/legacy/src/compat/utils.ts:186

Like formattedId, but asserts that id is not null rather than allowing and passing through null.

Parameters ​

id ​

string | number

Returns ​

string

Call Signature ​

ts
function expectId(id: null): never;

Defined in: warp-drive-packages/legacy/src/compat/utils.ts:192

Throws, since id is null.

Parameters ​

id ​

null

Returns ​

never

Released under the MIT License.