plurals / pluralize

Pluralize or singularize any word based on a count
MIT License
2.12k stars 178 forks source link

Add a pluralize.if(string, boolean) #196

Closed flexa-david closed 1 year ago

flexa-david commented 1 year ago

Does this feature exist? If I created it would it be merged?

Easier than having to go cats.length > 1 ? pluralize('cat') : 'cat' It'd just be pluralize.if('cat', cats.length > 1)

blakeembrey commented 1 year ago

No, you can just do pluralize('cat', cats.length) already.

blakeembrey commented 1 year ago

Alternatively, if your concern is around the unclarity of knowing the input string is already singular we could make that explicit in a future version.