Skip to content

fix: narrow fresnel return type to a two-element tuple#12466

Merged
kgryte merged 1 commit into
developfrom
philipp/fix-base-special-fresnel-return-type
Jun 3, 2026
Merged

fix: narrow fresnel return type to a two-element tuple#12466
kgryte merged 1 commit into
developfrom
philipp/fix-base-special-fresnel-return-type

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

@stdlib/math/base/special/fresnel always returns a fixed two-element array [ S(x), C(x) ], but the declaration typed the return as the over-broad Array<number>. This pull request narrows it to [ number, number ], matching the sibling frexp (which returns [ number, number ]), and updates the declaration test's $ExpectType accordingly.

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?

Found via a TypeScript-declaration audit of the @stdlib/math namespace.

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.

This issue was identified by an automated TypeScript-declaration audit run with Claude Code, and the fix was prepared by Claude Code under my review.


@stdlib-js/reviewers

`fresnel` always returns a fixed two-element array `[ S(x), C(x) ]`, but
the declaration typed the return as the over-broad `Array<number>`.
Narrow it to `[ number, number ]`, matching the sibling `frexp` (which
returns `[ number, number ]`), and update the declaration test's
`$ExpectType` accordingly.

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown_pkg_readmes
    status: na
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: passed
  - task: lint_license_headers
    status: passed
---
@stdlib-bot stdlib-bot added the Math Issue or pull request specific to math functionality. label Jun 2, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/fresnel $\color{red}595/607$
$\color{green}+98.02\%$
$\color{red}28/36$
$\color{green}+77.78\%$
$\color{green}7/7$
$\color{green}+100.00\%$
$\color{red}595/607$
$\color{green}+98.02\%$

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

@Planeshifter Planeshifter marked this pull request as ready for review June 3, 2026 00:18
@Planeshifter Planeshifter requested review from a team and kgryte June 3, 2026 00:19
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jun 3, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Jun 3, 2026
@kgryte kgryte merged commit c3d9ed0 into develop Jun 3, 2026
54 checks passed
@kgryte kgryte deleted the philipp/fix-base-special-fresnel-return-type branch June 3, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Math Issue or pull request specific to math functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants