Simple serialization entities fixes and tests

This commit is contained in:
barsdeveloper
2024-03-30 20:07:26 +01:00
parent acedafc339
commit 279163cd54
24 changed files with 315 additions and 146 deletions

View File

@@ -80,14 +80,13 @@ export default class Serializer {
attributeKeyPrinter = this.attributeKeyPrinter
) {
let result = ""
const attributes = IEntity.getAttributes(entity)
const keys = Object.keys(entity)
let first = true
for (const key of keys) {
const value = entity[key]
if (value !== undefined && this.showProperty(entity, key)) {
let keyValue = entity instanceof Array ? `(${key})` : key
if (attributes[key]?.quoted) {
if (AttributeInfo.getAttribute(entity, key, "quoted")) {
keyValue = `"${keyValue}"`
}
const isSerialized = AttributeInfo.getAttribute(entity, key, "serialized")