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

Function convertTagValue

apps/sim/lib/knowledge/documents/service.ts:1729–1748  ·  view source on GitHub ↗
(
    slot: string,
    value: string | undefined
  )

Source from the content-addressed store, hash-verified

1727 dbUpdateData.processingError = updateData.processingError
1728
1729 const convertTagValue = (
1730 slot: string,
1731 value: string | undefined
1732 ): string | number | Date | boolean | null => {
1733 if (value === undefined || value === '') return null
1734
1735 if (slot.startsWith('number')) {
1736 return parseNumberValue(value)
1737 }
1738
1739 if (slot.startsWith('date')) {
1740 return parseDateValue(value)
1741 }
1742
1743 if (slot.startsWith('boolean')) {
1744 return parseBooleanValue(value) ?? false
1745 }
1746
1747 return value || null
1748 }
1749
1750 type UpdateDataWithTags = typeof updateData & Record<TagSlot, string | undefined>
1751 const typedUpdateData = updateData as UpdateDataWithTags

Callers 1

updateDocumentFunction · 0.85

Calls 3

parseNumberValueFunction · 0.90
parseDateValueFunction · 0.90
parseBooleanValueFunction · 0.90

Tested by

no test coverage detected