1- import _ from "lodash" ;
1+ import trimEnd from "lodash/trimEnd " ;
22import tokenTypes from "./tokenTypes" ;
33import Indentation from "./Indentation" ;
44import InlineBlock from "./InlineBlock" ;
@@ -120,7 +120,7 @@ export default class Formatter {
120120 // Take out the preceding space unless there was whitespace there in the original query or another opening parens
121121 const previousToken = tokens [ index - 1 ] ;
122122 if ( previousToken && previousToken . type !== tokenTypes . WHITESPACE && previousToken . type !== tokenTypes . OPEN_PAREN ) {
123- query = _ . trimEnd ( query ) ;
123+ query = trimEnd ( query ) ;
124124 }
125125 query += tokens [ index ] . value ;
126126
@@ -151,7 +151,7 @@ export default class Formatter {
151151
152152 // Commas start a new line (unless within inline parentheses or SQL "LIMIT" clause)
153153 formatComma ( token , query ) {
154- query = _ . trimEnd ( query ) + token . value + " " ;
154+ query = trimEnd ( query ) + token . value + " " ;
155155
156156 if ( this . inlineBlock . isActive ( ) ) {
157157 return query ;
@@ -165,18 +165,18 @@ export default class Formatter {
165165 }
166166
167167 formatWithSpaceAfter ( token , query ) {
168- return _ . trimEnd ( query ) + token . value + " " ;
168+ return trimEnd ( query ) + token . value + " " ;
169169 }
170170
171171 formatWithoutSpaces ( token , query ) {
172- return _ . trimEnd ( query ) + token . value ;
172+ return trimEnd ( query ) + token . value ;
173173 }
174174
175175 formatWithSpaces ( token , query ) {
176176 return query + token . value + " " ;
177177 }
178178
179179 addNewline ( query ) {
180- return _ . trimEnd ( query ) + "\n" + this . indentation . getIndent ( ) ;
180+ return trimEnd ( query ) + "\n" + this . indentation . getIndent ( ) ;
181181 }
182182}
0 commit comments