MCPcopy Create free account
hub / github.com/TanStack/cli / normalizeParamValue

Function normalizeParamValue

packages/cli/src/telemetry.ts:76–99  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

74}
75
76function normalizeParamValue(value: unknown): number | string | undefined {
77 if (value === undefined || value === null) {
78 return undefined
79 }
80
81 if (typeof value === 'boolean') {
82 return value ? 1 : 0
83 }
84
85 if (typeof value === 'number') {
86 return Number.isFinite(value) ? value : undefined
87 }
88
89 if (typeof value === 'string') {
90 return truncateValue(value)
91 }
92
93 const cleaned = cleanProperties(value)
94 if (cleaned === undefined) {
95 return undefined
96 }
97
98 return truncateValue(JSON.stringify(cleaned))
99}
100
101function createTelemetryRequestBody(
102 event: string,

Callers 1

Calls 2

truncateValueFunction · 0.85
cleanPropertiesFunction · 0.85

Tested by

no test coverage detected