From 2f0e73f0d408d42ec68d30352d25ade1a6558a14 Mon Sep 17 00:00:00 2001 From: Yury Shkoda Date: Tue, 15 Mar 2022 17:02:17 +0300 Subject: [PATCH] fix(regexp): fixed newLine utility --- src/formatter/regexp.spec.ts | 1 - src/formatter/regexp.ts | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/formatter/regexp.spec.ts b/src/formatter/regexp.spec.ts index 9bcb245..0c14571 100644 --- a/src/formatter/regexp.spec.ts +++ b/src/formatter/regexp.spec.ts @@ -1,5 +1,4 @@ import { newLine } from './' -import { isWindows } from '../utils' describe('newLine', () => { it('should return correct new line regexp entry for windows', () => { diff --git a/src/formatter/regexp.ts b/src/formatter/regexp.ts index 9cb8b34..6fc362e 100644 --- a/src/formatter/regexp.ts +++ b/src/formatter/regexp.ts @@ -1,3 +1,5 @@ -import { isWindows } from '../' +// FIXME: if isWindows is used, it breaks cli.spec.ts because Logger is undefined +// import { isWindows } from '../' +// export const newLine = () => (isWindows() ? '\\r\\n' : '\\n') -export const newLine = () => (isWindows() ? '\\r\\n' : '\\n') +export const newLine = () => (process.platform === 'win32' ? '\\r\\n' : '\\n')