F

filter

Defines a reusable filter that takes arguments. Its cache key is the build's hash of predicate's source plus the arguments' JSON, so every plugin defining the same filter shares one cache entry.

function filter<A extends FilterArgument[]>(predicate: FilterPredicate<A>): (...args: A) => MetroFilter

Parameters

NameTypeDescription
predicateFilterPredicate<A>

Tests a module against the arguments; it may read only its parameters and globals.

Returns

(...args: A) => MetroFilter

A function building the MetroFilter for a set of arguments.