Files
ueblueprint/js/entity/IdentifierEntity.js
2022-03-24 22:54:41 +01:00

28 lines
490 B
JavaScript

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)
}
valueOf() {
return this.value
}
toString() {
return this.value
}
}