Skip to content

NaN refundAmount passes the typeof check and resolves with amount NaN #7

Description

@royalpinto007

Problem

NaN passes the typeof === "number" check, then NaN == null and NaN > limit are both false, so the refund resolves with amount: NaN. Distinct from #3 (zero/negative).

Where

lib/agent.ts (amount extraction) + lib/policy.ts (decision).

Acceptance

Add a failing test first asserting decide({...refund, refundAmount: NaN}, ...) escalates asking to confirm the amount. 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