mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-15 17:54:52 +08:00
Various fixes
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import Configuration from "../Configuration.js"
|
||||
import Utility from "../Utility.js"
|
||||
import IEntity from "./IEntity.js"
|
||||
|
||||
@@ -27,6 +28,20 @@ export default class ObjectReferenceEntity extends IEntity {
|
||||
/** @type {String} */ this.path
|
||||
}
|
||||
|
||||
sanitize() {
|
||||
if (this.type && !this.type.startsWith("/")) {
|
||||
let deprecatedType = this.type + "_Deprecated"
|
||||
let nodeType = Object.keys(Configuration.nodeType)
|
||||
.find(type => {
|
||||
const name = Utility.getNameFromPath(Configuration.nodeType[type])
|
||||
return name === this.type || name === deprecatedType
|
||||
})
|
||||
if (nodeType) {
|
||||
this.type = Configuration.nodeType[nodeType]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getName() {
|
||||
return Utility.getNameFromPath(this.path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user