@qvant/qui-max
Version:
A Vue 3 Design system for Web.
17 lines (16 loc) • 627 B
JavaScript
import memoizeCapped from "./_memoizeCapped.js";
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
var reEscapeChar = /\\(\\)?/g;
var stringToPath = memoizeCapped(function(string) {
var result = [];
if (string.charCodeAt(0) === 46) {
result.push("");
}
string.replace(rePropName, function(match, number, quote, subString) {
result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
});
return result;
});
var stringToPath$1 = stringToPath;
export { stringToPath$1 as default };
//# sourceMappingURL=_stringToPath.js.map