Files
ueblueprint/js/entity/IdentifierEntity.js
2022-03-30 21:59:41 +02:00

30 lines
544 B
JavaScript

// @ts-check
import IEntity from "./IEntity"
export default class IdentifierEntity extends IEntity {
static attributes = {
value: String,
}
constructor(options = {}) {
// Not instanceof to pick also primitive string
if (options.constructor === String) {
options = {
value: options
}
}
super(options)
/** @type {String} */ this.value
}
valueOf() {
return this.value
}
toString() {
return this.value
}
}