dyna-record
    Preparing search index...

    Function convertFieldToTableItem

    • Converts a single field value to its DynamoDB table representation based on the field definition.

      • "date" → ISO 8601 string
      • "object" → recursively converts via objectToTableItem
      • "array" → maps each item through the same conversion
      • "discriminatedUnion" → looks up the variant schema by discriminator value, converts via objectToTableItem, and preserves the discriminator key
      • All other types pass through unchanged

      Parameters

      • fieldDef: FieldDef

        The FieldDef describing the field's type

      • val: unknown

        The entity-level value to convert

      Returns unknown

      The DynamoDB-compatible value