Implements a TypeScript filter (see typescriptlang.org).