All files ParamPathTemplate.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          18x   18x 18x 15x 7x 7x                 14x      
import ParamUniversalTemplate from './ParamUniversalTemplate.js';
import RouterError from './RouterError.js';
 
export default class ParamPathTemplate extends ParamUniversalTemplate {
    constructor () {
        super(...arguments);
 
        const matchItems = this._paramValue.match;
        for (let matchItem of matchItems) {
            if (typeof matchItem !== 'function') {
                const {routeName} = this._routeName;
                throw new RouterError(RouterError.FUNCTION_EXPECTED, {
                    entity: this._getPartName(),
                    routeName
                });
            }
        }
    }
 
    _getPartName () {
        return 'path';
    }
}