[JSDoc] Add JSDoc Examples and Return Contracts in lib/money.ts
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 7
- Avg merge
- 39m
- Merged PRs (30d)
- 39
Description
- Labels:
good first issue,documentation,difficulty:beginner,area:core - Target File:
src/lib/money.ts - Estimated Time: 10–15 minutes
- Difficulty: Level 2 (Beginner)
Why This Matters
src/lib/money.ts contains PACT's core currency math utilities. Comprehensive JSDoc comments with @example, @param, and @returns tags provide instant in-editor documentation for other developers.
Current Behavior
Several utility functions in src/lib/money.ts (such as formatCentsToCurrency and dollarsToCents) have brief comments but lack structured JSDoc @example blocks.
Requested Change
Add formatted JSDoc docstrings with @param, @returns, and @example blocks above dollarsToCents and formatCentsToCurrency in src/lib/money.ts.
Acceptance Criteria
- Structured JSDoc docstrings added above the specified functions in
src/lib/money.ts. - Examples accurately demonstrate integer cents inputs and outputs.
-
npx tsc --noEmitandnpm run lintpass with 0 errors.
Verification
npm run lint
npx tsc --noEmit
Contributor Notes
Code clarity task. Do not alter any runtime function logic.
Contributor 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.
Research direction
Start in src/lib/money.ts by reading dollarsToCents and formatCentsToCurrency and their existing comments. Add @param, @returns, and @example JSDoc blocks without changing runtime logic; examples should show integer-cent inputs and outputs. Run npm run lint and npx tsc --noEmit to verify the documentation changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100