Skip to content

fix: refines number type check#2928

Merged
li-jia-nan merged 4 commits intomasterfrom
isNumber-update
Apr 16, 2026
Merged

fix: refines number type check#2928
li-jia-nan merged 4 commits intomasterfrom
isNumber-update

Conversation

@li-jia-nan
Copy link
Copy Markdown
Collaborator

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English fix: refines number type check
🇨🇳 Chinese fix: refines number type check

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copilot AI review requested due to automatic review settings April 13, 2026 23:15
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 13, 2026

npm i https://pkg.pr.new/ahooks@2928
npm i https://pkg.pr.new/@ahooks.js/use-url-state@2928

commit: 597c0de

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refines the shared isNumber utility to treat NaN as non-number (for validation use cases across hooks) and aligns a couple of imports to use the utils barrel export.

Changes:

  • Update isNumber to return false for NaN.
  • Switch imports to ../utils / ../ barrel paths in a test and a hook.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/hooks/src/utils/index.ts Refines isNumber to exclude NaN.
packages/hooks/src/utils/tests/index.spec.ts Adjusts utils test import path (but still asserts NaN is a number).
packages/hooks/src/useCountDown/index.ts Updates isNumber import to use the utils barrel.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/hooks/src/utils/__tests__/index.spec.ts
Copy link
Copy Markdown
Collaborator

@liuyib liuyib left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@li-jia-nan li-jia-nan merged commit f935868 into master Apr 16, 2026
18 checks passed
@li-jia-nan li-jia-nan deleted the isNumber-update branch April 16, 2026 06:07
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.

3 participants