Skip to content

units throws on non-array messages object instead of a structured failure #10

Description

@royalpinto007

Problem

A payload with a non-array messages object ({messages: {role: "user"}}) throws msgs is not iterable instead of a structured failure.

Where

src/index.mjs (units: payload.messages || [] then for...of).

Acceptance

Add a failing test first passing a non-array messages object, expecting a validation error or coercion instead of TypeError. Then fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions