vuepress-plugin-typedoc
Version:
A VuePress plugin to build API documentation with TypeDoc.
19 lines (18 loc) • 577 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.slugify = void 0;
const rControl = /[\u0000-\u001f]/g;
const rSpecial = /[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'“”‘’–—<>,.?/]+/g;
const rCombining = /[\u0300-\u036F]/g;
function slugify(str) {
return (str
.normalize('NFKD')
.replace(rCombining, '')
.replace(rControl, '')
.replace(rSpecial, '-')
.replace(/\-{2,}/g, '-')
.replace(/^\-+|\-+$/g, '')
.replace(/^(\d)/, '_$1')
.toLowerCase());
}
exports.slugify = slugify;
;