Bump to v4.7.0.

This commit is contained in:
John-David Dalton
2016-03-25 23:47:49 -07:00
parent 501d6b1d41
commit 18d0f1d873
419 changed files with 4042 additions and 2066 deletions

View File

@@ -1,4 +1,5 @@
var toString = require('./toString');
var memoize = require('./memoize'),
toString = require('./toString');
/** Used to match property names within property paths. */
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g;
@@ -13,12 +14,12 @@ var reEscapeChar = /\\(\\)?/g;
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
function stringToPath(string) {
var stringToPath = memoize(function(string) {
var result = [];
toString(string).replace(rePropName, function(match, number, quote, string) {
result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
});
return result;
}
});
module.exports = stringToPath;