All files RouteOptions.js

100% Statements 7/7
100% Branches 2/2
100% Functions 2/2
100% Lines 7/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25    45x             200x         200x 200x 200x 200x       600x      
import Options from './Options.js';
 
const routeDefaultOptions = {
    canBeMatched: true,
    canBeGenerated: true
};
 
export default class RouteOptions extends Options {
    constructor (rawOptions, routeName) {
        super(rawOptions, {
            entity: 'route\'s options',
            routeName
        });
 
        RouteOptions.setBooleanOption(this, 'canBeMatched', rawOptions, routeDefaultOptions);
        RouteOptions.setBooleanOption(this, 'canBeGenerated', rawOptions, routeDefaultOptions);
        this.routeName = routeName;
        this.priority = +rawOptions.priority || 0;
    }
 
    _getDefaultOptions () {
        return routeDefaultOptions;
    }
}