Utils
@hyperledger/identus-sdk v8.0.0
@hyperledger/identus-sdk / overview / Utils
Variable: Utils
constUtils: {asArray: {<T>(items:Nil|T|T[]):T[]; <T,U>(items:Nil|T|T[],guard: (item:unknown) =>item is U):U[]; };asJsonObj: (value:unknown) =>JsonObj;ConsoleLogger: typeofConsoleLogger;expect: <T>(value:T,error?:string|Error|Ctor<Error>) =>Exclude<T,Nil>;isArray: (value:unknown) =>value is unknown[];isEmpty: (value:unknown) =>value is Nil;isNil: (value:unknown) =>value is Nil;isObject: <T>(value:T) => value is Exclude<T & Record<string, any>, any[] | Nil | ((args: any) => any)>;isString: (value:unknown) =>value is string;notEmptyString: (value:unknown) =>value is string;notNil: <T>(value:Nil|T) =>value is T;Task: typeofTask; }
Defined in: packages/lib/sdk/src/index.ts:35
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
asArray() | {<T>(items: Nil | T | T[]): T[]; <T, U>(items: Nil | T | T[], guard: (item: unknown) => item is U): U[]; } | asArray convert a value to an array asArray convert a value to an array with type guard | packages/lib/sdk/src/index.ts:37 |
asJsonObj() | (value: unknown) => JsonObj | - | packages/lib/sdk/src/index.ts:37 |
ConsoleLogger | typeof ConsoleLogger | - | packages/lib/sdk/src/index.ts:38 |
expect() | <T>(value: T, error?: string | Error | Ctor<Error>) => Exclude<T, Nil> | expect assert a value is notNil and return the value typed as such panic otherwise | packages/lib/sdk/src/index.ts:37 |
isArray() | (value: unknown) => value is unknown[] | isArray Typeguard - check a value is an Array | packages/lib/sdk/src/index.ts:36 |
isEmpty() | (value: unknown) => value is Nil | isEmpty Logic - check a given value is considered empty empty depends on typeof value: - null - undefined - array: length = 0 - string: length = 0 See - isNil - isString - isArray | packages/lib/sdk/src/index.ts:36 |
isNil() | (value: unknown) => value is Nil | isNullish Typeguard - check a value is undefined or null | packages/lib/sdk/src/index.ts:36 |
isObject() | <T>(value: T) => value is Exclude<T & Record<string, any>, any[] | Nil | ((args: any) => any)> | isObject Typeguard - check a value is an object in the conceptual sense not the JS sense excluding JS overlap with: null Arrays Functions | packages/lib/sdk/src/index.ts:36 |
isString() | (value: unknown) => value is string | isString TypeGuard to check a value is a string | packages/lib/sdk/src/index.ts:36 |
notEmptyString() | (value: unknown) => value is string | notEmptyString Typeguard + Logic - check a value is a string with contents | packages/lib/sdk/src/index.ts:36 |
notNil() | <T>(value: Nil | T) => value is T | notNil Typeguard - check a value is neither undefined or null See isNil | packages/lib/sdk/src/index.ts:36 |
Task | typeof Task | - | packages/lib/sdk/src/index.ts:39 |