MCPcopy Create free account
hub / github.com/pingdotgg/t3code / sanitizeStringArray

Function sanitizeStringArray

apps/web/src/uiStateStore.ts:62–71  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

60}
61
62function sanitizeStringArray(value: unknown): string[] {
63 if (!Array.isArray(value)) {
64 return [];
65 }
66 return [
67 ...new Set(
68 value.filter((entry): entry is string => typeof entry === "string" && entry.length > 0),
69 ),
70 ];
71}
72
73function sanitizeBooleanRecord(value: unknown): Record<string, boolean> {
74 if (!value || typeof value !== "object") {

Callers 1

parsePersistedStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected