Conversation
There was a problem hiding this comment.
Pull request overview
This PR systematically improves documentation across the entire @nick/math library by adding module-level doc comments with practical code examples. The changes add @example blocks demonstrating typical usage patterns for constants, mathematical functions, type guards, and floating-point utilities.
Changes:
- Added comprehensive module-level documentation examples to ~85 files across the library
- Introduced
jsr:@nick/is@0.2.0-rc.6dependency for type assertion examples in documentation - Removed
FloatFormattype constraint from float16 and float32 constants (intentional simplification) - Enhanced random.ts with namespace declarations for better TypeScript documentation
Reviewed changes
Copilot reviewed 85 out of 86 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| deno.lock | Added dependency for @nick/is package used in doc examples |
| src/types/*.ts | Added module doc comments with type-level examples using expectType |
| src/constants/*.ts | Added module doc comments with runtime examples comparing to Math/Number constants |
| src/guards/*.ts | Added module doc comments with type guard examples |
| src/float16/*.ts | Added module doc comments for IEEE-754 half-precision utilities |
| src/float32/*.ts | Added module doc comments for IEEE-754 single-precision utilities, removed FloatFormat constraint |
| src/*.ts (math functions) | Added module doc comments with practical usage examples |
| src/random.ts | Added namespace declarations for init() and integer() methods |
| src/index.ts | Added @category tag for the main module |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * @example | ||
| * ```ts | ||
| * import type { P32, Precision } from "@nick/math/types/precision"; | ||
| * import { expectType } from "jsr:@nick/is@0.2.0-rc.6/type/expect";; |
There was a problem hiding this comment.
Double semicolon at the end of the import statement in the code example. Remove one semicolon.
| * @example | ||
| * ```ts | ||
| * import type { Int32 } from "@nick/math/types/integer"; | ||
| * import { expectType } from "jsr:@nick/is@0.2.0-rc.6/type/expect";; |
There was a problem hiding this comment.
Double semicolon at the end of the import statement in the code example. Remove one semicolon.
| * @example | ||
| * ```ts | ||
| * import type { Float32 } from "@nick/math/types/float"; | ||
| * import { expectType } from "jsr:@nick/is@0.2.0-rc.6/type/expect";; |
There was a problem hiding this comment.
Double semicolon at the end of the import statement in the code example. Remove one semicolon.
| * @example | ||
| * ```ts | ||
| * import type { Finite } from "@nick/math/types/finite"; | ||
| * import { expectType } from "jsr:@nick/is@0.2.0-rc.6/type/expect";; |
There was a problem hiding this comment.
Double semicolon at the end of the import statement in the code example. Remove one semicolon.
| * | ||
| * @example | ||
| * ```ts | ||
| * import { isSafeInteger } from "@nick/math/is/safe-integer"; |
There was a problem hiding this comment.
Incorrect import path in the example. The isSafeInteger function is exported from @nick/math/guards/safe-integer, not @nick/math/is/safe-integer. There is no is directory in the project structure.
| * ```ts | ||
| * import { isSafeInteger } from "@nick/math/is/safe-integer"; | ||
| * import type { SafeInteger } from "@nick/math/types/safe-integer"; | ||
| * import { expectType } from "jsr:@nick/is@0.2.0-rc.6/type/expect";; |
There was a problem hiding this comment.
Double semicolon at the end of the import statement in the code example. Remove one semicolon.
Uh oh!
There was an error while loading. Please reload this page.