Files
lan-manager/web/node_modules/@antv/path-util/esm/parse-path.js
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

35 lines
1021 B
JavaScript

import { each, isArray, isString } from '@antv/util';
var regexTags = /[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/ig;
var regexDot = /[^\s\,]+/ig;
function parsePath(p) {
var path = p || [];
if (isArray(path)) {
return path;
}
if (isString(path)) {
path = path.match(regexTags);
each(path, function (item, index) {
// @ts-ignore
item = item.match(regexDot);
if (item[0].length > 1) {
var tag = item[0].charAt(0);
// @ts-ignore
item.splice(1, 0, item[0].substr(1));
// @ts-ignore
item[0] = tag;
}
// @ts-ignore
each(item, function (sub, i) {
if (!isNaN(sub)) {
// @ts-ignore
item[i] = +sub;
}
});
// @ts-ignore
path[index] = item;
});
return path;
}
}
export default parsePath;
//# sourceMappingURL=parse-path.js.map