ajv-validator / ajv-validator/ajv
JTDSchemaType derivation for enums is too strict
オープン
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 はまだ評価されていません。