MCPcopy Index your code
hub / github.com/simstudioai/sim / serializeDate

Function serializeDate

apps/sim/app/api/v1/knowledge/utils.ts:37–41  ·  view source on GitHub ↗
(date: Date | string | null | undefined)

Source from the content-addressed store, hash-verified

35 * Serializes a date value for JSON responses.
36 */
37export function serializeDate(date: Date | string | null | undefined): string | null {
38 if (date === null || date === undefined) return null
39 if (date instanceof Date) return date.toISOString()
40 return String(date)
41}
42
43/**
44 * Formats a KnowledgeBaseWithCounts into the API response shape.

Callers 3

route.tsFile · 0.90
route.tsFile · 0.90
formatKnowledgeBaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected