Skip to content

Commit

Permalink
fix: better replace with regex
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaferri committed Sep 24, 2024
1 parent 26560fa commit 977c319
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/utils/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ export const getReportCSV = async (data: ReportTimeEntry[]): Promise<string> =>
[
entry.date,
entry.email,
'"' + entry.name?.replace('"', '\\"') + '"',
'"' + entry.name?.replace('/"/g', '\\"') + '"',
entry.company,
entry.crew,
'"' + entry.customer.replace('"', '\\"') + '"',
'"' + entry.task.name.replace('"', '\\"') + '"',
'"' + entry.project.name.replace('"', '\\"') + '"',
'"' + entry.customer.replace('/"/g', '\\"') + '"',
'"' + entry.task.name.replace('/"/g', '\\"') + '"',
'"' + entry.project.name.replace('/"/g', '\\"') + '"',
entry.project.type,
entry.project.plannedHours,
entry.hours,
'"' + entry.description?.replace('"', '\\"') + '"',
'"' + entry.description?.replace('/"/g', '\\"') + '"',
entry.startHour,
entry.endHour,
].join(',') + '\n';
Expand Down

0 comments on commit 977c319

Please sign in to comment.