Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
chrstph-dvx committed Dec 24, 2023
1 parent 4d90b6b commit d2a1c1d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/lib/validateTokenList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,18 @@ import { ArbTokenList } from './types';
export const tokenListIsValid = (tokenList: ArbTokenList | TokenList) => {
const ajv = new Ajv();
addFormats(ajv);
delete schema.properties.tokens;
const validate = ajv.compile(schema);

const res = validate(tokenList);

if (validate.errors) {
const errors = validate.errors.filter(
(e) => e.message !== 'must NOT have more than 10000 items',
);
const output = betterAjvErrors(schema, tokenList, errors, {
const output = betterAjvErrors(schema, tokenList, validate.errors, {
indent: 2,
});
console.log(output);
}

console.log('RRRRRR', res);

return res;
};

Expand Down

0 comments on commit d2a1c1d

Please sign in to comment.