Minor cleanup in stringToPath.

This commit is contained in:
John-David Dalton
2017-02-07 01:52:27 -08:00
parent 62a88ce256
commit fdd7a5b8d2

View File

@@ -1,8 +1,7 @@
import memoizeCapped from './memoizeCapped.js'
/** Used to match property names within property paths. */
const reEscapeChar = /\\(\\)?/g
const reLeadingDot = /^\./
const rePropName = RegExp(
// Match anything that isn't a dot or bracket.
'[^.[\\]]+' + '|' +
@@ -17,9 +16,6 @@ const rePropName = RegExp(
'(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))'
, 'g')
/** Used to match backslashes in property paths. */
const reEscapeChar = /\\(\\)?/g
/**
* Converts `string` to a property path array.
*