Skip to content

Replace includesOnly with hasOnly; add tests; bump to 2.3.0; update GH Actions to Node 26 - #23

Merged
rustpls merged 1 commit into
mainfrom
codex/remove-includesonly-and-add-hasonly-function
Jul 9, 2026
Merged

Replace includesOnly with hasOnly; add tests; bump to 2.3.0; update GH Actions to Node 26#23
rustpls merged 1 commit into
mainfrom
codex/remove-includesonly-and-add-hasonly-function

Conversation

@rustpls

@rustpls rustpls commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Clarify semantics by replacing the generic includesOnly (which accepted any Iterable) with a list-specific hasOnly(list, ...values) that explicitly checks a list contains exactly the provided values.
  • Provide JSDoc and unit tests to document and validate the new behavior, including duplicate and empty-list handling.
  • Bump the package version to 2.3.0 for the breaking/name change and test additions.
  • Upgrade the Node version used in CI publishing workflows to 26 to stay current for npm/JSR publishing.

Description

  • Removed the previous includesOnly API and added hasOnly<T>(list: T[], ...values: T[]): boolean in src/core.ts with JSDoc and examples demonstrating exact-value, order-insensitive checks and duplicate handling.
  • Added unit tests in src/core_test.ts covering matching, order-insensitivity, duplicates, empty-list, missing values, and additional-value cases using hasOnly.
  • Updated deno.json to bump the package version to 2.3.0.
  • Updated CI workflows: actions/setup-node bumped to @v4 and node-version set to 26 in .github/workflows/publish_npm.yml and added Node setup to .github/workflows/publish_jsr.yml.

Testing

  • Ran repository checks such as git diff --check and search validations (e.g. rg "includesOnly") which showed the expected replacements and no diff-check errors.
  • Attempted to run deno fmt and deno test via npx deno but these could not complete because Deno is not installed in the execution environment and network access to fetch tooling was blocked; therefore Deno formatting and test runs are pending in CI.
  • Local Node/npm tooling versions were inspected in the environment (node --version and npm --version) and are available, but full Deno-based verification must run in an environment with Deno or in CI where network access is permitted.

Codex Task

@rustpls
rustpls merged commit 36e0596 into main Jul 9, 2026
1 check passed
@rustpls
rustpls deleted the codex/remove-includesonly-and-add-hasonly-function branch July 9, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant