mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
12 lines
411 B
JavaScript
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
|
|
}
|
|
} |