mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-24 07:44:42 +08:00
Grammar refactoring WIP
This commit is contained in:
12
js/entity/TypeInitialization.js
Normal file
12
js/entity/TypeInitialization.js
Normal file
@@ -0,0 +1,12 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user