refactor: align and simplify array TypeScript declarations#12366
Draft
Planeshifter wants to merge 1 commit into
Draft
refactor: align and simplify array TypeScript declarations#12366Planeshifter wants to merge 1 commit into
array TypeScript declarations#12366Planeshifter wants to merge 1 commit into
Conversation
Apply behavior-neutral cleanups to several `array` declarations
surfaced by an audit of the namespace's declaration files:
- `base/to-deduped`: the declared function and its examples used the
internal name `dedupe`; rename to the public `toDeduped`.
- `base/without`: the interface was named `ArrayWith` (copied from
`with`); rename it to `Without`.
- `base/cunone`: the interface used a lowercase `cunone` name;
rename to `CuNone` to match the `CuAny`/`CuEvery` siblings.
- `base/bifurcate-indices-by`: drop the dead `IndicesResults` type
parameter, which was always instantiated as `number`.
- `base/assert/contains`: rename the `Unary` type's parameter from
`x` to `value` to match its documented `@param`.
- `filled`: the first overload used `DataTypeMap<any>[U]`, leaving
the type parameter `T` unused; use `DataTypeMap<T>[U]`.
- `typed-complex`: the object overload used `Iterable<any>`; use
`Iterable<unknown>` to match the `typed` sibling, and correct a
`@returns` description.
None of these changes affect runtime behavior.
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
---
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
---
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request applies behavior-neutral cleanups to several
@stdlib/arrayTypeScript declarations, surfaced by an audit of the namespace's declaration files:base/to-deduped: the declared function and its@exampleblocks used the internal namededupe; renamed to the publictoDeduped(andexport = toDeduped).base/without: the interface was namedArrayWith(copy-pasted fromwith); renamed toWithout.base/cunone: the interface used a lowercasecunoneidentifier; renamed toCuNoneto match theCuAny/CuEverysiblings.base/bifurcate-indices-by: dropped the deadIndicesResults<T>type parameter (always instantiated asnumber); updated the type test accordingly.base/assert/contains: renamed theUnaryfunction type's parameter fromxtovalueto match its documented@param value.filled: the first overload usedDataTypeMap<any>[U], leaving the type parameterTunused; switched toDataTypeMap<T>[U](behaviorally identical).typed-complex: the object overload usedIterable<any>; switched toIterable<unknown>to match thetypedsibling, and corrected a@returnsdescription.None of these changes affect runtime behavior or downstream-observable types.
Related Issues
None.
Questions
No.
Other
This is one of a series of PRs addressing findings from a TypeScript-declaration audit of the
@stdlib/arraynamespace.Two audit findings in this category were intentionally deferred from this PR:
base/take-map(itsassignoverloads appear disconnected from the exported function and its declaration examples fail the doctest linter) andbase/where(itsassignexamples reference an undefinedassignand fail the doctest linter). Both require deeper, documentation-focused fixes and are better handled separately.Checklist
AI Assistance
Yes
No
Code generation (e.g., when writing an implementation or fixing a bug)
Test/benchmark generation
Documentation (including examples)
Research and understanding
Disclosure
The issues addressed here were identified by a multi-agent audit run with Claude Code, and the changes were drafted by Claude Code under my direction and review. Each change was verified locally against the repository's TypeScript declaration doctest and
$ExpectTypelinters.@stdlib-js/reviewers