MCPcopy
hub / github.com/coder/mux / parseNonEmptyString

Function parseNonEmptyString

src/common/preferences/userPreferenceParsing.ts:9–11  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

7}
8
9export function parseNonEmptyString(value: unknown): string | undefined {
10 return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
11}
12
13export function parseBoolean(value: unknown): boolean | undefined {
14 return typeof value === "boolean" ? value : undefined;

Callers 5

parseStringRecordFunction · 0.90
parseStringArrayFunction · 0.70
parseModelStringFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected