fix(parse): strict group sizes, and the symbol must match the currency
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Read docs/reference/limitations.md and trace the parse implementation, comparing its grouping behavior with parseMoney and issue #138. Decide whether to add a lenient option and document that choice; add battery style vectors to spec/ once #321 lands, and update the CHANGELOG. Done when invalid group sizes are rejected, mismatched unambiguous currency symbols or codes throw SyntaxError, and the documented leniency behavior is covered by tests.
Written by the indexing model from the issue text.
Description
From docs/reference/limitations.md (Alex, 2026-11-13: worth doing soon).
parse is lenient in two ways a strict money parser shouldn't be:
-
it accepts misplaced group separators, such as
1,23,4.00in en-US; -
it doesn't check the currency symbol in the text against the
currencyargument, soparse('£12.50', 'EUR', 'en-GB')reads 12.50 EUR. -
group sizes checked against the locale's (primary and secondary, as
parseMoneyand #138 already handle) -
a symbol or code in the text that means another currency throws
SyntaxError(unambiguous symbols only; a shared$is accepted where the locale allows it) -
a
lenientoption keeping today's behaviour, if that's needed for real inputs; decide and document -
Visible change in the CHANGELOG; tests from the battery-style vectors (and add them to
spec/once #321 lands)
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 35m
- Merged PRs (30d)
- 242
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from public/ducat
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
public/ducat#349 · 1 comment ·
Maintainers usually reply within 1 day
-
area: core
Difficulty 4/5 3-5 days Newbie friendliness 43/100
Maintainers usually reply within 1 day
-
area: tests
Difficulty 3/5 1-2 days Newbie friendliness 56/100
Maintainers usually reply within 1 day
-
area: core
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
software-mansion/argent#1946 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
podman-desktop/podman-desktop#20216 ·
Maintainers usually reply within 1 day
-
[Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
WordPress/ai#1386 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
omdsh-dev/DSH-better-sidebar#1205 ·
Maintainers usually reply within 3 days