commons:glob-parse

This commit is contained in:
Code 2025-02-13 23:55:35 +01:00
parent 0adbd5757a
commit a8ee605ba0
2 changed files with 7 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -11,6 +11,7 @@ import { isFile, isFolder } from '../fs.js'
import { PATH_INFO } from '../types_common.js'
import { globBase } from './glob-base.js'
import { parseGlob } from './glob-parse.js'
export { globBase } from './glob-base.js'
export { globParent } from './glob-parent.js'
@ -21,7 +22,7 @@ export const getExtensions = (glob: string) => {
if (match) {
return glob.substring((match.index || 0) + 2, glob.lastIndexOf(')')).split('|')
} else {
// return [parseGlob(glob).path.ext]
return [parseGlob(glob).path.ext]
}
}
@ -90,7 +91,7 @@ export const pathInfo = (src: string, altToken: boolean = false, cwd: string = n
variables.DIR = path.resolve(glob_base.base)
variables.FILE_NAME = glob_base.glob
variables.GLOB = glob_base.glob
//variables.GLOB_EXTENSIONS = getExtensions(glob_base.glob)
variables.GLOB_EXTENSIONS = getExtensions(glob_base.glob)
variables.FILES = globSync(glob_base.glob, {
dot: true,
cwd: path.resolve(cwd || variables.DIR),