Skip to content

Latest commit

 

History

History
302 lines (178 loc) · 4.53 KB

utils.md

File metadata and controls

302 lines (178 loc) · 4.53 KB

etcher-sdk / utils

Namespace: utils

Table of contents

Interfaces

Functions

Functions

asCallback

asCallback<T>(promise, callback): Promise<void>

Type parameters

Name
T

Parameters

Name Type
promise Promise<T>
callback (error?: null | Error, value?: T) => void

Returns

Promise<void>

Defined in

lib/utils.ts:102


delay

delay(ms): Promise<void>

Parameters

Name Type
ms number

Returns

Promise<void>

Defined in

lib/utils.ts:128


difference

difference<T>(setA, setB): Set<T>

Type parameters

Name
T

Parameters

Name Type
setA Set<T>
setB Set<T>

Returns

Set<T>

Defined in

lib/utils.ts:94


every

every<T>(things): boolean

Type parameters

Name
T

Parameters

Name Type
things Iterable<T>

Returns

boolean

Defined in

lib/utils.ts:168


fromCallback

fromCallback<T>(fn): Promise<T>

Type parameters

Name
T

Parameters

Name Type
fn (callback: (error?: null | Error, result?: T) => void) => void

Returns

Promise<T>

Defined in

lib/utils.ts:114


maxBy

maxBy<T>(things, iteratee): T | undefined

Type parameters

Name
T

Parameters

Name Type
things Iterable<T>
iteratee (thing: T) => number

Returns

T | undefined

Defined in

lib/utils.ts:150


minBy

minBy<T>(things, iteratee): T | undefined

Type parameters

Name
T

Parameters

Name Type
things Iterable<T>
iteratee (thing: T) => number

Returns

T | undefined

Defined in

lib/utils.ts:134


once

once<T>(fn): () => T

Type parameters

Name
T

Parameters

Name Type
fn () => T

Returns

fn

▸ (): T

Returns

T

Defined in

lib/utils.ts:177


sparseStreamToBuffer

sparseStreamToBuffer(stream): Promise<Buffer>

Parameters

Name Type
stream ReadableStream

Returns

Promise<Buffer>

Defined in

lib/utils.ts:53


streamToBuffer

streamToBuffer(stream): Promise<Buffer>

Parameters

Name Type
stream ReadableStream

Returns

Promise<Buffer>

Defined in

lib/utils.ts:24


sumBy

sumBy<T>(things, iteratee): number

Type parameters

Name
T

Parameters

Name Type
things Iterable<T>
iteratee (thing: T) => number

Returns

number

Defined in

lib/utils.ts:157