Open
Description
Describe the bug
Steps to Reproduce
import * as path from 'jsr:@std/[email protected]'
let globpath = 'D:\\a\\forager\\test\\resources\\*.jpg'
path.isGlob(globpath)
// false
path.globToRegExp(globpath)
// /^D:aforagertestresources\*\.jpg\/*$/
Expected behavior
I would expect to see globpath above return true
for a filepath that contains *
even on windows. I would also expect that globToRegExp
would create a valid path delineated regex. See how these functions behave with unix paths below:
import * as path from 'jsr:@std/[email protected]'
let globpath = '/forager/test/resources/*.jpg'
path.isGlob(globpath)
// true
path.globToRegExp(globpath)
// /^\/+forager\/+test\/+resources\/+[^/]*\.jpg\/*$/
My best guess is that this is because globs are mainly used in unix systems. I am building a cross-platform app though that needs some kind of glob support for windows paths. For now I can fork these methods to be more cross-platform, but I think this is probably a good improvement to these utilities.
Environment
- OS:
ubuntu-latest
&windows-latest
on github ci - deno version: 1.44.1
- std version:
1.0.0