Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.plural = function (count, sn, pl) {
if (arguments.length === 1) {
return inflect.pluralize(count);
}
if (typeof sn !== 'string') sn = '';
if (!pl) {
pl = inflect.pluralize(sn);
}
if (typeof count === 'string') {
count = Number(count);
} else if (typeof count !== 'number') {
count = size(count);
}
return (count === 1 ? sn : pl).replace('*', count);
};
exports.plural = function (count, sn, pl) {
if (arguments.length === 1) {
return inflect.pluralize(count);
}
if (typeof sn !== 'string') sn = '';
if (!pl) {
pl = inflect.pluralize(sn);
}
if (typeof count === 'string') {
count = Number(count);
} else if (typeof count !== 'number') {
count = size(count);
}
return (count === 1 ? sn : pl).replace('*', count);
};