Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/docxml/src/utilities/parameter-checking.ts>checkForForbiddenParameters

TypeScript (component) library for building and parsing a DOCX file
Latest
function checkForForbiddenParameters
import { checkForForbiddenParameters } from "https://deno.land/x/docxml@5.15.2/src/utilities/parameter-checking.ts";

A function that can be used to test that all the parameters of an object pass a particular test. This can be used to check that no values in an object are NaN, or could be used to check that values are inside a particular range.

Type Parameters

ObjectToCheck

Parameters

objectToCheck: ObjectToCheck

An object whose parameters we want to validate.

callback: (object: unknown) => boolean

A callback function that we use to check the values of our object. The callback will be used recursively if objectToCheck has nested values.

callbackFailureValue: boolean

The boolean value that will indicate a failure of the callback function.

Returns

true

Returns true if all the object's values pass the check between the callback function and the value that determines a failure. Otherwise, throws an error.