@dprint/biome 0.11.6 → 0.12.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.
- package/index.d.ts +1 -1
- package/index.js +5 -25
- package/package.json +1 -1
- package/plugin.wasm +0 -0
- package/buffer.generated.js +0 -1
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** Gets a buffer representing the
|
|
1
|
+
/** Gets a buffer representing the Wasm module. */
|
|
2
2
|
export function getBuffer(): ArrayBuffer;
|
package/index.js
CHANGED
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @returns {ArrayBuffer}
|
|
4
|
-
*/
|
|
5
|
-
function getBuffer() {
|
|
6
|
-
const encodedBuffer = require("./buffer.generated").encodedBuffer;
|
|
7
|
-
return decodeEncodedBuffer(encodedBuffer);
|
|
8
|
-
}
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
9
3
|
|
|
10
4
|
/**
|
|
11
|
-
*
|
|
5
|
+
* Gets a buffer representing the Wasm module.
|
|
12
6
|
* @returns {ArrayBuffer}
|
|
13
7
|
*/
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
const binaryString = toBinaryString();
|
|
17
|
-
const bytes = new Uint8Array(binaryString.length);
|
|
18
|
-
for (let i = 0; i < binaryString.length; i++) {
|
|
19
|
-
bytes[i] = binaryString.charCodeAt(i);
|
|
20
|
-
}
|
|
21
|
-
return bytes.buffer;
|
|
22
|
-
|
|
23
|
-
function toBinaryString() {
|
|
24
|
-
if (typeof atob === "function") {
|
|
25
|
-
return atob(encodedBuffer);
|
|
26
|
-
} else {
|
|
27
|
-
return Buffer.from(encodedBuffer, "base64").toString("binary");
|
|
28
|
-
}
|
|
29
|
-
}
|
|
8
|
+
function getBuffer() {
|
|
9
|
+
return fs.readFileSync(path.join(__dirname, "plugin.wasm"));
|
|
30
10
|
}
|
|
31
11
|
|
|
32
12
|
module.exports = {
|
package/package.json
CHANGED
package/plugin.wasm
ADDED
|
Binary file
|