Comparing version 10.0.0 to 10.1.0
@@ -241,2 +241,11 @@ /// <reference types="node" /> | ||
debug?: boolean; | ||
/** | ||
* Return `/` delimited paths, even on Windows. | ||
* | ||
* On posix systems, this has no effect. But, on Windows, it means that | ||
* paths will be `/` delimited, and absolute paths will be their full | ||
* resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return | ||
* `'//?/C:/foo/bar'` | ||
*/ | ||
posix?: boolean; | ||
} | ||
@@ -246,2 +255,4 @@ export type GlobOptionsWithFileTypesTrue = GlobOptions & { | ||
absolute?: undefined; | ||
mark?: undefined; | ||
posix?: undefined; | ||
}; | ||
@@ -248,0 +259,0 @@ export type GlobOptionsWithFileTypesFalse = GlobOptions & { |
@@ -30,2 +30,3 @@ /// <reference types="node" /> | ||
platform?: NodeJS.Platform; | ||
posix?: boolean; | ||
realpath?: boolean; | ||
@@ -32,0 +33,0 @@ root?: string; |
@@ -37,3 +37,3 @@ "use strict"; | ||
this.opts = opts; | ||
this.#sep = opts.platform === 'win32' ? '\\' : '/'; | ||
this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/'; | ||
if (opts.ignore) { | ||
@@ -135,10 +135,11 @@ this.#ignore = makeIgnore(opts.ignore, opts); | ||
else if (abs) { | ||
this.matchEmit(e.fullpath() + mark); | ||
const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath(); | ||
this.matchEmit(abs + mark); | ||
} | ||
else { | ||
const rel = e.relative(); | ||
const rel = this.opts.posix ? e.relativePosix() : e.relative(); | ||
const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) | ||
? '.' + this.#sep | ||
: ''; | ||
this.matchEmit(!rel && mark ? '.' + mark : pre + rel + mark); | ||
this.matchEmit(!rel ? '.' + mark : pre + rel + mark); | ||
} | ||
@@ -145,0 +146,0 @@ } |
@@ -241,2 +241,11 @@ /// <reference types="node" /> | ||
debug?: boolean; | ||
/** | ||
* Return `/` delimited paths, even on Windows. | ||
* | ||
* On posix systems, this has no effect. But, on Windows, it means that | ||
* paths will be `/` delimited, and absolute paths will be their full | ||
* resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return | ||
* `'//?/C:/foo/bar'` | ||
*/ | ||
posix?: boolean; | ||
} | ||
@@ -246,2 +255,4 @@ export type GlobOptionsWithFileTypesTrue = GlobOptions & { | ||
absolute?: undefined; | ||
mark?: undefined; | ||
posix?: undefined; | ||
}; | ||
@@ -248,0 +259,0 @@ export type GlobOptionsWithFileTypesFalse = GlobOptions & { |
@@ -30,2 +30,3 @@ /// <reference types="node" /> | ||
platform?: NodeJS.Platform; | ||
posix?: boolean; | ||
realpath?: boolean; | ||
@@ -32,0 +33,0 @@ root?: string; |
@@ -34,3 +34,3 @@ /** | ||
this.opts = opts; | ||
this.#sep = opts.platform === 'win32' ? '\\' : '/'; | ||
this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/'; | ||
if (opts.ignore) { | ||
@@ -132,10 +132,11 @@ this.#ignore = makeIgnore(opts.ignore, opts); | ||
else if (abs) { | ||
this.matchEmit(e.fullpath() + mark); | ||
const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath(); | ||
this.matchEmit(abs + mark); | ||
} | ||
else { | ||
const rel = e.relative(); | ||
const rel = this.opts.posix ? e.relativePosix() : e.relative(); | ||
const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) | ||
? '.' + this.#sep | ||
: ''; | ||
this.matchEmit(!rel && mark ? '.' + mark : pre + rel + mark); | ||
this.matchEmit(!rel ? '.' + mark : pre + rel + mark); | ||
} | ||
@@ -142,0 +143,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "the most correct and second fastest glob implementation in JavaScript", | ||
"version": "10.0.0", | ||
"version": "10.1.0", | ||
"repository": { | ||
@@ -66,3 +66,3 @@ "type": "git", | ||
"minipass": "^5.0.0", | ||
"path-scurry": "^1.6.4" | ||
"path-scurry": "^1.7.0" | ||
}, | ||
@@ -69,0 +69,0 @@ "devDependencies": { |
@@ -20,3 +20,3 @@ # Glob | ||
**Note** the npm package name is _not_ `node-glob` that's a | ||
different thing that was abandoned years ago. Just `glob`. | ||
different thing that was abandoned years ago. Just `glob`. | ||
@@ -104,4 +104,4 @@ ```js | ||
ignore: { | ||
ignored: (p) => /\.md$/.test(p.name), | ||
childrenIgnored: (p) => p.isNamed('docs'), | ||
ignored: p => /\.md$/.test(p.name), | ||
childrenIgnored: p => p.isNamed('docs'), | ||
}, | ||
@@ -114,7 +114,7 @@ }) | ||
ignore: { | ||
ignored: (p) => { | ||
ignored: p => { | ||
const pp = p.parent | ||
return !(p.isNamed(pp.name + '.ts') || p.isNamed(pp.name + '.js')) | ||
} | ||
} | ||
}, | ||
}, | ||
}) | ||
@@ -130,4 +130,4 @@ | ||
ignore: { | ||
ignored: (p) => { | ||
return (new Date() - p.mtime) > (60 * 60 * 1000) | ||
ignored: p => { | ||
return new Date() - p.mtime > 60 * 60 * 1000 | ||
}, | ||
@@ -138,3 +138,3 @@ // could add similar childrenIgnored here as well, but | ||
// tracks this reliably. | ||
} | ||
}, | ||
}) | ||
@@ -438,2 +438,9 @@ ``` | ||
- `posix` Set to true to use `/` as the path separator in | ||
returned results. On posix systems, this has no effect. On | ||
Windows systems, this will return `/` delimited path results, | ||
and absolute paths will be returned in their full resolved UNC | ||
path form, eg insted of `'C:\\foo\\bar'`, it will return | ||
`//?/C:/foo/bar`. | ||
- `platform` Defaults to value of `process.platform` if | ||
@@ -440,0 +447,0 @@ available, or `'linux'` if not. Setting `platform:'win32'` on |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
419359
3968
1088
Updatedpath-scurry@^1.7.0