@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 CHANGED
@@ -1,2 +1,2 @@
1
- /** Gets a buffer representing the WASM module. */
1
+ /** Gets a buffer representing the Wasm module. */
2
2
  export function getBuffer(): ArrayBuffer;
package/index.js CHANGED
@@ -1,32 +1,12 @@
1
- /**
2
- * Gets a buffer representing the WASM module.
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
- * @param {string} encodedBuffer
5
+ * Gets a buffer representing the Wasm module.
12
6
  * @returns {ArrayBuffer}
13
7
  */
14
- function decodeEncodedBuffer(encodedBuffer) {
15
- // https://stackoverflow.com/a/51473757/188246
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dprint/biome",
3
- "version": "0.11.6",
3
+ "version": "0.12.0",
4
4
  "description": "Wasm buffer for dprint-plugin-biome.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
package/plugin.wasm ADDED
Binary file