infinity-forge
Version:
14 lines • 429 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatStringToUrl = formatStringToUrl;
function formatStringToUrl(text) {
return text
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.replace(/[^a-z0-9\s-]/g, '')
.trim()
.replace(/\s+/g, '-')
.replace(/-+/g, '-');
}
//# sourceMappingURL=format-string-to-url.js.map