Files
ueblueprint/js/entity/TypeInitialization.js
2021-10-22 00:01:24 +02:00

12 lines
411 B
JavaScript

import Utility from "../Utility"
export default class TypeInitialization {
constructor(value, showDefault = true, type = Utility.getType(value)) {
if (type.prototype.constructor.name != value.constructor.name) {
throw new Error("Default value expected to be of the same type.")
}
this.value = value
this.showDefault = showDefault
this.type = type
}
}