Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Fixing issues in the validation example.
  • Loading branch information
akarys92 authored May 31, 2022
1 parent 2d8584d commit 38d30e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ 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
})
}
}

validate()
.then(console.log)
.then(console.log("Valid List.")
.catch(console.error)

```
Expand Down

0 comments on commit 38d30e3

Please sign in to comment.