Skip to content

Commit 3aa1890

Browse files
committed
formatting
1 parent a3e5146 commit 3aa1890

File tree

4 files changed

+34
-24
lines changed

4 files changed

+34
-24
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Supports these glob features:
3535
- [Posix character
3636
classes](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html),
3737
like `[[:alpha:]]`, supporting the full range of Unicode
38-
characters. For example, `[[:alpha:]]` will match against
39-
`'é'`, though `[a-zA-Z]` will not. Collating symbol and set
38+
characters. For example, `[[:alpha:]]` will match against
39+
`'é'`, though `[a-zA-Z]` will not. Collating symbol and set
4040
matching is not supported, so `[[=e=]]` will _not_ match `'é'`
4141
and `[[.ch.]]` will not match `'ch'` in locales where `ch` is
4242
considered a single character.
@@ -131,19 +131,19 @@ var mm = new Minimatch(pattern, options)
131131
method is mainly for internal use, but is exposed so that it can be
132132
used by a glob-walker that needs to avoid excessive filesystem calls.
133133
- `hasMagic()` Returns true if the parsed pattern contains any
134-
magic characters. Returns false if all comparator parts are
135-
string literals. If the `magicalBraces` option is set on the
134+
magic characters. Returns false if all comparator parts are
135+
string literals. If the `magicalBraces` option is set on the
136136
constructor, then it will consider brace expansions which are
137-
not otherwise magical to be magic. If not set, then a pattern
137+
not otherwise magical to be magic. If not set, then a pattern
138138
like `a{b,c}d` will return `false`, because neither `abd` nor
139139
`acd` contain any special glob characters.
140140

141141
This does **not** mean that the pattern string can be used as a
142142
literal filename, as it may contain magic glob characters that
143-
are escaped. For example, the pattern `\\*` or `[*]` would not
143+
are escaped. For example, the pattern `\\*` or `[*]` would not
144144
be considered to have magic, as the matching portion parses to
145145
the literal string `'*'` and would match a path named `'*'`,
146-
not `'\\*'` or `'[*]'`. The `minimatch.unescape()` method may
146+
not `'\\*'` or `'[*]'`. The `minimatch.unescape()` method may
147147
be used to remove escape characters.
148148

149149
All other methods are internal, and will be called as necessary.
@@ -182,7 +182,7 @@ be escaped or unescaped.
182182
Un-escape a glob string that may contain some escaped characters.
183183

184184
If the `windowsPathsNoEscape` option is used, then square-brace
185-
escapes are removed, but not backslash escapes. For example, it
185+
escapes are removed, but not backslash escapes. For example, it
186186
will turn the string `'[*]'` into `*`, but it will not turn
187187
`'\\*'` into `'*'`, because `\` is a path separator in
188188
`windowsPathsNoEscape` mode.
@@ -261,7 +261,7 @@ This only affects the results of the `Minimatch.hasMagic` method.
261261

262262
If the pattern contains brace expansions, such as `a{b,c}d`, but
263263
no other magic characters, then the `Minipass.hasMagic()` method
264-
will return `false` by default. When this option set, it will
264+
will return `false` by default. When this option set, it will
265265
return `true` for brace expansion as well as other magic glob
266266
characters.
267267

changelog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424

2525
- Add `optimizationLevel` configuration option, and revert the
2626
default back to the 6.2 style minimal optimizations, making the
27-
advanced transforms introduced in 7.0 opt-in. Also, process
27+
advanced transforms introduced in 7.0 opt-in. Also, process
2828
provided file paths in the same way in optimizationLevel:2
2929
mode, so _most_ things that matched with optimizationLevel 1 or
30-
0 _should_ match with level 2 as well. However, level 1 is the
30+
0 _should_ match with level 2 as well. However, level 1 is the
3131
default, out of an abundance of caution.
3232

3333
## 7.0

test/escape-has-magic.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ for (const p of patterns) {
99
const escapep = escape(pattern)
1010
const escapew = escape(pattern, { windowsPathsNoEscape: true })
1111
t.equal(unescape(escapep), pattern, 'posix unescape(' + pattern + ')')
12-
t.equal(unescape(escapew, {
13-
windowsPathsNoEscape: true,
14-
}), pattern, 'win32 unescape(' + pattern + ')')
12+
t.equal(
13+
unescape(escapew, {
14+
windowsPathsNoEscape: true,
15+
}),
16+
pattern,
17+
'win32 unescape(' + pattern + ')'
18+
)
1519
const mmp = new Minimatch(escapep, { ...opts, nocaseMagicOnly: true })
1620
const mmw = new Minimatch(escapew, {
1721
...opts,

test/windows-no-magic-root.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Minimatch} from '../'
1+
import { Minimatch } from '../'
22
import t from 'tap'
33

44
t.test('no magic the root', t => {
@@ -16,15 +16,21 @@ t.test('no magic the root', t => {
1616
t.plan(patterns.length)
1717
for (const p of patterns) {
1818
t.test(p, t => {
19-
t.matchSnapshot(new Minimatch(p, {
20-
platform: 'win32',
21-
nocase: true,
22-
}).set, 'default to true')
23-
t.matchSnapshot(new Minimatch(p, {
24-
windowsNoMagicRoot: false,
25-
platform: 'win32',
26-
nocase: true,
27-
}).set, 'set explicitly false')
19+
t.matchSnapshot(
20+
new Minimatch(p, {
21+
platform: 'win32',
22+
nocase: true,
23+
}).set,
24+
'default to true'
25+
)
26+
t.matchSnapshot(
27+
new Minimatch(p, {
28+
windowsNoMagicRoot: false,
29+
platform: 'win32',
30+
nocase: true,
31+
}).set,
32+
'set explicitly false'
33+
)
2834
t.end()
2935
})
3036
}

0 commit comments

Comments
 (0)