-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pluralize ALL_UPPERCASE words adding lowercase postfix #131
Comments
+1 for this. I assumed that
would work, but it still outputs "IPS". |
I have a solution, will throw a PR to this and as well capture some missed cases as well
|
Create the PR https://github.com/blakeembrey/pluralize/pull/136 |
This is not an easy thing to fix and anyone wanting a fix should specify how they think it should work overall, not just in their one use-case. Both these examples assume pluralization is just adding an The simplest thing would be to remove all case changing, but I suspect that some people do rely on this behavior today. This is especially important to do correctly once, since this library has been functionally equivalent for over 6 years, but this issue has only been request in the past couple of months. |
I can see the complexities in the |
Definitely! Any thoughts on what the API should look like to support this? Edit: The only obvious idea I have is adding a "sensitive" option to the add APIs that skips changing things. I.e. if you say "sensitive" it will not change what you added to the library, so it will return you |
If you have an exact (string) plural rule (e.g. pluralize.addPluralRule("IP", "IPs")), I think it"s safe to ignore the casing since you"ve explicitly defined the plural version. Unfortunately, looking at the code, it seems the library converts string plural rules into a regex 😅 . |
With pluralize version 8.0.0, pluralize("ID", 2) return "IDS".
I would like to to have some option to make it returns "IDs"
The text was updated successfully, but these errors were encountered: