TheVicky1 / TheVicky1/Pact_OS

[JSDoc] Add JSDoc Examples and Return Contracts in lib/money.ts

Open Beginner friendly
#67 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accessibility area:core beginner friendly bug community contributions-welcome difficulty:beginner difficulty:easy documentation enhancement good first issue hacktoberfest help wanted time:<15m up-for-grabs
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 --noEmit and npm run lint pass with 0 errors.
Verification
npm run lint
npx tsc --noEmit
Contributor Notes

Code clarity task. Do not alter any runtime function logic.


Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.