@types/micromatch

  • Version 4.0.9
  • Published
  • 25.1 kB
  • 1 dependency
  • MIT license

Install

npm i @types/micromatch
yarn add @types/micromatch
pnpm add @types/micromatch

Overview

TypeScript definitions for micromatch

Index

Variables

variable micromatch

const micromatch: Micromatch;

    Interfaces

    interface Item

    interface Item {}

      property glob

      glob: string;

        property input

        input: string;

          property output

          output: string;

            property regex

            regex: RegExp;

              interface Options

              interface Options {}

                property basename

                basename?: boolean | undefined;
                • Allow glob patterns without slashes to match a file path based on its basename. Same behavior as [minimatch](https://github.com/isaacs/minimatch) option matchBase.

                  false

                  Example 1

                  mm(['a/b.js', 'a/c.md'], '*.js');
                  //=> []
                  mm(['a/b.js', 'a/c.md'], '*.js', {matchBase: true});
                  //=> ['a/b.js']

                property bash

                bash?: boolean | undefined;
                • Enabled by default, this option enforces bash-like behavior with stars immediately following a bracket expression. Bash bracket expressions are similar to regex character classes, but unlike regex, a star following a bracket expression **does not repeat the bracketed characters**. Instead, the star is treated the same as an other star.

                  true

                  Example 1

                  var files = ['abc', 'ajz'];
                  console.log(mm(files, '[a-c]*'));
                  //=> ['abc', 'ajz']
                  console.log(mm(files, '[a-c]*', {bash: false}));

                property capture

                capture?: boolean | undefined;
                • Return regex matches in supporting methods.

                  undefined

                property contains

                contains?: boolean | undefined;
                • Allows glob to match any part of the given string(s).

                  undefined

                property cwd

                cwd?: string | undefined;
                • Current working directory. Used by picomatch.split()

                  process.cwd()

                property debug

                debug?: boolean | undefined;
                • Debug regular expressions when an error is thrown.

                  undefined

                property dot

                dot?: boolean | undefined;
                • Match dotfiles. Otherwise dotfiles are ignored unless a . is explicitly defined in the pattern.

                  false

                property expandRange

                expandRange?:
                | ((left: string, right: string, options: Options) => string)
                | undefined;
                • Custom function for expanding ranges in brace patterns, such as {a..z}. The function receives the range values as two arguments, and it must return a string to be used in the generated regex. It's recommended that returned strings be wrapped in parentheses. This option is overridden by the expandBrace option.

                  undefined

                property failglob

                failglob?: boolean | undefined;
                • Similar to the --failglob behavior in Bash, throws an error when no matches are found.

                  false

                property fastpaths

                fastpaths?: boolean | undefined;
                • To speed up processing, full parsing is skipped for a handful common glob patterns. Disable this behavior by setting this option to false.

                  true

                property flags

                flags?: boolean | undefined;
                • Regex flags to use in the generated regex. If defined, the nocase option will be overridden.

                  undefined

                property format

                format?: ((returnedString: string) => string) | undefined;
                • Custom function for formatting the returned string. This is useful for removing leading slashes, converting Windows paths to Posix paths, etc.

                  undefined

                property ignore

                ignore?: string | readonly string[] | undefined;
                • One or more glob patterns for excluding strings that should not be matched from the result.

                  undefined

                property keepQuotes

                keepQuotes?: boolean | undefined;
                • Retain quotes in the generated regex, since quotes may also be used as an alternative to backslashes.

                  false

                property literalBrackets

                literalBrackets?: boolean | undefined;
                • When true, brackets in the glob pattern will be escaped so that only literal brackets will be matched.

                  undefined

                property lookbehinds

                lookbehinds?: boolean | undefined;
                • Support regex positive and negative lookbehinds. Note that you must be using Node 8.1.10 or higher to enable regex lookbehinds.

                  true

                property matchBase

                matchBase?: boolean | undefined;
                • Alias for basename.

                  false

                property maxLength

                maxLength?: number | undefined;
                • Limit the max length of the input string. An error is thrown if the input string is longer than this value.

                  65536

                property nobrace

                nobrace?: boolean | undefined;
                • Disable brace matching, so that {a,b} and {1..3} would be treated as literal characters.

                  false

                property nobracket

                nobracket?: boolean | undefined;
                • Disable matching with regex brackets.

                  undefined

                property nocase

                nocase?: boolean | undefined;
                • Perform case-insensitive matching. Equivalent to the regex i flag. Note that this option is ignored when the flags option is defined.

                  false

                property noext

                noext?: boolean | undefined;
                • Alias for noextglob

                  false

                property noextglob

                noextglob?: boolean | undefined;
                • Disable support for matching with extglobs (like +(a|b))

                  false

                property noglobstar

                noglobstar?: boolean | undefined;
                • Disable matching with globstars (**).

                  undefined

                property nonegate

                nonegate?: boolean | undefined;
                • Disallow negation (!) patterns, and treat leading ! as a literal character to match.

                  undefined

                property noquantifiers

                noquantifiers?: boolean | undefined;
                • Disable support for regex quantifiers (like a{1,2}) and treat them as brace patterns to be expanded.

                  false

                property onIgnore

                onIgnore?: ((item: Item) => void) | undefined;
                • Function to be called on ignored items.

                  undefined

                property onMatch

                onMatch?: ((item: Item) => void) | undefined;
                • Function to be called on matched items.

                  undefined

                property onResult

                onResult?: ((item: Item) => void) | undefined;
                • Function to be called on all items, regardless of whether or not they are matched or ignored.

                  undefined

                property posix

                posix?: boolean | undefined;
                • Support POSIX character classes ("posix brackets").

                  false

                property prepend

                prepend?: boolean | undefined;
                • String to prepend to the generated regex used for matching.

                  undefined

                property regex

                regex?: boolean | undefined;
                • Use regular expression rules for + (instead of matching literal +), and for stars that follow closing parentheses or brackets (as in )* and ]*).

                  false

                property strictBrackets

                strictBrackets?: boolean | undefined;
                • Throw an error if brackets, braces, or parens are imbalanced.

                  undefined

                property strictSlashes

                strictSlashes?: boolean | undefined;
                • When true, picomatch won't match trailing slashes with single stars.

                  undefined

                property unescape

                unescape?: boolean | undefined;
                • Remove backslashes from returned matches.

                  undefined

                  Example 1

                  In this example we want to match a literal *:

                  mm.match(['abc', 'a\\*c'], 'a\\*c');
                  //=> ['a\\*c']
                  mm.match(['abc', 'a\\*c'], 'a\\*c', {unescape: true});
                  //=> ['a*c']

                property windows

                windows?: boolean | undefined;
                • Convert all slashes in file paths to forward slashes. This does not convert slashes in the glob pattern itself

                  undefined

                interface ScanInfo

                interface ScanInfo {}

                  property base

                  base: string;

                    property glob

                    glob: string;

                      property input

                      input: string;

                        property isBrace

                        isBrace: boolean;

                          property isBracket

                          isBracket: boolean;

                            property isExtglob

                            isExtglob: boolean;

                              property isGlob

                              isGlob: boolean;

                                property isGlobstar

                                isGlobstar: boolean;

                                  property negated

                                  negated: boolean;

                                    property negatedExtglob

                                    negatedExtglob: boolean;

                                      property prefix

                                      prefix: string;

                                        property start

                                        start: number;

                                          interface ScanInfoToken

                                          interface ScanInfoToken {}

                                            property backslashes

                                            backslashes?: boolean | undefined;

                                              property depth

                                              depth: number;

                                                property isBrace

                                                isBrace?: boolean | undefined;

                                                  property isBracket

                                                  isBracket?: boolean | undefined;

                                                    property isExtglob

                                                    isExtglob?: boolean | undefined;

                                                      property isGlob

                                                      isGlob: boolean;

                                                        property isGlobstar

                                                        isGlobstar?: boolean | undefined;

                                                          property isPrefix

                                                          isPrefix?: boolean | undefined;

                                                            property negated

                                                            negated?: boolean | undefined;

                                                              property value

                                                              value: string;

                                                                interface ScanInfoWithParts

                                                                interface ScanInfoWithParts extends ScanInfo {}

                                                                  property parts

                                                                  parts: string[];

                                                                    property slashes

                                                                    slashes: number[];

                                                                      interface ScanInfoWithTokens

                                                                      interface ScanInfoWithTokens extends ScanInfoWithParts {}

                                                                        property maxDepth

                                                                        maxDepth: number;

                                                                          property tokens

                                                                          tokens: ScanInfoToken[];

                                                                            interface ScanOptions

                                                                            interface ScanOptions extends Options {}

                                                                              property parts

                                                                              parts?: boolean | undefined;
                                                                              • When true, the returned object will include an array of strings representing each path "segment" in the scanned glob pattern. This is automatically enabled when options.tokens is true.

                                                                                false

                                                                              property tokens

                                                                              tokens?: boolean | undefined;
                                                                              • When true, the returned object will include an array of tokens (objects), representing each path "segment" in the scanned glob pattern.

                                                                                false

                                                                              Package Files (1)

                                                                              Dependencies (1)

                                                                              Dev Dependencies (0)

                                                                              No dev dependencies.

                                                                              Peer Dependencies (0)

                                                                              No peer dependencies.

                                                                              Badge

                                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/micromatch.

                                                                              • Markdown
                                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/micromatch)
                                                                              • HTML
                                                                                <a href="https://www.jsdocs.io/package/@types/micromatch"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>