Files
ueblueprint/js/entity/BooleanEntity.js
barsdeveloper 1c2778fbf8 Still WIP
2024-05-28 16:44:39 +02:00

21 lines
434 B
JavaScript
Executable File

import P from "parsernostrum"
import IEntity from "./IEntity.js"
export default class BooleanEntity extends IEntity {
static grammar = P.regArray(/(true)|false/i).map(v => v[1] ? new this(true) : new this(false))
constructor(value = false) {
super()
this.value = value
}
valueOf() {
return this.value
}
toString() {
return this.value.toString()
}
}