Skip to content

Commit

Permalink
Use pluralize
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Nov 18, 2024
1 parent 34ae53d commit 62a9f87
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .dep-stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@socketregistry/hyrious__bun.lockb": "1.0.5",
"@socketregistry/yocto-spinner": "^1.0.1",
"@socketsecurity/config": "^2.1.3",
"@socketsecurity/registry": "^1.0.28",
"@socketsecurity/registry": "^1.0.29",
"@socketsecurity/sdk": "^1.3.0",
"blessed": "^0.1.81",
"blessed-contrib": "^4.11.0",
Expand Down Expand Up @@ -55,7 +55,7 @@
"@socketregistry/hyrious__bun.lockb": "1.0.5",
"@socketregistry/yocto-spinner": "^1.0.1",
"@socketsecurity/config": "^2.1.3",
"@socketsecurity/registry": "^1.0.28",
"@socketsecurity/registry": "^1.0.29",
"@socketsecurity/sdk": "^1.3.0",
"blessed": "^0.1.81",
"blessed-contrib": "^4.11.0",
Expand Down
9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@socketregistry/hyrious__bun.lockb": "1.0.5",
"@socketregistry/yocto-spinner": "^1.0.1",
"@socketsecurity/config": "^2.1.3",
"@socketsecurity/registry": "^1.0.28",
"@socketsecurity/registry": "^1.0.29",
"@socketsecurity/sdk": "^1.3.0",
"blessed": "^0.1.81",
"blessed-contrib": "^4.11.0",
Expand Down
3 changes: 2 additions & 1 deletion src/commands/cdxgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import path from 'node:path'
import spawn from '@npmcli/promise-spawn'
import colors from 'yoctocolors-cjs'
import yargsParse from 'yargs-parser'
import { pluralize } from '@socketsecurity/registry/lib/words'

import type { CliSubcommand } from '../utils/meow-with-subcommands'

Expand Down Expand Up @@ -159,7 +160,7 @@ export const cdxgen: CliSubcommand = {
const { length: unknownLength } = unknown
if (unknownLength) {
console.error(
`Unknown argument${unknownLength > 1 ? 's' : ''}: ${yargv._.join(', ')}`
`Unknown ${pluralize('argument', unknownLength)}: ${yargv._.join(', ')}`
)
process.exitCode = 1
return
Expand Down
3 changes: 2 additions & 1 deletion src/commands/optimize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
import { pEach } from '@socketsecurity/registry/lib/promises'
import { escapeRegExp } from '@socketsecurity/registry/lib/regexps'
import { isNonEmptyString } from '@socketsecurity/registry/lib/strings'
import { pluralize } from '@socketsecurity/registry/lib/words'

import { commonFlags } from '../flags'
import { printFlagList } from '../utils/formatting'
Expand Down Expand Up @@ -438,7 +439,7 @@ function createActionMessage(
overrideCount: number,
workspaceCount: number
) {
return `${verb} ${overrideCount} Socket.dev optimized overrides${workspaceCount ? ` in ${workspaceCount} workspace${workspaceCount > 1 ? 's' : ''}` : ''}`
return `${verb} ${overrideCount} Socket.dev optimized overrides${workspaceCount ? ` in ${workspaceCount} ${pluralize('workspace', workspaceCount)}` : ''}`
}

function getDependencyEntries(pkgJson: PackageJson) {
Expand Down

0 comments on commit 62a9f87

Please sign in to comment.