Skip to content

Commit

Permalink
feat: \n line endings in generated IRs (adelsz#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
adelsz authored May 1, 2022
1 parent 00d4735 commit e20711b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/cli/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ export async function processFile(
const suffix = transform.mode === 'ts' ? 'types.ts' : 'ts';
decsFileName = path.resolve(ppath.dir, `${ppath.name}.${suffix}`);
}
const contents = fs.readFileSync(fileName).toString();

// last part fixes https://github.com/adelsz/pgtyped/issues/390
const contents = fs.readFileSync(fileName).toString().replace(/\r\n/g, '\n');

const { declarationFileContents, typeDecs } = await generateDeclarationFile(
contents,
fileName,
Expand Down

0 comments on commit e20711b

Please sign in to comment.