MCPcopy Index your code
hub / github.com/anomalyco/opencode / matchSequence

Function matchSequence

packages/opencode/src/util/wildcard.ts:47–57  ·  view source on GitHub ↗
(items: string[], patterns: string[])

Source from the content-addressed store, hash-verified

45}
46
47function matchSequence(items: string[], patterns: string[]): boolean {
48 if (patterns.length === 0) return true
49 const [pattern, ...rest] = patterns
50 if (pattern === "*") return matchSequence(items, rest)
51 for (let i = 0; i < items.length; i++) {
52 if (match(items[i], pattern) && matchSequence(items.slice(i + 1), rest)) {
53 return true
54 }
55 }
56 return false
57}
58
59export * as Wildcard from "./wildcard"

Callers 1

allStructuredFunction · 0.85

Calls 1

matchFunction · 0.70

Tested by

no test coverage detected