33 * @copyright 2017 Toru Nagashima. All rights reserved.
44 * See LICENSE file in root directory for full license.
55 */
6- import * as lodash from "lodash"
6+ import sortedIndexBy from "lodash/sortedIndexBy"
7+ import sortedLastIndexBy from "lodash/sortedLastIndexBy"
78import { DirectiveKeyParts , ParseError , Reference , Token , Variable , VAttribute , VDirective , VDirectiveKey , VDocumentFragment , VElement , VExpressionContainer , VIdentifier , VLiteral , VNode } from "../ast"
89import { debug } from "../common/debug"
910import { LocationCalculator } from "../common/location-calculator"
@@ -197,8 +198,8 @@ function replaceTokens(document: VDocumentFragment | null, node: HasRange, newTo
197198 return
198199 }
199200
200- const index = lodash . sortedIndexBy ( document . tokens , node , byRange0 )
201- const count = lodash . sortedLastIndexBy ( document . tokens , node , byRange1 ) - index
201+ const index = sortedIndexBy ( document . tokens , node , byRange0 )
202+ const count = sortedLastIndexBy ( document . tokens , node , byRange1 ) - index
202203 splice ( document . tokens , index , count , newTokens )
203204}
204205
@@ -212,7 +213,7 @@ function insertComments(document: VDocumentFragment | null, newComments: Token[]
212213 return
213214 }
214215
215- const index = lodash . sortedIndexBy ( document . comments , newComments [ 0 ] , byRange0 )
216+ const index = sortedIndexBy ( document . comments , newComments [ 0 ] , byRange0 )
216217 splice ( document . comments , index , 0 , newComments )
217218}
218219
@@ -226,7 +227,7 @@ function insertError(document: VDocumentFragment | null, error: ParseError): voi
226227 return
227228 }
228229
229- const index = lodash . sortedIndexBy ( document . errors , error , byIndex )
230+ const index = sortedIndexBy ( document . errors , error , byIndex )
230231 document . errors . splice ( index , 0 , error )
231232}
232233
0 commit comments