MCPcopy Create free account
hub / github.com/Effect-TS/effect / renderParamLabel

Function renderParamLabel

packages/effect/src/unstable/cli/internal/wizard.ts:205–211  ·  view source on GitHub ↗
(single: Param.Single<Param.ParamKind, unknown>)

Source from the content-addressed store, hash-verified

203const renderParamMessage = (single: Param.Single<Param.ParamKind, unknown>): string => renderParamLabel(single)
204
205const renderParamLabel = (single: Param.Single<Param.ParamKind, unknown>): string => {
206 const description = Option.getOrUndefined(single.description)?.trim()
207 const label = single.kind === Param.flagKind && description !== undefined && description.length <= 32
208 ? description
209 : humanize(single.name)
210 return single.kind === Param.flagKind ? `${label} (${formatName(single)})` : label
211}
212
213const humanize = (name: string): string => {
214 const words = name.split(/[-_]+/).filter((word) => word.length > 0)

Callers 2

wizard.tsFile · 0.85
renderParamMessageFunction · 0.85

Calls 2

humanizeFunction · 0.85
formatNameFunction · 0.85

Tested by

no test coverage detected