nomonic
    Preparing search index...

    Function compilePattern

    • Compile a .nomonicignore glob pattern into a regular expression.

      Supported glob syntax:

      • * matches any characters except /
      • ** matches zero or more directories
      • ? matches a single character except /
      • Leading / anchors the pattern to the repository root
      • Trailing / matches a directory and everything inside it

      Parameters

      • pattern: string

        A glob pattern string (e.g. "drizzle/**").

      Returns RegExp

      A compiled RegExp that can be passed to isIgnored.

      const re = compilePattern('drizzle/**')
      re.test('drizzle/migrations/001.sql') // true