M
path.matchesGlob
History
Added in: v22.5.0, v20.17.0
v22.5.0, v20.17.0
Introduced in: v0.10.0
v0.10.0
Marking the API stable.
v24.8.0, v22.20.0
path.matchesGlob(path, pattern): boolean
Attributes
The path.matchesGlob() method determines if path matches the pattern.
For example:
path.matchesGlob('/foo/bar', '/foo/*'); // true path.matchesGlob('/foo/bar*', 'foo/bird'); // false
A TypeError is thrown if path or pattern are not strings.