cspell-io 7.0.0-alpha.2 → 7.0.1-alpha.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.
@@ -31,12 +31,7 @@ function decode(buf, encoding) {
31
31
  }
32
32
  exports.decode = decode;
33
33
  function swapBytesInPlace(buf) {
34
- for (let i = 0; i < buf.length - 1; i += 2) {
35
- const v = buf[i];
36
- buf[i] = buf[i + 1];
37
- buf[i + 1] = v;
38
- }
39
- return buf;
34
+ return buf.swap16();
40
35
  }
41
36
  exports.swapBytesInPlace = swapBytesInPlace;
42
37
  function swapBytes(buf) {
@@ -25,12 +25,7 @@ export function decode(buf, encoding) {
25
25
  return buf.toString(encoding);
26
26
  }
27
27
  export function swapBytesInPlace(buf) {
28
- for (let i = 0; i < buf.length - 1; i += 2) {
29
- const v = buf[i];
30
- buf[i] = buf[i + 1];
31
- buf[i + 1] = v;
32
- }
33
- return buf;
28
+ return buf.swap16();
34
29
  }
35
30
  export function swapBytes(buf) {
36
31
  const tBuf = Buffer.from(buf);
@@ -25,12 +25,7 @@ export function decode(buf, encoding) {
25
25
  return buf.toString(encoding);
26
26
  }
27
27
  export function swapBytesInPlace(buf) {
28
- for (let i = 0; i < buf.length - 1; i += 2) {
29
- const v = buf[i];
30
- buf[i] = buf[i + 1];
31
- buf[i + 1] = v;
32
- }
33
- return buf;
28
+ return buf.swap16();
34
29
  }
35
30
  export function swapBytes(buf) {
36
31
  const tBuf = Buffer.from(buf);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cspell-io",
3
- "version": "7.0.0-alpha.2",
3
+ "version": "7.0.1-alpha.0",
4
4
  "description": "A library of useful I/O functions used across various cspell tools.",
5
5
  "type": "commonjs",
6
6
  "module": "dist/esm/index.mjs",
@@ -50,12 +50,12 @@
50
50
  "node": ">=16"
51
51
  },
52
52
  "devDependencies": {
53
- "@types/node-fetch": "^2.6.3",
53
+ "@types/node-fetch": "^2.6.4",
54
54
  "lorem-ipsum": "^2.0.8"
55
55
  },
56
56
  "dependencies": {
57
- "@cspell/cspell-service-bus": "7.0.0-alpha.2",
58
- "node-fetch": "^2.6.9"
57
+ "@cspell/cspell-service-bus": "7.0.1-alpha.0",
58
+ "node-fetch": "^2.6.11"
59
59
  },
60
- "gitHead": "a1b7c5daeef5afdb14d6444318f450b9fd9c035a"
60
+ "gitHead": "9ac874fd367a2858df9aab07fafad183347f2033"
61
61
  }