Files
linux-odyssey/packages/file-graph/utils.js
T
wancat 7405f786a0 feat: add merge function
Able to deal with:
1.  merge a subtree
2023-08-21 22:22:01 +08:00

14 lines
240 B
JavaScript

export function dirname(path) {
const parts = path.split('/')
if (parts.length <= 2) {
return '/'
}
parts.pop()
return parts.join('/')
}
export function basename(path) {
const parts = path.split('/')
return parts.pop()
}