chai-bites 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +6 -6
  2. package/index.js +1 -3
  3. package/package.json +6 -8
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Chai Assertions for Byte Arrays Equality
1
+ Fork of [chai-bytes](https://www.npmjs.com/package/chai-bytes) published as ESM with relaxed input types.
2
2
 
3
- Fork of [chai-bytes](https://www.npmjs.com/package/chai-bytes) with relaxed input types.
3
+ # Chai Assertions for Byte Arrays Equality
4
4
 
5
5
  [![Build status][workflow-image]][workflow-url]
6
6
  [![Code coverage][coveralls-image]][coveralls-url]
@@ -16,14 +16,14 @@ Fork of [chai-bytes](https://www.npmjs.com/package/chai-bytes) with relaxed inpu
16
16
  [license-image]: https://img.shields.io/github/license/slowli/chai-bytes.svg
17
17
  [license-url]: https://opensource.org/licenses/Apache-2.0
18
18
 
19
- **chai-bites** extends [Chai][chai] with a `equalBytes` function,
19
+ **chai-bytes** extends [Chai][chai] with a `equalBytes` function,
20
20
  which can be used to test equality of byte arrays (i.e., `Uint8Array` instances).
21
21
 
22
22
  ## Basic Usage
23
23
 
24
24
  ```javascript
25
25
  const { expect, assert } = require('chai')
26
- .use(require('chai-bites'));
26
+ .use(require('chai-bytes'));
27
27
 
28
28
  const buffer = new Uint8Array([ 1, 2, 3, 4, 5 ]);
29
29
  expect(buffer).to.equalBytes('0102030405');
@@ -44,13 +44,13 @@ a `TypeError` is thrown.
44
44
 
45
45
  ## Developer Notes
46
46
 
47
- **chai-bites** uses combined code coverage from the tested browser environments
47
+ **chai-bytes** uses combined code coverage from the tested browser environments
48
48
  (Firefox and PhantomJS). This is because PhantomJS is a typical old environment
49
49
  that may have problems with `Uint8Array`s (e.g., it misses a substantial parts
50
50
  of their methods).
51
51
 
52
52
  ## License
53
53
 
54
- **chai-bites** is available under [Apache-2.0 license](LICENSE).
54
+ **chai-bytes** is available under [Apache-2.0 license](LICENSE).
55
55
 
56
56
  [chai]: https://chaijs.com/
package/index.js CHANGED
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  function every (buffer, predicate) {
4
2
  if (Uint8Array && Uint8Array.prototype.every) {
5
3
  return buffer.every(predicate);
@@ -20,7 +18,7 @@ function every (buffer, predicate) {
20
18
  * expect(new Uint8Array([1, 2])).to.equalBytes([1, 2]);
21
19
  * expect(new Uint8Array[65, 66, 67])).to.equalBytes('414243');
22
20
  */
23
- module.exports = function (chai) {
21
+ export default function (chai) {
24
22
  const Assertion = chai.Assertion;
25
23
 
26
24
  Assertion.addMethod('equalBytes', function (expected) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chai-bites",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Chai assertions for byte arrays equality",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,6 +13,7 @@
13
13
  "node": ">=10"
14
14
  },
15
15
  "main": "index.js",
16
+ "type": "module",
16
17
  "types": "index.d.ts",
17
18
  "files": [
18
19
  "index.js",
@@ -40,7 +41,7 @@
40
41
  "babel-plugin-istanbul": "^6.0.0",
41
42
  "babelify": "^10.0.0",
42
43
  "browserify": "^17.0.0",
43
- "chai": "^4.3.4",
44
+ "chai": "^5.1.0",
44
45
  "coveralls": "^3.1.1",
45
46
  "karma": "^6.3.4",
46
47
  "karma-browserify": "^8.1.0",
@@ -48,11 +49,8 @@
48
49
  "karma-firefox-launcher": "^2.1.1",
49
50
  "karma-mocha": "^2.0.1",
50
51
  "karma-mocha-reporter": "^2.2.5",
51
- "mocha": "^9.0.3",
52
- "semistandard": "^16.0.1",
53
- "typescript": "^4.3.5"
54
- },
55
- "peerDependencies": {
56
- "chai": ">=2 <5"
52
+ "mocha": "^10.4.0",
53
+ "semistandard": "^17.0.0",
54
+ "typescript": "^5.4.5"
57
55
  }
58
56
  }