Better typing for grammars

This commit is contained in:
barsdeveloper
2024-06-06 23:16:21 +02:00
parent ad4ba2c46d
commit 98ebdd78b2
40 changed files with 301 additions and 233 deletions

View File

@@ -4,7 +4,9 @@ import IntegerEntity from "./IntegerEntity.js"
export default class NaturalNumberEntity extends IntegerEntity {
static grammar = P.numberNatural.map(v => new this(v))
static grammar = /** @type {P<NaturalNumberEntity>} */(
P.numberNatural.map(v => new this(v))
)
get value() {
return super.value