Skip to main content

expect()

@hyperledger/identus-sdk v8.0.0


@hyperledger/identus-sdk / overview / Domain / expect

Function: expect()

expect<T>(value: T, error?: string | Error | Ctor<Error>): Exclude<T, Nil>

Defined in: packages/shared/domain/build/index.d.ts:196

expect assert a value is notNil and return the value typed as such panic otherwise

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
valueTthe value to check
error?string | Error | Ctor<Error>custom error

Returns

Exclude<T, Nil>