ajv-validator / ajv-validator/ajv

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

オープン
#2,024 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
typescript
主要言語
TypeScript
スター
14.8k
フォーク
1k
PR マージ指標
30日以内にマージされた PR はありません

説明

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;
},
});
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。