<commit_before>import { Pipe, PipeTransform } from '@angular/core';
import * as _ from 'lodash';

import { Todo } from './todo.model';

@Pipe({
    name: 'asCompletedFilter'
})
export class CompletedFilterPipe implements PipeTransform {
    transform(todos: Todo[], done: boolean): Todo[] {
        if (done) {
            return todos;
        }

        return _.filter(todos, {done});
    }
}<commit_msg>use array filter for smaller bundle<commit_after>import { Pipe, PipeTransform } from '@angular/core';

import { Todo } from './todo.model';

@Pipe({
    name: 'asCompletedFilter'
})
export class CompletedFilterPipe implements PipeTransform {
    transform(todos: Todo[], done: boolean): Todo[] {
        if (done) {
            return todos;
        }

        return todos.filter(todo => todo.done === done);
    }
}
{'fraction_non_alphanumeric': 0.13713592233009708, 'fraction_numerical': 0.0, 'mean_word_length': 3.004854368932039, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5551626', 'n_tokens_mistral': 260, 'n_tokens_neox': 257, 'n_words': 68}