Refactoring and bugfixing

This commit is contained in:
barsdeveloper
2021-10-24 00:17:16 +02:00
parent a34be2351e
commit f80c9f8dc1
16 changed files with 274 additions and 1396 deletions

View File

@@ -33,6 +33,12 @@ export default class Entity {
continue
}
let defaultValue = properties[property]
if (defaultValue instanceof TypeInitialization) {
if (!defaultValue.showDefault) {
continue
}
defaultValue = defaultValue.value
}
if (defaultValue instanceof Array) {
propertySetter(target, property, [])
defineAllAttributes(
@@ -42,12 +48,6 @@ export default class Entity {
(t, _, v) => t.push(v))
continue
}
if (defaultValue instanceof TypeInitialization) {
if (!defaultValue.showDefault) {
continue
}
defaultValue = defaultValue.value
}
if (defaultValue instanceof Function) {
defaultValue = Utility.sanitize(new defaultValue())
}