validateAllArgsNumber

It resolves the list of args if they are numbers. If there is at least one item from the list that is not a number type, this function will throw.
Parameter ListReturnsRejection Errors
  • ...everything
Promise<Array<number>>
Related FunctionsFunction Signature
function validateAllArgsNumber(...everything): Promise<Array<number>>
1 2 3 import { validateAllArgsNumber } from "puddy-m/lib/validators/complexValidators"; validateAllArgsNumber(1.5, 1, 8).then((numberArgs) => console.log(numberArgs)); // [1.5, 1, 8]
1 2 3 4 5 6 7 8 9 10 11 12 import { validateAllArgsNumber } from "puddy-m/lib/validators/complexValidators"; const run = async () => { try { const numberArgs = await validateAllArgsNumber("number"); } catch (e) { // Throws NumberValidationError console.log(e); } }; run();