Skip to content

Commit 2b61484

Browse files
committed
Readme tweaks
1 parent ff3e1f9 commit 2b61484

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

readme.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,28 @@ const globby = require('globby');
4343

4444
## API
4545

46-
### globby(patterns, [options])
46+
### globby(patterns, options?)
4747

48-
Returns a `Promise<Array>` of matching paths.
48+
Returns a `Promise<string[]>` of matching paths.
4949

5050
#### patterns
5151

52-
Type: `string` `Array`
52+
Type: `string | string[]`
5353

5454
See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).
5555

5656
#### options
5757

58-
Type: `Object`
58+
Type: `object`
5959

6060
See the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-1) in addition to the ones below.
6161

6262
##### expandDirectories
6363

64-
Type: `boolean` `Array` `Object`<br>
64+
Type: `boolean | string[] | object`<br>
6565
Default: `true`
6666

67-
If set to `true`, `globby` will automatically glob directories for you. If you define an `Array` it will only glob files that matches the patterns inside the `Array`. You can also define an `Object` with `files` and `extensions` like below:
67+
If set to `true`, `globby` will automatically glob directories for you. If you define an `Array` it will only glob files that matches the patterns inside the `Array`. You can also define an `object` with `files` and `extensions` like below:
6868

6969
```js
7070
(async () => {
@@ -89,25 +89,25 @@ Default: `false`
8989

9090
Respect ignore patterns in `.gitignore` files that apply to the globbed files.
9191

92-
### globby.sync(patterns, [options])
92+
### globby.sync(patterns, options?)
9393

94-
Returns an `Array` of matching paths.
94+
Returns `string[]` of matching paths.
9595

96-
### globby.generateGlobTasks(patterns, [options])
96+
### globby.generateGlobTasks(patterns, options?)
9797

98-
Returns an `Array<Object>` in the format `{pattern: string, options: Object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages.
98+
Returns an `object[]` in the format `{pattern: string, options: Object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages.
9999

100100
Note that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration.
101101

102-
### globby.hasMagic(patterns, [options])
102+
### globby.hasMagic(patterns, options?)
103103

104104
Returns a `boolean` of whether there are any special glob characters in the `patterns`.
105105

106106
Note that the options affect the results. If `noext: true` is set, then `+(a|b)` will not be considered a magic pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`, then that is considered magical, unless `nobrace: true` is set.
107107

108108
This function is backed by [`node-glob`](https://github.com/isaacs/node-glob#globhasmagicpattern-options)
109109

110-
### globby.gitignore([options])
110+
### globby.gitignore(options?)
111111

112112
Returns a `Promise<(path: string) => boolean>` indicating whether a given path is ignored via a `.gitignore` file.
113113

@@ -123,7 +123,7 @@ const {gitignore} = require('globby');
123123
})();
124124
```
125125

126-
### globby.gitignore.sync([options])
126+
### globby.gitignore.sync(options?)
127127

128128
Returns a `(path: string) => boolean` indicating whether a given path is ignored via a `.gitignore` file.
129129

0 commit comments

Comments
 (0)