fix(lineendings): normalize calendar line endings to CRLF
This commit is contained in:
parent
d15d0be707
commit
379a79617b
|
@ -151,7 +151,7 @@ export function addEventsToCalendar(calendarComponent, results, overrideFlag = f
|
|||
|
||||
// Save calendar data to file
|
||||
export function saveCalendarFile(filename, content) {
|
||||
const normalizedContent = content.replace(/\r\n/g, '\n').trimEnd(); // Normalize to LF
|
||||
const normalizedContent = content.replace(/\r?\n/g, '\r\n').trimEnd(); // Normalize to CRLF
|
||||
const filePath = path.join(MERGED_CALENDARS_DIR, filename);
|
||||
// console.log(`Saving calendar data to file: ${filePath}`);
|
||||
fs.writeFileSync(filePath, normalizedContent);
|
||||
|
|
|
@ -12,7 +12,7 @@ process.chdir(__dirname)
|
|||
// console.log(process.cwd());
|
||||
const app = require('../src/server').default;
|
||||
|
||||
const normalizeLineEndings = (str) => str.replace(/\r\n/g, '\n').trimEnd();
|
||||
const normalizeLineEndings = (str) => str.replace(/\r\n/g, '\r\n').trimEnd(); // Normalize to CRLF
|
||||
|
||||
describe('Calendar Merging API', () => {
|
||||
beforeAll(async () => {
|
||||
|
|
Loading…
Reference in New Issue