Replace includesOnly with hasOnly; add tests; bump to 2.3.0; update GH Actions to Node 26 - #23
Merged
Conversation
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.
Motivation
includesOnly(which accepted anyIterable) with a list-specifichasOnly(list, ...values)that explicitly checks a list contains exactly the provided values.2.3.0for the breaking/name change and test additions.26to stay current for npm/JSR publishing.Description
includesOnlyAPI and addedhasOnly<T>(list: T[], ...values: T[]): booleaninsrc/core.tswith JSDoc and examples demonstrating exact-value, order-insensitive checks and duplicate handling.src/core_test.tscovering matching, order-insensitivity, duplicates, empty-list, missing values, and additional-value cases usinghasOnly.deno.jsonto bump the packageversionto2.3.0.actions/setup-nodebumped to@v4andnode-versionset to26in.github/workflows/publish_npm.ymland added Node setup to.github/workflows/publish_jsr.yml.Testing
git diff --checkand search validations (e.g.rg "includesOnly") which showed the expected replacements and no diff-check errors.deno fmtanddeno testvianpx denobut 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.node --versionandnpm --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