UNPKG

swagger-routes-express

Version:

Connect Express route controllers to restful paths using a Swagger 2 or OpenAPI 3 definition file

9 lines (7 loc) 259 B
/** * Trim the trailing / off the base if it exists * @param base — A base path maybe ending with '/' * @returns the base path without the trailing / */ const trimBase = base => (base.endsWith('/') ? base.slice(0, -1) : base) module.exports = trimBase