Sha256: d693e7db38acd37a0904c375c93bb9dc0de275176ae92404cba9130786f595f7
Contents?: true
Size: 550 Bytes
Versions: 36
Compression:
Stored size: 550 Bytes
Contents
'use strict'; module.exports = function () { var str = [].map.call(arguments, function (str) { return str.trim(); }).filter(function (str) { return str.length; }).join('-'); if (!str.length) { return ''; } if (str.length === 1 || !(/[_.\- ]+/).test(str) ) { if (str[0] === str[0].toLowerCase() && str.slice(1) !== str.slice(1).toLowerCase()) { return str; } return str.toLowerCase(); } return str .replace(/^[_.\- ]+/, '') .toLowerCase() .replace(/[_.\- ]+(\w|$)/g, function (m, p1) { return p1.toUpperCase(); }); };
Version data entries
36 entries across 21 versions & 11 rubygems