Skip to content

📖🔧:make the API reference match the behavior - #93

Merged
openinf-commit-queue[bot] merged 1 commit into
mainfrom
claude/project-thread-2s9ymn-docs
Oct 1, 2026
Merged

openinf-commit-queue[bot] merged 1 commit into
mainfrom
claude/project-thread-2s9ymn-docs

Conversation

@DerekNonGeneric

@DerekNonGeneric DerekNonGeneric commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Requested by DerekNonGeneric

Before: the docs for several functions disagreed with what the code does.

  • getAllKeys was documented as returning own keys, but it walks the whole prototype chain.
  • The has example used an undefined variable and called create with one argument, although two were required. It also claimed an inherited key was missing, but has uses in.
  • isNamed described itself as an Array check.
  • isNumber and has linked to functions that don't exist.
  • getFunctionName rejected any function that takes parameters, and could not read the name of an async or generator function from its source.

After: each description says what the function does. create(proto) type-checks, and getFunctionName accepts any function. isTypedArray lists Float16Array, and four util-types descriptions use the right article or type name.

How: most of this is doc-comment edits. The two code changes are signature fixes, each with a test that failed to compile on main:

  • create's properties parameter is now optional.
  • getFunctionName takes AnyFunction, and its regex now also matches async function and function*. The regex is anchored and avoids nested quantifiers.

Summary by CodeRabbit

  • New Features
    • create now allows the properties argument to be omitted.
    • Function-name detection now supports named async and generator functions, including names containing $, and accepts functions with parameters.
  • Documentation
    • Clarified property lookup and prototype-chain behavior, including inherited properties and Object.prototype keys.
    • Updated type guard references and descriptions, including Float16Array support in the documented typed-array types. Also corrected return descriptions and examples.

getAllKeys was documented as returning own keys while it walks the
whole prototype chain. The has example used an undefined variable,
called create with one argument where two were required, and said an
inherited key was missing. isNamed described itself as an Array check.
isNumber and has pointed at functions that do not exist.

create now takes its properties as optional, as documented, and
getFunctionName accepts any function rather than only one without
parameters, and reads the name of an async or generator function from
its source. isTypedArray lists Float16Array, and four util-types
descriptions get their articles and type names right.

Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is>
Assisted-by: Claude-Code:claude-opus-5
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 032dd94d-fdc6-43d6-8025-c9084a5dd546

📥 Commits

Reviewing files that changed from the base of the PR and between 45679ff and e059a4a.

📒 Files selected for processing (14)
  • .changeset/docs-match-behavior.md
  • packages/util-array/src/guards/is-typed-array.ts
  • packages/util-core/src/guards/is-number.ts
  • packages/util-object/src/guards/has.ts
  • packages/util-object/src/guards/is-named.ts
  • packages/util-object/src/helpers/create.ts
  • packages/util-object/src/helpers/get-all-keys.ts
  • packages/util-object/src/helpers/get-function-name.ts
  • packages/util-object/test/helpers/create.ts
  • packages/util-object/test/helpers/get-function-name.ts
  • packages/util-types/src/guards/is-async-disposable-stack.ts
  • packages/util-types/src/guards/is-async-generator-function.ts
  • packages/util-types/src/guards/is-reg-exp-string-iterator.ts
  • packages/util-types/src/guards/is-string-iterator.ts

Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour.


📝 Walkthrough

Walkthrough

The pull request updates API documentation across four packages. It also makes the create properties argument optional and expands getFunctionName’s accepted type and source-text matching. Tests cover the updated helper behavior.

Changes

API and object helper updates

Layer / File(s) Summary
Object helper contract and documentation
packages/util-object/src/helpers/create.ts, packages/util-object/test/helpers/create.ts, packages/util-object/src/guards/has.ts, packages/util-object/src/guards/is-named.ts, packages/util-object/src/helpers/get-all-keys.ts
create makes its properties argument optional, with a test for calling it without that argument. Documentation describes has, isNamed, and getAllKeys behavior.
Function name detection
packages/util-object/src/helpers/get-function-name.ts, packages/util-object/test/helpers/get-function-name.ts
getFunctionName accepts AnyFunction. Its source-text fallback recognizes named regular, async, and generator functions, including names containing $. Tests cover parameterized functions and async and generator functions whose name property is empty.
Cross-package API reference updates
packages/util-array/src/guards/is-typed-array.ts, packages/util-core/src/guards/is-number.ts, packages/util-types/src/guards/*, .changeset/docs-match-behavior.md
Documentation adds Float16Array, refers to isFiniteNumber for non-finite values, and corrects return descriptions. The changeset marks four packages for patch releases.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to e059a

The documentation and helper API updates present no identified merge-blocking risk. Merge after normal checks pass.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 13 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main documentation changes and their alignment with existing behavior.
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 13 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@DerekNonGeneric DerekNonGeneric self-assigned this Oct 1, 2026
@DerekNonGeneric DerekNonGeneric added the 🚀 Status: Commit Queue Land this pull request when its checks pass label Oct 1, 2026 — with Claude
@openinf-commit-queue
openinf-commit-queue Bot merged commit f7dbfd4 into main Oct 1, 2026
10 checks passed
@openinf-commit-queue openinf-commit-queue Bot removed the 🚀 Status: Commit Queue Land this pull request when its checks pass label Oct 1, 2026
@openinf-commit-queue
openinf-commit-queue Bot deleted the claude/project-thread-2s9ymn-docs branch October 1, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant