mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-18 12:24:51 +08:00
WIP
This commit is contained in:
@@ -3,7 +3,9 @@ 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))
|
||||
static grammar = P.regArray(/(true)|false/i)
|
||||
.map(v => v[1] ? new this(true) : new this(false))
|
||||
.label("BooleanEntity")
|
||||
|
||||
constructor(value = false) {
|
||||
super()
|
||||
@@ -14,7 +16,13 @@ export default class BooleanEntity extends IEntity {
|
||||
return this.value
|
||||
}
|
||||
|
||||
toString() {
|
||||
return this.value.toString()
|
||||
toString(insideString = false) {
|
||||
return this.value
|
||||
? insideString
|
||||
? "true"
|
||||
: "True"
|
||||
: insideString
|
||||
? "false"
|
||||
: "False"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user