Skip to content

[BUG-25] Prop coercion mangles string data (007 → 7, 1e3 → 1000, 0x10 → 16) #36

Description

@shroy

Severity: P2 · Batch: B11 (input validation)

Location

src/utils/props.js:11-17 + src/utils/type-guards.js:33

Failure scenario

card-id="007"7, "1e3"1000, "0x10"16, " 42 "42 — zip codes, IDs, versions silently corrupted with no opt-out.

Proposed fix

Restrict numeric coercion to /^-?\d+(\.\d+)?$/; document; optionally support a :string escape hatch.

Verification recipe

Spec: element with card-id="007", card-ver="1e3", card-hex="0x10"; extract props; assert values are the original strings. Expected on unmodified code: numbers 7 / 1000 / 16 → confirmed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions