All files / src/domain/ErrorPageConfig index.js

100% Statements 5/5
100% Branches 2/2
100% Functions 2/2
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14          18x 9x 4x     5x      
import { List } from 'immutable';
import is from 'is_js';
 
export default class ErrorPageConfig {
  static get(routes) {
    const routeWithConfig = new List(routes).findLast((route) => is.object(route.errorPage));
    if (is.undefined(routeWithConfig)) {
      return undefined;
    }
 
    return routeWithConfig.errorPage;
  }
}