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); - }); });