ajv-validator / ajv-validator/ajv
JTDSchemaType derivation for enums is too strict
Aperta
limitation
typescript
- Lingua principale
- TypeScript
- Stelle
- 14.8k
- Fork
- 1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**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
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.