@nestjs/graphql
Version:
GraphQL for NestJS: code-first and schema-first APIs, resolvers as providers, subscriptions, federation and generated SDL, on Apollo or Mercurius.
22 lines • 612 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeRoutePath = normalizeRoutePath;
function addStartingSlash(text) {
if (!text) {
return text;
}
return text[0] !== '/' ? '/' + text : text;
}
function stripEndingSlash(text) {
if (!text) {
return text;
}
return text[text.length - 1] === '/' && text.length > 1
? text.slice(0, text.length - 1)
: text;
}
function normalizeRoutePath(path) {
path = addStartingSlash(path);
return stripEndingSlash(path);
}
//# sourceMappingURL=normalize-route-path.util.js.map