ast-plugin
Version:
The simplest abstract syntax tree walker.
15 lines (12 loc) • 328 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.toPath = void 0;
var toPath = function toPath(path) {
return typeof path === 'string' ? path.replace(/(\[\d+\])/g, function (s) {
return ".".concat(s.slice(1, -1));
}) // [0] -> .0
.split('.') : path;
};
exports.toPath = toPath;