Skip to content

Commit

Permalink
Revert "fix: clea sql white spaces \n fix #21 (#26)" (#28)
Browse files Browse the repository at this point in the history
This reverts commit b632f62.
  • Loading branch information
wewoor authored May 11, 2021
1 parent b632f62 commit bff1618
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions test/utils/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

0 comments on commit bff1618

Please sign in to comment.