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.
    • 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