{"name":"chai-bites","version":"0.3.1","description":"Chai assertions for byte arrays equality","repository":{"type":"git","url":"git+https://github.com/achingbrain/chai-bites.git"},"bugs":{"url":"https://github.com/achingbrain/chai-bites/issues"},"engines":{"node":">=10"},"main":"index.js","type":"module","types":"index.d.ts","scripts":{"lint":"semistandard","test":"mocha test --exclude test/types.js","test-browser":"karma start","test-ts":"tsc -p test && node test/types.js"},"keywords":["chai","chai-plugin","assertions","testing","buffers","uint8array"],"author":{"name":"Alex Ostrovski","email":"ostrovski.alex@gmail.com"},"license":"Apache-2.0","devDependencies":{"@babel/core":"^7.15.0","@types/chai":"^4.2.21","babel-plugin-istanbul":"^6.0.0","babelify":"^10.0.0","browserify":"^17.0.0","chai":"^5.1.0","coveralls":"^3.1.1","karma":"^6.3.4","karma-browserify":"^8.1.0","karma-coverage":"^2.0.3","karma-firefox-launcher":"^2.1.1","karma-mocha":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha":"^10.4.0","semistandard":"^17.0.0","typescript":"^5.4.5"},"gitHead":"1eb99f27c34c9ae61da97bf133f1a0b14eb4c9a7","_id":"chai-bites@0.3.1","homepage":"https://github.com/achingbrain/chai-bites#readme","_nodeVersion":"24.13.1","_npmVersion":"11.8.0","dist":{"integrity":"sha512-t+8yIdncUkEox8u9gM1uu0fpPIn5lMZ71ljBKch8k3/0wBAc8765JL8wm0eez9OmwmaV+sAu1t2B41AqtydPgg==","shasum":"748cfc7d78910244c094e7246f713c2fed3286c7","tarball":"http://registry-npm.ywwl.com/chai-bites/download/chai-bites-0.3.1.tgz","fileCount":5,"unpackedSize":17917,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDhXUR48AfdZ7P1tbhvmIUoiVQRvyTWCy/pKGqmDydxzQIgSJDmyLgluWf1NLp5loiyCX8T3bDNRSQnpoXUS75Loa4="}],"size":6534,"noattachment":false,"key":"/chai-bites/-/chai-bites-0.3.1.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chai-bites_0.3.1_1779528289119_0.04687919986429012"},"_hasShrinkwrap":false,"readme":"Fork of [chai-bytes](https://www.npmjs.com/package/chai-bytes) published as ESM with relaxed input types.\n\n# Chai Assertions for Byte Arrays Equality\n\n[![Build status][workflow-image]][workflow-url]\n[![Code coverage][coveralls-image]][coveralls-url]\n[![Code style][code-style-image]][code-style-url]\n[![License][license-image]][license-url]\n\n[workflow-image]: https://github.com/slowli/chai-bytes/workflows/Node.js%20CI/badge.svg?branch=master\n[workflow-url]: https://github.com/slowli/chai-bytes/actions\n[coveralls-image]: https://img.shields.io/coveralls/slowli/chai-bytes.svg\n[coveralls-url]: https://coveralls.io/github/slowli/chai-bytes\n[code-style-image]: https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg\n[code-style-url]: https://github.com/Flet/semistandard\n[license-image]: https://img.shields.io/github/license/slowli/chai-bytes.svg\n[license-url]: https://opensource.org/licenses/Apache-2.0\n\n**chai-bytes** extends [Chai][chai] with a `equalBytes` function,\nwhich can be used to test equality of byte arrays (i.e., `Uint8Array` instances).\n\n## Basic Usage\n\n```javascript\nconst { expect, assert } = require('chai')\n  .use(require('chai-bytes'));\n\nconst buffer = new Uint8Array([ 1, 2, 3, 4, 5 ]);\nexpect(buffer).to.equalBytes('0102030405');\n// `assert` style works, too\nassert.equalBytes(buffer, [1, 2, 3, 4, 5], 'error message');\n```\n\nAn expected value passed to `equalBytes` can be:\n\n- Hexadecimal string, e.g., `'c0ffee'`\n- Array, e.g., `[1, 2, 3]`\n- Array-like object (i.e., an object having the `length` property\n  and items accessible by integer properties).\n  This includes `Uint8Array` instances, among other things\n\nIf the passed value does not fall into any of these categories,\na `TypeError` is thrown.\n\n## Developer Notes\n\n**chai-bytes** uses combined code coverage from the tested browser environments\n(Firefox and PhantomJS). This is because PhantomJS is a typical old environment\nthat may have problems with `Uint8Array`s (e.g., it misses a substantial parts\nof their methods).\n\n## License\n\n**chai-bytes** is available under [Apache-2.0 license](LICENSE).\n\n[chai]: https://chaijs.com/\n","publish_time":1779528289277,"_cnpm_publish_time":1779528289277,"dist-tags":{"latest":"0.3.1"}}