Function tableItemToObject

  • Recursively walks an ObjectSchema and converts a DynamoDB table item back to its entity representation.

    • "date" fields are converted from ISO 8601 strings to Date objects.
    • "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 absent fields are represented as undefined (omitted) on the entity, consistent with root-level nullable attribute behaviour.
    • All other field types pass through unchanged.

    Parameters

    • schema: ObjectSchema

      The ObjectSchema describing the object shape

    • value: Record<string, unknown>

      The DynamoDB table item to convert

    Returns Record<string, unknown>

    A new object with entity-level types (e.g. Date instead of string)