You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/misc.ts
+12-10Lines changed: 12 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -9,28 +9,30 @@ import type { ListWithLength, Prettify, Stringifiable } from "./types.js";
9
9
exporttypePluralType="auto"|"-s"|"-ies";
10
10
11
11
/**
12
-
* Automatically appends an `s` to the passed {@linkcode word}, if {@linkcode num} is not equal to 1
13
-
* @param word A word in singular form, to auto-convert to plural
14
-
* @param num A number, or list-like value that has either a `length`, `count` or `size` property - does not support iterables
15
-
* @param pluralType Which plural form to use when auto-pluralizing. Defaults to `auto`, which removes the last char and uses `-ies` for words ending in `y` and simply appends `-s` for all other words
12
+
* Automatically pluralizes the given string an `-s` or `-ies` to the passed {@linkcode term}, if {@linkcode num} is not equal to 1.
13
+
* By default, words ending in `-y` will have it replaced with `-ies`, and all other words will simply have `-s` appended.
14
+
* If {@linkcode num} resolves to NaN or the {@linkcode pluralType} is wrong, it defaults to the {@linkcode pluralType} `auto` and sets {@linkcode num} to 2.
15
+
* @param term The term, written in singular form, to auto-convert to plural form
16
+
* @param num A number, or list-like value that has either a `length`, `count` or `size` property, like an array, Map or discord.js Collection - does not support iterables, they need to be converted to an array first
17
+
* @param pluralType Which plural form to use when auto-pluralizing. Defaults to `"auto"`, which removes the last char and uses `-ies` for words ending in `y` and simply appends `-s` for all other words
0 commit comments