Skip to content

Commit

Permalink
don't need shallow copy when we create new object
Browse files Browse the repository at this point in the history
which is the case using `.map()`
  • Loading branch information
cderv committed Mar 5, 2025
1 parent 6accac6 commit 640976b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/command/render/freeze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,16 @@ export function freezeExecuteResult(
const innerResult = {
...result,
includes: result.includes ? { ...result.includes } : undefined,
supporting: [...result.supporting],
} as ExecuteResult;
const resolveIncludes = (
name: "include-in-header" | "include-before-body" | "include-after-body",
) => {
if (innerResult.includes) {
if (innerResult.includes[name]) {
innerResult.includes[name] = [
...innerResult.includes[name]!.map((file) =>
// Storing file content using LF line ending
format(Deno.readTextFileSync(file), LF)
),
];
innerResult.includes[name] = innerResult.includes[name]!.map((file) =>
// Storing file content using LF line ending
format(Deno.readTextFileSync(file), LF)
);
}
}
};
Expand Down

0 comments on commit 640976b

Please sign in to comment.