minimatch

package
v0.0.0-...-f30d65c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Just a value
	GLOBSTAR = regexp.MustCompile("GLOBSTAR")
)

Functions

func BraceExpansion

func BraceExpansion(str string) []string

func Match

func Match(list []string, pattern string, options Options) []string

* * Match - match a list of strings against the pattern and options

func MatchString

func MatchString(path string, pattern string, options Options) (bool, error)

* * MatchString - a strings against the pattern and options

Types

type BalanceMatchResult

type BalanceMatchResult struct {
	Start int
	End   int
	Pre   string
	Body  string
	Post  string
}

func BalancedMatch

func BalancedMatch(prefix, suffix, str string) (BalanceMatchResult, error)

BalanceMatch is an implementation of the npm package balance-match. This the outter matching pair of "braced" strings for a given string. This does not implement regular expression matching.

type Minimatch

type Minimatch interface {
	Match(path string, partial bool) bool
	MakeRe() (*regexp.Regexp, error)
}

func NewMinimatch

func NewMinimatch(pattern string, options Options) (Minimatch, error)

type Options

type Options struct {
	/**
	 * Debug to stderr
	 */
	Debug bool

	/**
	 * NoBrace-  Do not expand {a,b} and {1..3} brace sets
	 */
	NoBrace bool

	/**
	 * Disable `**` matching against multiple folder names
	 */
	NoGlobStar bool

	///
	// Allow patterns to match filenames starting with a period, even if the pattern does not explicitly have a period in that spot.
	//
	// Note that by default, a/**/b will not match a/.d/b, unless dot is set.
	//
	Dot bool

	/**
	 * Disable "extglob" style patterns like +(a|b).
	 */
	NoExt bool

	/**
	 * Performace a case-insensitive match.
	 */
	NoCase bool

	/**
	* When a match is not found by minimatch.match, return a list containing the pattern itself if this option is set. When not set, an empty list is returned if there are no matches.
	 */
	NoNull bool

	/**
	 *If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, a?b would match the path /xyz/123/acb, but not /xyz/acb/123.
	 */
	MatchBase bool

	/**
	* Suppress the behavior of treating # at the start of a pattern as a comment.
	 */
	NoComment bool

	/**
	 * Suppress the behavior of treating a leading ! character as negation.
	 */
	NoNegate bool

	/**
	 * Returns from negate expressions the same as if they were not negated. (Ie, true on a hit, false on a miss.)
	 */
	FlipNegate bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL