How to use the i.pluralize function in i

To help you get started, we’ve selected a few i examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keystonejs / keystone-classic / admin / client / utils / string.js View on Github external
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);
};
github keystonejs / keystone-classic / admin / client / utils / string.js View on Github external
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);
};

i

custom inflections for nodejs

MIT
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis