mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 18:07:49 +00:00
Apply more let/const transforms.
This commit is contained in:
10
trim.js
10
trim.js
@@ -6,7 +6,7 @@ import stringToArray from './_stringToArray.js';
|
||||
import toString from './toString.js';
|
||||
|
||||
/** Used to match leading and trailing whitespace. */
|
||||
var reTrim = /^\s+|\s+$/g;
|
||||
const reTrim = /^\s+|\s+$/g;
|
||||
|
||||
/**
|
||||
* Removes leading and trailing whitespace or specified characters from `string`.
|
||||
@@ -38,10 +38,10 @@ function trim(string, chars, guard) {
|
||||
if (!string || !(chars = baseToString(chars))) {
|
||||
return string;
|
||||
}
|
||||
var strSymbols = stringToArray(string),
|
||||
chrSymbols = stringToArray(chars),
|
||||
start = charsStartIndex(strSymbols, chrSymbols),
|
||||
end = charsEndIndex(strSymbols, chrSymbols) + 1;
|
||||
const strSymbols = stringToArray(string);
|
||||
const chrSymbols = stringToArray(chars);
|
||||
const start = charsStartIndex(strSymbols, chrSymbols);
|
||||
const end = charsEndIndex(strSymbols, chrSymbols) + 1;
|
||||
|
||||
return castSlice(strSymbols, start, end).join('');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user