Fix typos (#417)
This commit is contained in:
1 parent
bb53d60349
commit
3de316a964
3 files changed
+4
-4
No files matched your search
@@ -69,7 +69,7 @@ describe('pattern', () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it('globstar matches immediately preceeding directory', () => {
|
it('globstar matches immediately preceding directory', () => {
|
||||||
const root = IS_WINDOWS ? 'C:\\' : '/'
|
const root = IS_WINDOWS ? 'C:\\' : '/'
|
||||||
const pattern = new Pattern(`${root}foo/bar/**`)
|
const pattern = new Pattern(`${root}foo/bar/**`)
|
||||||
const actual = [
|
const actual = [
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export {GlobOptions}
|
|||||||
*/
|
*/
|
||||||
export interface Globber {
|
export interface Globber {
|
||||||
/**
|
/**
|
||||||
* Returns the search path preceeding the first glob segment, from each pattern.
|
* Returns the search path preceding the first glob segment, from each pattern.
|
||||||
* Duplicates and descendants of other paths are filtered out.
|
* Duplicates and descendants of other paths are filtered out.
|
||||||
*
|
*
|
||||||
* Example 1: The patterns `/foo/*` and `/bar/*` returns `/foo` and `/bar`.
|
* Example 1: The patterns `/foo/*` and `/bar/*` returns `/foo` and `/bar`.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export class Pattern {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The path/pattern segments. Note, only the first segment (the root directory)
|
* The path/pattern segments. Note, only the first segment (the root directory)
|
||||||
* may contain a directory separator charactor. Use the trailingSeparator field
|
* may contain a directory separator character. Use the trailingSeparator field
|
||||||
* to determine whether the pattern ended with a trailing slash.
|
* to determine whether the pattern ended with a trailing slash.
|
||||||
*/
|
*/
|
||||||
readonly segments: string[]
|
readonly segments: string[]
|
||||||
@@ -130,7 +130,7 @@ export class Pattern {
|
|||||||
itemPath = pathHelper.normalizeSeparators(itemPath)
|
itemPath = pathHelper.normalizeSeparators(itemPath)
|
||||||
|
|
||||||
// Append a trailing slash. Otherwise Minimatch will not match the directory immediately
|
// Append a trailing slash. Otherwise Minimatch will not match the directory immediately
|
||||||
// preceeding the globstar. For example, given the pattern `/foo/**`, Minimatch returns
|
// preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns
|
||||||
// false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.
|
// false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.
|
||||||
if (!itemPath.endsWith(path.sep)) {
|
if (!itemPath.endsWith(path.sep)) {
|
||||||
// Note, this is safe because the constructor ensures the pattern has an absolute root.
|
// Note, this is safe because the constructor ensures the pattern has an absolute root.
|
||||||
|
|||||||
Reference in new issue
Block a user