MCPcopy Create free account
hub / github.com/NomicFoundation/hardhat / pluralize

Function pluralize

packages/hardhat-utils/src/string.ts:12–22  ·  view source on GitHub ↗
(
  singular: string,
  count: number,
  plural?: string,
)

Source from the content-addressed store, hash-verified

10 * @returns The pluralized string.
11 */
12export function pluralize(
13 singular: string,
14 count: number,
15 plural?: string,
16): string {
17 if (count === 1) {
18 return singular;
19 }
20
21 return plural !== undefined ? plural : `${singular}s`;
22}
23
24/**
25 * Capitalizes the first letter of a string.

Callers 2

string.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected