From bff16187428efa8373dcb53c3554a47b412baccd Mon Sep 17 00:00:00 2001 From: Ziv Date: Tue, 11 May 2021 13:37:34 +0800 Subject: [PATCH] Revert "fix: clea sql white spaces \n fix #21 (#26)" (#28) This reverts commit b632f62678a140d094c9a956d29fb50951a28e33. --- src/utils/index.ts | 2 +- test/utils/index.test.ts | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 44952a2..f869013 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -163,7 +163,7 @@ function splitSql(sql: string) { * @param {String} sql */ function cleanSql(sql: string) { - sql = sql.trim(); // 删除前后空格 + sql.trim(); // 删除前后空格 const tokens = lexer(sql); let resultSql = ''; let startIndex = 0; diff --git a/test/utils/index.test.ts b/test/utils/index.test.ts index 3b69ff6..1215835 100644 --- a/test/utils/index.test.ts +++ b/test/utils/index.test.ts @@ -39,12 +39,4 @@ describe('utils', () => { const result = cleanSql(sql); expect(result.indexOf('xxx')).toEqual(-1); }); - - test('clean SQL white spaces', () => { - const sql = ` - select * from a; `; - const expected = 'select * from a;'; - const result = cleanSql(sql); - expect(result).toEqual(expected); - }); });