var path = require('path'); var isarray = require('lodash.isarray'); var pluralize = require('pluralize'); var Q = require('q'); /** * OKUtils! * Cross cutting concerns n stuff */ module.exports = { /** * Return a copy of the route with a trailing slash */ withTrailingSlash: function withTrailingSlash(route) { route = route || ''; return path.normalize(route + '/'); }, /** * Return a copy of the route without a trailing slash */ withoutTrailingSlash: function withoutTrailingSlash(route) { route = route || ''; return route.charAt(route.length - 1) === '/' ? route.slice(0, -1) : route; } };