Update checked-in dependencies
This commit is contained in:
parent
6b0d45a5c6
commit
cc1adb825a
4247 changed files with 144820 additions and 149530 deletions
16
node_modules/eslint/lib/source-code/token-store/utils.js
generated
vendored
16
node_modules/eslint/lib/source-code/token-store/utils.js
generated
vendored
|
|
@ -4,12 +4,6 @@
|
|||
*/
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const lodash = require("lodash");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
@ -29,18 +23,16 @@ function getStartLocation(token) {
|
|||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Binary-searches the index of the first token which is after the given location.
|
||||
* Finds the index of the first token which is after the given location.
|
||||
* If it was not found, this returns `tokens.length`.
|
||||
* @param {(Token|Comment)[]} tokens It searches the token in this list.
|
||||
* @param {number} location The location to search.
|
||||
* @returns {number} The found index or `tokens.length`.
|
||||
*/
|
||||
exports.search = function search(tokens, location) {
|
||||
return lodash.sortedIndexBy(
|
||||
tokens,
|
||||
{ range: [location] },
|
||||
getStartLocation
|
||||
);
|
||||
const index = tokens.findIndex(el => location <= getStartLocation(el));
|
||||
|
||||
return index === -1 ? tokens.length : index;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue