UNPKG

@nestjs/graphql

Version:

Nest - modern, fast, powerful node.js web framework (@graphql)

22 lines (21 loc) 559 B
"use strict"; 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); }