ajv-validator / ajv-validator/ajv

addKeyword expects 2 paramters according to typescript but give a deprecation error

Aperta
#2,024 1 commento 1 reazione 0 assegnatari Vedi su GitHub
typescript
Lingua principale
TypeScript
Stelle
14.8k
Fork
1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

addKeyword wants a type and the config as two parameters. When I do that I am getting an error `these parameters are deprecated, see docs for addKeyword`.

Using 8.11.0 (latest fasitfy)

works but has typescript error:
```
ajv.addKeyword({
keyword: 'isFileType',
type: 'object',
compile: (schema, parent, it) => {
parent.type = 'file';
delete parent.isFileType;
return () => true;
},
});
```

no typescript error but deprecation error:
```
ajv.addKeyword( 'isFileType', {
compile: (schema, parent, it) => {
parent.type = 'file';
delete parent.isFileType;
return () => true;
},
});
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.