From 6661363c570400c3dc280c85c748bfd53dac214f Mon Sep 17 00:00:00 2001 From: Viktor <20797519+kondurake@users.noreply.github.com> Date: Sat, 9 May 2020 12:11:10 +0300 Subject: [PATCH] Ability to check if a word is countable --- pluralize.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pluralize.js b/pluralize.js index 1829fc8..78e768c 100644 --- a/pluralize.js +++ b/pluralize.js @@ -188,6 +188,15 @@ irregularSingles, irregularPlurals, pluralRules ); + /** + * Check if a word is countable. + * + * @type {Function} + */ + pluralize.isCountable = function(word) { + return !(word.toLowerCase() in uncountables); + }; + /** * Check if a word is plural. *