Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add includes method and some missing benchmarks #13

Merged
merged 4 commits into from
Jul 5, 2024

Conversation

bjornstar
Copy link
Contributor

As suggested here:

From this usage, it looks like it would be useful to have a includes method in uint8array-extras too.

Also added getUintBE, indexOf, and includes to benchmark.mjs

test.js Outdated

test('includes', t => {
const fixture = [0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef]; // eslint-disable-line unicorn/number-literal-case
t.is(includes(new Uint8Array(fixture), new Uint8Array([0x78, 0x90])), true);
Copy link
Owner

Choose a reason for hiding this comment

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

t.true

@sindresorhus
Copy link
Owner

Needs to be added to index.d.ts too.

@bjornstar
Copy link
Contributor Author

Needs to be added to index.d.ts too.

Done!

@sindresorhus sindresorhus merged commit 13ff2f7 into sindresorhus:main Jul 5, 2024
2 checks passed
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.

2 participants