From 62a88ce256c9af8a918e2761c0215b43bb103674 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 7 Feb 2017 01:48:00 -0800 Subject: [PATCH] Allow regexp to be minified better. --- .internal/stringToPath.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.internal/stringToPath.js b/.internal/stringToPath.js index 2c181bf8d..51352cc19 100644 --- a/.internal/stringToPath.js +++ b/.internal/stringToPath.js @@ -3,19 +3,19 @@ import memoizeCapped from './memoizeCapped.js' /** Used to match property names within property paths. */ const reLeadingDot = /^\./ -const rePropName = RegExp([ +const rePropName = RegExp( // Match anything that isn't a dot or bracket. - '[^.[\\]]+', + '[^.[\\]]+' + '|' + // Or match property names within brackets. '\\[(?:' + // Match numbers. '(-?\\d+(?:\\.\\d+)?)' + '|' + // Or match strings (supports escaping quotation marks). '(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2' + - ')\\]', + ')\\]'+ '|' + // Or match "" as the space between consecutive dots or empty brackets. '(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))' -].join('|'), 'g') +, 'g') /** Used to match backslashes in property paths. */ const reEscapeChar = /\\(\\)?/g