mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Eslint prefer-const (#17864)
* adds prefer-const to eslint config and runs fixer * reverts unintended change
This commit is contained in:
@@ -5,11 +5,11 @@ export default function (arr = [], attribute = 'id') {
|
||||
// this assumes an already sorted array
|
||||
// if the array is sorted, we want to compare the first and last
|
||||
// item in the array - if they share a prefix, all of the items do
|
||||
let firstString = arr[0][attribute];
|
||||
let lastString = arr[arr.length - 1][attribute];
|
||||
const firstString = arr[0][attribute];
|
||||
const lastString = arr[arr.length - 1][attribute];
|
||||
|
||||
// the longest the shared prefix could be is the length of the match
|
||||
let targetLength = firstString.length;
|
||||
const targetLength = firstString.length;
|
||||
let prefixLength = 0;
|
||||
// walk the two strings, and if they match at the current length,
|
||||
// increment the prefixLength and try again
|
||||
|
||||
Reference in New Issue
Block a user