From 38d30e31a1de4a4de6d55d88a936db7e1355a4b7 Mon Sep 17 00:00:00 2001 From: akarys92 Date: Tue, 31 May 2022 13:06:10 -0400 Subject: [PATCH] Update README.md Fixing issues in the validation example. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 12a7d847..d3948ae0 100644 --- a/README.md +++ b/README.md @@ -42,13 +42,13 @@ async function validate() { addFormats(ajv) const validator = ajv.compile(schema); const response = await fetch(ARBITRUM_LIST) - const data = response.json() + const data = await response.json() const valid = validator(data) if (valid) { return valid } if (validator.errors) { - return validator.errors.map(error => { + throw validator.errors.map(error => { delete error.data return error }) @@ -56,7 +56,7 @@ async function validate() { } validate() - .then(console.log) + .then(console.log("Valid List.") .catch(console.error) ```