mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
stringToPath: avoid shadowing variable (#3226)
- remove the shadowing done using `string` variable declared in upper scope
This commit is contained in:
@@ -28,10 +28,10 @@ const stringToPath = memoizeCapped((string) => {
|
|||||||
if (reLeadingDot.test(string)) {
|
if (reLeadingDot.test(string)) {
|
||||||
result.push('')
|
result.push('')
|
||||||
}
|
}
|
||||||
string.replace(rePropName, (match, expression, quote, string) => {
|
string.replace(rePropName, (match, expression, quote, subString) => {
|
||||||
let key = match
|
let key = match
|
||||||
if (quote) {
|
if (quote) {
|
||||||
key = string.replace(reEscapeChar, '$1')
|
key = subString.replace(reEscapeChar, '$1')
|
||||||
}
|
}
|
||||||
else if (expression) {
|
else if (expression) {
|
||||||
key = expression.trim()
|
key = expression.trim()
|
||||||
|
|||||||
Reference in New Issue
Block a user