<commit_before>import { Pipe, PipeTransform } from "@angular/core";

import { Grocery } from "../shared";

@Pipe({
  name: "itemStatus"
})
export class ItemStatusPipe implements PipeTransform {
  value: Array<Grocery> = [];
  transform(items: Array<Grocery>, deleted: boolean) {
    if (items && items.length) {
      this.value = items.filter((grocery: Grocery) => {
        return grocery.deleted === deleted;
      });
    }
    return this.value;
  }
}<commit_msg>fix: binding of list items when only one item is left in the array<commit_after>import { Pipe, PipeTransform } from "@angular/core";

import { Grocery } from "../shared";

@Pipe({
  name: "itemStatus"
})
export class ItemStatusPipe implements PipeTransform {
  value: Array<Grocery> = [];
  transform(items: Array<Grocery>, deleted: boolean) {
    if (items instanceof Array) {
      this.value = items.filter((grocery: Grocery) => {
        return grocery.deleted === deleted;
      });
    }
    return this.value;
  }
}
{'fraction_non_alphanumeric': 0.14343434343434344, 'fraction_numerical': 0.0, 'mean_word_length': 3.5251141552511416, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1879032', 'n_tokens_mistral': 309, 'n_tokens_neox': 303, 'n_words': 82}