import { valueConverter } from 'aurelia-framework' ; import { RouteConfig } from 'aurelia-router' ; @ valueConverter ( 'authFilter' ) export class AuthFilterValueConverter { toView ( routes , isAuthenticated ) { return routes . filter ( route => typeof route . settings . auth !== 'boolean' || route . settings . auth === isAuthenticated ) ; } }