Quoted keys supported

This commit is contained in:
barsdeveloper
2023-08-11 18:37:48 +02:00
parent ed43ee3edd
commit 5bda087b81
5 changed files with 98 additions and 41 deletions

View File

@@ -88,7 +88,10 @@ export default class Serializer {
for (const key of keys) {
const value = entity[key]
if (value !== undefined && this.showProperty(entity, key)) {
const keyValue = entity instanceof Array ? `(${key})` : key
let keyValue = entity instanceof Array ? `(${key})` : key
if (attributes[key]?.quoted) {
keyValue = `"${keyValue}"`
}
const isSerialized = Utility.isSerialized(entity, key)
if (first) {
first = false