PipeTransform is not working ionic2

and I have some item to change words

example : lang->language

I want to ion-option is show all item to uppercase

example : author->Author


author        Author
lang          Language
date          Date
loca          Location


<ion-select [(ngModel)]="refine" (ionChange)="optionsFn(item, i);" >
        <ion-option [value]="item"  *ngFor="let item of totalfilter | mypipe;let i = index" >{{item["@NAME"]}}</ion-option>


   import { Pipe, PipeTransform } from '@angular/core';

    name: 'mypipe', pure: false
export class MyPipe implements PipeTransform {
  public posts;
public post;
  transform(items: any[]): any[] {
      if (items && items.length)
        this.posts = items.filter(it => it["@NAME"] =  it["@NAME"].replace('lang','language'));
        this.post = this.posts.filter(it => it["@NAME"] = it["@NAME"].charAt(0).toUpperCase()+ it["@NAME"].slice(1))

      return this.post;


is not working and error is

Cannot read property ‘filter’ of undefined