MCPcopy Create free account
hub / github.com/callstack/agent-device / normalizeOptionalText

Function normalizeOptionalText

src/commands/text.ts:3–9  ·  view source on GitHub ↗
(
  value: string | undefined,
  field: string,
)

Source from the content-addressed store, hash-verified

1import { AppError } from '../kernel/errors.ts';
2
3export function normalizeOptionalText(
4 value: string | undefined,
5 field: string,
6): string | undefined {
7 if (value === undefined) return undefined;
8 return requireText(value, field);
9}
10
11export function requireText(value: string | undefined, field: string): string {
12 const text = value?.trim();

Callers 4

settingsCommandFunction · 0.90
closeAppCommandFunction · 0.90
normalizeOpenTargetFunction · 0.90
normalizeDeviceTargetFunction · 0.90

Calls 1

requireTextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…