partialObjectValidator

function partialObjectValidator<T>(validatorStructure): (subject) => subject is Partial<DestructureGuardedTypeObj<T>>

Creates a validator which tests if the target is an object
and if the structure of the object matches the structure of the passed-in
validator object, but with every entry being optional.

Type parameters

Type parameter
T extends object

Parameters

ParameterType
validatorStructureT

Returns

Function

Parameters

ParameterType
subjectunknown

Returns

subject is Partial<DestructureGuardedTypeObj<T>>