validateAllArgsArray
Description
It resolves the list of args if they are Arrays. If there is at least one item from the list that is not an array, this function will throw.
Parameter List | Returns | Rejection Errors |
---|---|---|
| Promise<Array<*>> | |
Related Functions | Function Signature | |
function validateAllArgsArray(...everything): Promise<Array<*>> |
Examples
1
2
3
import { validateAllArgsArray } from "puddy-m/lib/validators/complexValidators";
validateAllArgsArray([], [], []).then((arrays) => console.log(arrays)); // [[],[],[]]
1
2
3
4
5
6
7
8
9
10
11
12
import { validateAllArgsArray } from "puddy-m/lib/validators/complexValidators";
const run = async () => {
try {
const arrayArgs = await validateAllArgsArray([4], [3], "[]");
} catch (e) {
// Throws ArrayValidationError
console.log(e);
}
};
run();