Skip to content

Commit

Permalink
fix: re-enable forceQuotes while also fixing systemVars behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
brotheroftux committed Sep 18, 2024
1 parent d3c80c2 commit 2c4a8b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/services/metadata/mergeMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ export const mergeMetadata = ({
// That way js-yaml wouldn't include it in the serialized YAML
// However, that way, this would overwrite (delete) existing properties, e.g.: sourcePath
// Because of this, we spread objects to create properties if necessary
const systemVarsMetadataToSpread = isObject(systemVars)
? {__system: JSON.stringify(systemVars)}
: undefined;
const systemVarsMetadataToSpread = isObject(systemVars) ? {__system: systemVars} : undefined;
const innerMetadataToSpread =
mergedInnerMetadata.length > 0 ? {metadata: mergedInnerMetadata} : undefined;

Expand Down
2 changes: 1 addition & 1 deletion src/services/metadata/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const parseExistingMetadata = (
};

export const serializeMetadata = (objectMetadata: FileMetadata) => {
const dumped = unescapeLiquidSubstitutionSyntax(dump(objectMetadata).trimEnd());
const dumped = unescapeLiquidSubstitutionSyntax(dump(objectMetadata, {forceQuotes: true}));

// This empty object check is a bit naive
// The other option would be to check if all own fields are `undefined`,
Expand Down

0 comments on commit 2c4a8b3

Please sign in to comment.