varmemoizeCapped=require('./_memoizeCapped');/** Used to match property names within property paths. */varrePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;/** Used to match backslashes in property paths. */varreEscapeChar=/\\(\\)?/g;/** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */varstringToPath=memoizeCapped(function(string){varresult=[];if(string.charCodeAt(0)===46/* . */){result.push('');}string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,'$1'):(number||match));});returnresult;});module.exports=stringToPath;