On this page

    M

    path.matchesGlob

    History
    path.matchesGlob(path, pattern): boolean
    Attributes
    path:string
    The path to glob-match against.
    pattern:string
    The glob to check the path against.
    Returns:boolean
    Whether or not the path matched the pattern.

    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.