cspell-io 9.2.2 → 9.3.1
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 +1 -0
- package/dist/index.js +3 -13
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
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
|
-
|
|
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 =
|
|
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.
|
|
7
|
+
"version": "9.3.1",
|
|
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.
|
|
60
|
-
"@cspell/url": "9.
|
|
59
|
+
"@cspell/cspell-service-bus": "9.3.1",
|
|
60
|
+
"@cspell/url": "9.3.1"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "3f8bf5c88cda393b581957b7f8efc696e432f6f1"
|
|
63
63
|
}
|