umts/pvta-multiplatform

View on GitHub
src/providers/departure-sort.service.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Injectable } from '@angular/core';
import { Storage } from '@ionic/storage';

@Injectable()
export class DepartureSortService {

  constructor(public storage: Storage) {  }

  validate(sort: string): string {
    if (sort === 'route' || sort === 'time') {
      return sort;
    } else {
      this.storage.set('departureSort', 'route');
      return 'route';
    }
  }
}