spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / diff / hooks / views / layout / plural / plural.ts
10 lines · 294 BRaw
1/**
2 * `1 file`, `2 files`: the count, a space, and the noun with an `s` unless
3 * the count is one.
4 *
5 * @param count how many
6 * @param noun the singular noun
7 * @returns the phrase
8 */
9export const plural = (count: number, noun: string) =>
10 count === 1 ? `1 ${noun}` : `${count} ${noun}s`