utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ANSI escape code cleaner
	ANSI_CLEANER = regexp.MustCompile(`(\x9B|\x1B\[)[0-?]*[ -\/]*[@-~]`)

	// ANSI non-color escape code cleaner, matches only control codes
	ANSI_CONTROL_CLEANER = regexp.MustCompile(`(\x9B|\x1B\[)[0-?]*[ -\/]*[@-ln-~]`)
)

Functions

func RemoveAllANSI added in v0.2.0

func RemoveAllANSI(input string) string

func RemoveControlANSI added in v0.2.0

func RemoveControlANSI(input string) string

Types

type PathFilter

type PathFilter struct {
	// contains filtered or unexported fields
}

A filter that matches paths.

func NewPathFilterFromSlice

func NewPathFilterFromSlice(slice []string, recursive bool) *PathFilter

func (*PathFilter) Match

func (f *PathFilter) Match(item string) bool

func (*PathFilter) MatchAny

func (f *PathFilter) MatchAny(items []string) bool

func (*PathFilter) SetStrict

func (f *PathFilter) SetStrict()

Force the filter to match nothing if it is empty.

type PathTree

type PathTree map[string]interface{}

func NewPathTree

func NewPathTree() PathTree

func (PathTree) Add

func (t PathTree) Add(path string)

func (PathTree) Contains

func (t PathTree) Contains(path string) bool

type StringFilter

type StringFilter struct {
	// contains filtered or unexported fields
}

A filter that matches strings.

func NewStringFilterFromSlice

func NewStringFilterFromSlice(slice []string) *StringFilter

func (*StringFilter) Match

func (f *StringFilter) Match(item string) bool

func (*StringFilter) MatchAny

func (f *StringFilter) MatchAny(items []string) bool

func (*StringFilter) SetStrict

func (f *StringFilter) SetStrict()

Force the filter to match nothing if it is empty.

Jump to

Keyboard shortcuts

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