dyna-record
    Preparing search index...

    Function objectToTableItem

    • Recursively walks an ObjectSchema and converts the entity value to its DynamoDB representation.

      • "date" fields are converted from Date objects to ISO 8601 strings.
      • "object" fields recurse into their nested schema.
      • "array" fields map each item through the same conversion.
      • "discriminatedUnion" fields look up the variant schema by discriminator value and recurse into that variant's object schema, preserving the discriminator key.
      • null and undefined values are stripped from the result so that nullable fields set to null are removed from the stored object rather than persisted as null in DynamoDB.
      • All other field types pass through unchanged.

      Parameters

      • schema: ObjectSchema

        The ObjectSchema describing the object shape

      • value: Record<string, unknown>

        The entity-level object value to convert

      Returns Record<string, unknown>

      A new object suitable for DynamoDB storage