Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Inflector.ordinal(1002) // => 'nd'
Inflector.ordinal(1003) // => 'rd'
Inflector.ordinal(-11) // => 'th'
Inflector.ordinal(-1021) // => 'st'
Inflector.ordinalize(1) // => '1st'
Inflector.ordinalize(2) // => '2nd'
Inflector.ordinalize(1002) // => '1002nd'
Inflector.ordinalize(1003) // => '1003rd'
Inflector.ordinalize(-11) // => '-11th'
Inflector.ordinalize(-1021) // => '-1021st'
Inflector.transliterate('Ærøskøbing') // => 'AEroskobing'
Inflector.parameterize('Donald E. Knuth') // => 'donald-e-knuth'
Inflector.parameterize('Donald E. Knuth', { separator: '+' }) // => 'donald+e+knuth'
function convertToSlug(string) {
var ret = inflector.parameterize(
inflector.transliterate('' + (string || '')));
if (ret === '') {
return 'slug';
}
return ret;
}
exports.parameterize = (value) => (value ? Inflector.parameterize(value.trim()) : '');
export default function buildEventUrl(event) {
return `/events/${event.id}-${parameterize(event.title)}`;
}