slugify.js 260 B

1234567
  1. var trim = require('./trim');
  2. var dasherize = require('./dasherize');
  3. var cleanDiacritics = require('./cleanDiacritics');
  4. module.exports = function slugify(str) {
  5. return trim(dasherize(cleanDiacritics(str).replace(/[^\w\s-]/g, '-').toLowerCase()), '-');
  6. };