mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
30 lines
544 B
JavaScript
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
|
|
}
|
|
}
|