Type initialization using objects

This commit is contained in:
barsdeveloper
2023-01-02 00:22:50 +01:00
parent d391480f2c
commit 984bf32b51
43 changed files with 1511 additions and 831 deletions

View File

@@ -3,12 +3,16 @@ import IEntity from "./IEntity"
export default class ObjectReferenceEntity extends IEntity {
static attributes = {
type: String,
path: String,
type: "",
path: "",
}
static {
this.cleanupAttributes(this.attributes)
}
constructor(values = {}) {
if (values.constructor !== Object) {
if (values.constructor === String) {
values = {
path: values
}