Skip to content

checkInvalidKey

function checkInvalidKey(
target,
source,
sourceName
): void;

Check that an object does not have any key that is not in a source.

Record<string, any>

The object to check

string[] | Record<string, any>

The valid keys, or the object that holds them

string

The name of the source, used in the error message

void

Nothing

DisTubeError When the target is not an object, or when it has an invalid key