// HasPrefixFold is like strings.HasPrefix but uses Unicode case-folding.
514390
func HasPrefixFold(s, prefix string) bool {
	if prefix == "" {
		return true
	}
	for _, pr := range prefix {
		if s == "" {
			return false
		}
		// step with s, too
		sr, size := utf8.DecodeRuneInString(s)
		if sr == utf8.RuneError {
			return false
		}
		s = s[size:]
		if !equalFoldRune(sr, pr) {
			return false
		}
	}
	return true
}
472568
func (p Path) HasPrefix(other Path) bool {
	if len(other) > len(p) {
		return false
	}
	for i := range other {
		if p[i] != other[i] {
			return false
		}
	}
	return true
}
978865
func HasSuffix(s, suffix []rune) bool {
	return len(s) >= len(suffix) && Equal(s[len(s)-len(suffix):], suffix)
}
893753
func asciiEqualFold(s, t []byte) bool {
	if len(s) != len(t) {
		return false
	}
	for i, sb := range s {
		tb := t[i]
		if sb == tb {
			continue
		}
		if ('a' <= sb && sb <= 'z') || ('A' <= sb && sb <= 'Z') {
			if sb&caseMask != tb&caseMask {
				return false
			}
		} else {
			return false
		}
	}
	return true
}
2321
func (r *Router) WithPrefix(prefix string) *Router {
	return &Router{rtr: r.rtr, prefix: r.prefix + prefix, instrh: r.instrh}
}
754438
func fixedPrefixPath(pathspec string) string {
	varBegin := strings.Index(pathspec, "{")
	if -1 == varBegin {
		return pathspec
	}
	return pathspec[:varBegin]
}
1295310
func CheckPrefixFactory(prefixes ...string) func(string) (string, bool) {
	return func(content string) (string, bool) {
		for _, prefix := range prefixes {
			if strings.HasPrefix(content, prefix) {
				return strings.TrimPrefix(content, prefix), true
			}
		}
		return "", false
	}
}
420420
func OptionPrefix(x string) Option {
	return func(p *Prompt) error {
		p.renderer.prefix = x
		return nil
	}
}
1054981
func (v *GenerateServiceRequest) GetPackagePrefix() (o string) {
	if v != nil {
		o = v.PackagePrefix
	}
	return
}
1255689
func (r *Router) matchingPrefixInternal(ctx context.Context, path string) string {
	ns, err := namespace.FromContext(ctx)
	if err != nil {
		return ""
	}
	path = ns.Path + path

	var existing string
	fn := func(existingPath string, v interface{}) bool {
		if strings.HasPrefix(existingPath, path) {
			existing = existingPath
			return true
		}
		return false
	}
	r.root.WalkPrefix(path, fn)
	return existing
}
1132530
func (t *Trie) HasPrefix(prefix string) bool {
	return t.Root.hasPrefix([]byte(prefix))
}
346777
func ArgsWithPrefix(args map[string][]string, prefix string) map[string][]string {
	filtered := map[string][]string{}
	for key, slice := range args {
		if !strings.HasPrefix(key, prefix) {
			continue
		}
		for _, val := range slice {
			filtered[key] = append(filtered[key], val)
		}
	}
	return filtered
}
946816
func HasUpperCase(str string) bool {
	if IsNull(str) {
		return true
	}
	return rxHasUpperCase.MatchString(str)
}
1177772
func HasStage(s []Stage, name string) (int, bool) {
	for i, stage := range s {
		// Stage name is case-insensitive by design
		if strings.EqualFold(stage.Name, name) {
			return i, true
		}
	}
	return -1, false
}
694042
func WithPrefix(ctx context.Context, prefix string) context.Context {
	return context.WithValue(ctx, ctxKeyPrefix, prefix)
}
1371205
func hasPackage(file string, ignoredPackages []string) bool {
	for _, ignoredPackage := range ignoredPackages {
		if strings.Contains(file, ignoredPackage) {
			return true
		}
	}
	return false
}
271545
func hasStringSuffixInSlice(str string, list []string) bool {
	for _, v := range list {
		if strings.HasSuffix(str, v) {
			return true
		}
	}
	return false
}