validateAllArgsObject

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