Skip to content

Function: toPatternMatcher()

toPatternMatcher(patterns, options?): Predicate<string>

Compile patterns into a single OR’d Predicate. Accepts the raw config shapes parseList does - an array, or one comma/whitespace-separated string - so a field and its env var need no separate handling.

With no usable patterns the result always returns false.

string | readonly string[] | null | undefined

PatternOptions = {}

Predicate<string>

const forwardable = toPatternMatcher(process.env.TUNNEL_FORWARD_HEADERS);