File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ const filesStream = globStream(['**/*.dat', 'logs/**/*.log'])
5555// construct a Glob object if you wanna do it that way, which
5656// allows for much faster walks if you have to look in the same
5757// folder multiple times.
58- const g = new Glob (' **/foo' )
58+ const g = new Glob (' **/foo' , {} )
5959// glob objects are async iterators, can also do globIterate() or
6060// g.iterate(), same deal
6161for await (const file of g ) {
@@ -358,6 +358,8 @@ An object that can perform glob pattern traversals.
358358
359359### ` const g = new Glob(pattern: string | string[], options: GlobOptions) `
360360
361+ Options object is required.
362+
361363See full options descriptions below.
362364
363365Note that a previous ` Glob ` object can be passed as the
Original file line number Diff line number Diff line change @@ -379,6 +379,9 @@ export class Glob<Opts extends GlobOptions> implements GlobOptions {
379379 * again.
380380 */
381381 constructor ( pattern : string | string [ ] , opts : Opts ) {
382+ /* c8 ignore start */
383+ if ( ! opts ) throw new TypeError ( 'glob options required' )
384+ /* c8 ignore stop */
382385 this . withFileTypes = ! ! opts . withFileTypes as FileTypes < Opts >
383386 this . signal = opts . signal
384387 this . follow = ! ! opts . follow
You can’t perform that action at this time.
0 commit comments