Skip to content

Commit

Permalink
Inlined arrays fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
barsdeveloper committed Mar 25, 2024
1 parent 77a583e commit c14212b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions dist/ueblueprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -3083,7 +3083,7 @@ class Grammar {
/**
* @template T
* @param {AttributeInfo<T>} attribute
* @returns {Parsernostrum<DescribedType<T>>}
* @returns {Parsernostrum<T>}
*/
static grammarFor(attribute, type = attribute?.type, defaultGrammar = this.unknownValue) {
let result = defaultGrammar;
Expand All @@ -3104,6 +3104,7 @@ class Grammar {
: Parsernostrum.alt(acc, cur)
);
} else if (type instanceof MirroredEntity) {
// @ts-expect-error
return this.grammarFor(undefined, type.getTargetType())
.map(v => new MirroredEntity(type.type, () => v))
} else if (attribute?.constructor === Object) {
Expand Down Expand Up @@ -6125,7 +6126,7 @@ class Serializer {
} else {
result += attributeSeparator;
}
if (attributes[key]?.inlined) {
if (AttributeInfo.getAttribute(entity, key, "inlined")) {
result += this.doWrite(
value,
insideString,
Expand All @@ -6134,7 +6135,7 @@ class Serializer {
attributeSeparator,
false,
attributeValueConjunctionSign,
attributes[key].type instanceof Array
AttributeInfo.getAttribute(entity, key, "type") instanceof Array
? k => attributeKeyPrinter(`${keyValue}${k}`)
: k => attributeKeyPrinter(`${keyValue}.${k}`)
);
Expand Down
2 changes: 1 addition & 1 deletion dist/ueblueprint.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/serialization/Serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default class Serializer {
} else {
result += attributeSeparator
}
if (attributes[key]?.inlined) {
if (AttributeInfo.getAttribute(entity, key, "inlined")) {
result += this.doWrite(
value,
insideString,
Expand All @@ -105,7 +105,7 @@ export default class Serializer {
attributeSeparator,
false,
attributeValueConjunctionSign,
attributes[key].type instanceof Array
AttributeInfo.getAttribute(entity, key, "type") instanceof Array
? k => attributeKeyPrinter(`${keyValue}${k}`)
: k => attributeKeyPrinter(`${keyValue}.${k}`)
)
Expand Down

0 comments on commit c14212b

Please sign in to comment.