Skip to content

@feds01/graphika


@feds01/graphika / utils/object

utils/object

Functions

expr()

ts
function expr<T>(cb): T;

Defined in: utils/object.ts:69

Type Parameters

Type Parameter
T

Parameters

ParameterType
cb() => T

Returns

T


isDef()

ts
function isDef<T>(o): o is T;

Defined in: utils/object.ts:65

Check whether some item is not null and not undefined.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
oT | null | undefinedThe item to check.

Returns

o is T

Whether the item is defined, as a type assertion.


merge()

ts
function merge<T>(target, source): T;

Defined in: utils/object.ts:37

Combine two objects into one without mutating the originals.

Type Parameters

Type Parameter
T extends object

Parameters

ParameterTypeDescription
targetTThe initial object that will be used as a base to merge.
sourceTThe object that will be merged into target.

Returns

T

A new merged object from target and source.

Released under the ISC License.