ajv-validator / ajv-validator/ajv

JTDSchemaType derivation for enums is too strict

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

説明

**What version of Ajv are you using? Does the issue happen if you use the latest version?**

8.12.0

**Ajv options object**

none

**Your code**

```javascript
type AB = 'a' | 'b'
const s1 = { enum: ['a', 'b'] } as const
const enum1: JTDSchemaType = s1
// error: The type 'readonly ["a", "b"]' is 'readonly' and cannot be assigned to the mutable type 'AB[]'.
```

**What results did you expect?**

Assignment should be possible.

**Are you going to resolve the issue?**
I can prepare a PR

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

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

評価

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

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

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