fix(core): do not add an ending new line when serializing a json (#23440)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #19315
This commit is contained in:
parent
381e5cd494
commit
5757350ebd
@ -38,7 +38,8 @@ export function writeJson<T extends object = object>(
|
||||
value: T,
|
||||
options?: JsonSerializeOptions
|
||||
): void {
|
||||
tree.write(path, serializeJson(value, options));
|
||||
const serialized = serializeJson(value, options);
|
||||
tree.write(path, `${serialized}\n`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -96,5 +96,5 @@ export function serializeJson<T extends object = object>(
|
||||
input: T,
|
||||
options?: JsonSerializeOptions
|
||||
): string {
|
||||
return JSON.stringify(input, null, options?.spaces ?? 2) + '\n';
|
||||
return JSON.stringify(input, null, options?.spaces ?? 2);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user