Files
crawlab/frontend/src/utils/path.ts
2021-07-15 21:37:37 +08:00

9 lines
174 B
TypeScript

export const getPrimaryPath = (path: string): string => {
const arr = path.split('/');
if (arr.length <= 1) {
return path;
} else {
return `/${arr[1]}`;
}
};