Skip to content

Commit aa91e5c

Browse files
committed
formatting
1 parent a1cba4d commit aa91e5c

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ npm i glob
1717
```
1818

1919
**Note** the npm package name is _not_ `node-glob` that's a
20-
different thing that was abandoned years ago. Just `glob`.
20+
different thing that was abandoned years ago. Just `glob`.
2121

2222
```js
2323
// load using import
@@ -100,20 +100,20 @@ const groupReadableFiles = results
100100
// you'll ignore all markdown files, and all folders named 'docs'
101101
const customIgnoreResults = await glob('**', {
102102
ignore: {
103-
ignored: (p) => /\.md$/.test(p.name),
104-
childrenIgnored: (p) => p.isNamed('docs'),
103+
ignored: p => /\.md$/.test(p.name),
104+
childrenIgnored: p => p.isNamed('docs'),
105105
},
106106
})
107107

108108
// another fun use case, only return files with the same name as
109109
// their parent folder, plus either `.ts` or `.js`
110110
const folderNamedModules = await glob('**/*.{ts,js}', {
111111
ignore: {
112-
ignored: (p) => {
112+
ignored: p => {
113113
const pp = p.parent
114114
return !(p.isNamed(pp.name + '.ts') || p.isNamed(pp.name + '.js'))
115-
}
116-
}
115+
},
116+
},
117117
})
118118

119119
// find all files edited in the last hour, to do this, we ignore
@@ -124,14 +124,14 @@ const newFiles = await glob('**', {
124124
// only want the files, not the dirs
125125
nodir: true,
126126
ignore: {
127-
ignored: (p) => {
128-
return (new Date() - p.mtime) > (60 * 60 * 1000)
127+
ignored: p => {
128+
return new Date() - p.mtime > 60 * 60 * 1000
129129
},
130130
// could add similar childrenIgnored here as well, but
131131
// directory mtime is inconsistent across platforms, so
132132
// probably better not to, unless you know the system
133133
// tracks this reliably.
134-
}
134+
},
135135
})
136136
```
137137

@@ -431,7 +431,7 @@ share the previously loaded cache.
431431
`absolute` may not be used along with `withFileTypes`.
432432

433433
- `posix` Set to true to use `/` as the path separator in
434-
returned results. On posix systems, this has no effect. On
434+
returned results. On posix systems, this has no effect. On
435435
Windows systems, this will return `/` delimited path results,
436436
and absolute paths will be returned in their full resolved UNC
437437
path form, eg insted of `'C:\\foo\\bar'`, it will return

test/memfs.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ for (const pattern of patterns) {
3030
t.strictSame(await glob(pattern, { nodir: true, cwd }), ['/x'])
3131
})
3232
t.test('passing in fs argument', async t => {
33-
t.strictSame(await glob(pattern, { nodir: true, cwd, fs }), ['/x'])
33+
t.strictSame(await glob(pattern, { nodir: true, cwd, fs }), [
34+
'/x',
35+
])
3436
})
3537
})
3638
}

0 commit comments

Comments
 (0)