mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-14 07:47:29 +08:00
Various fixes
This commit is contained in:
@@ -51,14 +51,14 @@ export default class ISerializer {
|
||||
let result = ""
|
||||
let fullKey = key.concat("")
|
||||
const last = fullKey.length - 1
|
||||
for (const property in object) {
|
||||
for (const property of Object.getOwnPropertyNames(object)) {
|
||||
fullKey[last] = property
|
||||
const value = object[property]
|
||||
if (object[property]?.constructor === Object) {
|
||||
// Recursive call when finding an object
|
||||
result += (result.length ? this.separator : "")
|
||||
+ this.subWrite(fullKey, value)
|
||||
} else if (this.showProperty(fullKey, value)) {
|
||||
} else if (value !== undefined && this.showProperty(fullKey, value)) {
|
||||
result += (result.length ? this.separator : "")
|
||||
+ this.prefix
|
||||
+ this.attributeKeyPrinter(fullKey)
|
||||
|
||||
@@ -51,7 +51,7 @@ ${this.subWrite([], object)
|
||||
+ object
|
||||
.CustomProperties.map(pin => this.separator + this.prefix + "CustomProperties " + SerializerFactory.getSerializer(PinEntity).write(pin))
|
||||
.join("")}
|
||||
End Object`
|
||||
End Object\n`
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export default function initializeSerializerFactory() {
|
||||
)
|
||||
SerializerFactory.registerSerializer(
|
||||
LocalizedTextEntity,
|
||||
new GeneralSerializer(v => `${LocalizedTextEntity.lookbehind}(${v})`, LocalizedTextEntity, "", ",", false, "", _ => "")
|
||||
new GeneralSerializer(v => `${LocalizedTextEntity.lookbehind}(${v})`, LocalizedTextEntity, "", ", ", false, "", _ => "")
|
||||
)
|
||||
SerializerFactory.registerSerializer(
|
||||
PinReferenceEntity,
|
||||
|
||||
Reference in New Issue
Block a user