<commit_before>import {Exports, Filter, Query} from ".";

export const join = (filters: Filter[]): Filter => {
    const apply = filters.filter((filter) => filter instanceof Function);
    return (exports) => apply.every((filter) => filter(exports));
};

export const generate = ({filter, name, props, protos, source}: Query): Filter[] => [
    ...[filter].flat(),
    typeof name === "string" ? byName(name) : null,
    props instanceof Array ? byProps(props) : null,
    protos instanceof Array ? byProtos(protos) : null,
    source instanceof Array ? bySource(source) : null
];<commit_msg>Adjust filters generation<commit_after>import {Exports, Filter, Query} from ".";

export const join = (filters: Filter[]): Filter => {
    return (exports) => filters.every((filter) => filter(exports));
};

export const generate = ({filter, name, props, protos, source}: Query): Filter[] => [
    ...[filter].flat(),
    typeof name === "string" ? byName(name) : null,
    props instanceof Array ? byProps(props) : null,
    protos instanceof Array ? byProtos(protos) : null,
    source instanceof Array ? bySource(source) : null
].filter(Boolean);
{'fraction_non_alphanumeric': 0.1649122807017544, 'fraction_numerical': 0.0, 'mean_word_length': 4.407582938388626, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1184483', 'n_tokens_mistral': 323, 'n_tokens_neox': 322, 'n_words': 101}