function routes2Reg(routes) {
    let reg;
    if (typeof routes === 'string') {
        reg = pathToRegexp(routes);
    }
    else if (routes instanceof RegExp) {
        return routes;
    }

    return reg;
}
@file utils.router.js
@author lavas