guardily
v1.0.3
Published
Guards the parameters of methods
Downloads
3
Readme
guardily
Helper method that guards function parameters
description
Exports a Guard
helper method:
install
yarn add guardily
npm install guardily
usage
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");
}
);
};