mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-13 16:44:49 +08:00
28 lines
490 B
JavaScript
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
|
|
}
|
|
}
|