{"name":"chai-bites","version":"0.2.0","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"},"_id":"chai-bites@0.2.0","gitHead":"38aafe8107b211f5958a4534e90679169a2e551a","homepage":"https://github.com/achingbrain/chai-bites#readme","_nodeVersion":"20.11.0","_npmVersion":"10.2.4","dist":{"integrity":"sha512-cX+z+/u+MporetHrWHuEwhmKuDqhZ0KXQJbN4uYWVLa1xzjfyfvpQcCxSUdHA7xv6B0VU30dR/+7aVfZr2outw==","shasum":"7aaace465c0db16b981de7e6a6de3d0213ef45cd","tarball":"http://registry-npm.ywwl.com/chai-bites/download/chai-bites-0.2.0.tgz","fileCount":5,"unpackedSize":17846,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEYWeRsr8NxS6c3qaQsKviaPOx3zdYL7amCkM3VEe5UYAiEAsQ2MvGpBtUe7E4txQVnf1VptFbVi1MUWYXW2qENwEN8="}],"size":6529,"noattachment":false,"key":"/chai-bites/-/chai-bites-0.2.0.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chai-bites_0.2.0_1714563553591_0.6293057165270362"},"_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":1714563553751,"_cnpm_publish_time":1714563553751,"dist-tags":{"latest":"0.3.1"}}