Files
agency/.pnpm-store/v3/files/9a/808d9c3baca72f18c416e988c9e602c1782909d019ef73b4dac63a67a511b7528452027f2e8fc9059a5d9646d7c6a2511a566717e86b2a45801574348f3f5c
hanzo-agent 5af6960b87 run project
Run: sess_f37640604ae254cb4d11dc6217f7b721
2026-09-30 00:04:56 +00:00

24 lines
510 B
Plaintext

import globParent from 'glob-parent'
// Based on `glob-base`
// https://github.com/micromatch/glob-base/blob/master/index.js
export function parseGlob(pattern) {
let glob = pattern
let base = globParent(pattern)
if (base !== '.') {
glob = pattern.substr(base.length)
if (glob.charAt(0) === '/') {
glob = glob.substr(1)
}
}
if (glob.substr(0, 2) === './') {
glob = glob.substr(2)
} else if (glob.charAt(0) === '/') {
glob = glob.substr(1)
}
return { base, glob }
}