Helper method that guards function parameters
Exports a Guard
helper method:
yarn add guardily
npm install guardily
ts:
import { Guard } from "guardily";
// don't throw exception, use a custom callback
const testFunc = x => {
Guard.argumentNotValid(
x,
"x",
{ doNotThrow: true, useCallback: true },
null,
() => {
console.log("argument is not valid");
}
);
};