import { globMatch, globBest, globStructured } from "@/boxes/wildcard"

const ci = process.platform === "win32"

/** Glob match — case-insensitive on Windows, matching original behaviour */
export function match(str: string, pattern: string) {
  return globMatch(str, pattern, ci)
}

/** Best match from pattern map */
export function all(input: string, patterns: Record<string, any>) {
  return globBest(input, patterns, ci)
}

/** Structured head/tail match */
export function allStructured(input: { head: string; tail: string[] }, patterns: Record<string, any>) {
  return globStructured(input, patterns, ci)
}

export * as Wildcard from "./wildcard"
