Skip to content

docs: add missing JSDoc examples in utils/type-of - #16295

Merged
kgryte merged 2 commits into
developfrom
claude/cool-johnson-ekfwl6
Oct 23, 2026
Merged

kgryte merged 2 commits into
developfrom
claude/cool-johnson-ekfwl6

Conversation

@Planeshifter

@Planeshifter Planeshifter commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • adds missing @example blocks to the typeOf JSDoc in @stdlib/utils/type-of, bringing the package in line with the rest of the utils namespace.
  • replaces String.prototype.toLowerCase with @stdlib/string/base/lowercase in the same two files, as required by the no-restricted-syntax lint rule now that the files are touched. The two are behaviorally equivalent.

@stdlib/utils/type-of

lib/main.js and lib/polyfill.js document typeOf without an @example, whereas 97% of utils packages (192/198) include one in the main function JSDoc and 89% of sibling builtin/polyfill implementation files (16/18) do likewise. This PR adds the 'a' => 'string' and 5 => 'number' examples already present in lib/index.js and the README. No change in behavior.

Related Issues

Does this pull request have any related issues?

No.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Namespace summary. utils has 198 direct member packages (none autogenerated). Analyzed features: file tree, package.json key sets, README section sets and order, test/benchmark/example file naming, public signature, return kind, validation prologue, error construction, JSDoc shape, and require() dependencies. Features with a clear majority (≥75%): file tree, package.json keys, README sections and order, error construction (format for interpolated messages), JSDoc @example/@param/@returns/@throws shape. Features without a clear majority (excluded): public signature, validation prologue sequence, and dependency sets (@stdlib/string/format reaches 71%).

Validation. Structural features were extracted from the filesystem, semantic features were extracted by per-package agents, and each candidate went through three independent reviews (semantic intent, cross-referencing of tests and examples, and structural applicability). Deliberately excluded:

  • library-manifest concatenated error messages: the package avoids stdlib dependencies by design (documented in source NOTEs).
  • Missing benchmark/benchmark.js in eval, open-url, parallel, library-manifest, timeit, and the namespace packages: side-effecting or environment-bound code, or variant benchmark files. inherit is already covered by bench: add benchmark to utils/inherit #15245.
  • Missing README ## Notes sections, plus ## See Also, repl.txt and .d.ts files: these need authored content or are generator-owned.
  • Plain-string (non-format) error messages without interpolation: these are correct per stdlib/no-unnecessary-format.

The added example values were verified against both implementations (main.js and polyfill.js).

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written primarily by Claude Code as part of an automated cross-package API drift scan of the utils namespace.


🤖 Generated with Claude Code

https://claude.ai/code/session_01E6UUPEB3GQKNEpi1ddopv1

Added missing `@example` blocks to the `typeOf` JSDoc in `lib/main.js` and
`lib/polyfill.js` (main function JSDoc carries `@example` in 97% of
`utils` packages; 89% of sibling builtin/polyfill implementation files).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01E6UUPEB3GQKNEpi1ddopv1
@stdlib-bot

stdlib-bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
utils/type-of $\\color{green}326/326$
$\\color{green}+100.00\\%$
$\\color{red}20/21$
$\\color{green}+95.24\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}326/326$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

Replaces `String.prototype.toLowerCase` with `@stdlib/string/base/lowercase`
to satisfy the `no-restricted-syntax` lint rule, which is enforced on the
files modified in the preceding commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01E6UUPEB3GQKNEpi1ddopv1
@kgryte kgryte added the Documentation Improvements, additions, or changes to documentation. label Oct 23, 2026
@kgryte
kgryte marked this pull request as ready for review October 23, 2026 18:31
@kgryte
kgryte requested a review from a team October 23, 2026 18:31
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. labels Oct 23, 2026
@kgryte
kgryte merged commit a9c5844 into develop Oct 23, 2026
66 checks passed
@kgryte
kgryte deleted the claude/cool-johnson-ekfwl6 branch October 23, 2026 18:32
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements, additions, or changes to documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants