Skip to content

assertcheck v1.0.0


assertcheck / assert / dig

Function: dig()

ts
function dig<T>(
   obj, 
   path, 
   expected, 
   opts?): void;

Defined in: src/assert.ts:1714

Asserts that the object has a value at a nested path — Ruby hash.dig(:a, :b).

Type Parameters

Type Parameter
T

Parameters

ParameterType
objT
pathstring | string[]
expectedunknown
opts?Opts

Returns

void

Example

ts
`assert.dig(config, "database.pool.max", 10)`

Released under the Apache 2.0 License. Built by Vagabond Studio — senior-only for growing companies.