Entities cleanup, Primitive concept introduced

This commit is contained in:
barsdeveloper
2021-10-25 15:49:09 +02:00
parent bee57a1402
commit 92828705d3
21 changed files with 292 additions and 284 deletions

View File

@@ -1,7 +1,17 @@
import Utility from "../Utility"
export default class TypeInitialization {
constructor(value, showDefault = true, type = Utility.getType(value)) {
/**
*
* @param {typeof Object} type
* @param {boolean} showDefault
* @param {*} value
*/
constructor(type, showDefault = true, value = undefined) {
if (value === undefined) {
value = Utility.sanitize(new type())
}
this.value = value
this.showDefault = showDefault
this.type = type