cspell-io 9.3.0 → 9.3.2

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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { isFileURL, isUrlLike, toFileURL, toURL, urlBasename, urlParent as urlDirname } from "@cspell/url";
2
+ import { Buffer } from "node:buffer";
2
3
  import { ServiceBus } from "@cspell/cspell-service-bus";
3
4
 
4
5
  //#region src/async/asyncIterable.d.ts
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { isFileURL, isUrlLike, toFileURL, toURL, urlBasename, urlParent as urlDirname } from "@cspell/url";
2
+ import { Buffer } from "node:buffer";
2
3
  import * as zlib from "node:zlib";
3
4
  import { gunzipSync, gzip } from "node:zlib";
4
5
  import { ServiceBus, createResponse, createResponseFail, isServiceResponseSuccess, requestFactory } from "@cspell/cspell-service-bus";
@@ -136,19 +137,8 @@ function copyArrayBufferView(data) {
136
137
  * @param data - data to swap
137
138
  * @returns data
138
139
  */
139
- function swap16Poly(data) {
140
- const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
141
- for (let i = 0; i < view.byteLength; i += 2) view.setUint16(i, view.getUint16(i, false), true);
142
- return data;
143
- }
144
- /**
145
- * Swap the bytes in a buffer.
146
- * @param data - data to swap
147
- * @returns data
148
- */
149
140
  function swap16(data) {
150
- if (typeof Buffer !== "undefined") return arrayBufferViewToBuffer(data).swap16();
151
- return swap16Poly(data);
141
+ return arrayBufferViewToBuffer(data).swap16();
152
142
  }
153
143
  function swapBytes(data) {
154
144
  return swap16(copyArrayBufferView(data));
@@ -460,7 +450,7 @@ function guessMimeType(filename) {
460
450
  //#endregion
461
451
  //#region src/node/file/_fetch.ts
462
452
  /** alias of global.fetch, useful for mocking */
463
- const _fetch = global.fetch;
453
+ const _fetch = globalThis.fetch;
464
454
 
465
455
  //#endregion
466
456
  //#region src/node/file/FetchError.ts
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public",
5
5
  "provenance": true
6
6
  },
7
- "version": "9.3.0",
7
+ "version": "9.3.2",
8
8
  "description": "A library of useful I/O functions used across various cspell tools.",
9
9
  "type": "module",
10
10
  "sideEffects": false,
@@ -56,8 +56,8 @@
56
56
  "vitest-fetch-mock": "^0.4.5"
57
57
  },
58
58
  "dependencies": {
59
- "@cspell/cspell-service-bus": "9.3.0",
60
- "@cspell/url": "9.3.0"
59
+ "@cspell/cspell-service-bus": "9.3.2",
60
+ "@cspell/url": "9.3.2"
61
61
  },
62
- "gitHead": "7fb984ea1809038769617b4105b55bd53f0a7f30"
62
+ "gitHead": "595bde79b4a5abf3256b71129995ec3601454b02"
63
63
  }