mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-14 00:54:48 +08:00
23 lines
502 B
JavaScript
Executable File
23 lines
502 B
JavaScript
Executable File
import P from "parsernostrum"
|
|
import IEntity from "./IEntity.js"
|
|
import Utility from "../Utility.js"
|
|
|
|
export default class StringEntity extends IEntity {
|
|
|
|
static grammar = P.doubleQuotedString.map(insideString => Utility.unescapeString(insideString))
|
|
|
|
/** @param {String} value */
|
|
constructor(value = "") {
|
|
super()
|
|
this.value = value
|
|
}
|
|
|
|
valueOf() {
|
|
return this.value
|
|
}
|
|
|
|
toString() {
|
|
return this.value.toString()
|
|
}
|
|
}
|