oxide-wasm 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/index.mjs +6 -6
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -15,20 +15,20 @@ export async function init(module_or_path) {
15
15
  const importUrl = import.meta.url;
16
16
  if (!module_or_path && importUrl.startsWith("file://")) {
17
17
  const { pathname: filename } = new URL("./pkg/oxide_wasm_bg.wasm", importUrl);
18
- let wasmBytes;
18
+ let wasmData;
19
19
  if (globalThis.Deno) {
20
- wasmBytes = await Deno.readFile(filename);
20
+ wasmData = await Deno.readFile(filename);
21
21
  } else if (globalThis.Bun) {
22
- wasmBytes = await Bun.file(filename).arrayBuffer();
22
+ wasmData = await Bun.file(filename).arrayBuffer();
23
23
  } else {
24
24
  const moduleSpecifier = `node:fs/promises`;
25
25
  const fsPromise = await import(moduleSpecifier); // <- use variable to skip deno-lsp analyzing
26
- wasmBytes = await fsPromise.readFile(filename);
26
+ wasmData = await fsPromise.readFile(filename);
27
27
  }
28
- initWasmSync({ module: wasmBytes });
28
+ initWasmSync({ module: wasmData });
29
29
  return;
30
30
  }
31
- const esmshBaseUrl = "https://esm.sh/@esm.sh/oxide-wasm@";
31
+ const esmshBaseUrl = "https://esm.sh/oxide-wasm@";
32
32
  if (!module_or_path && importUrl.startsWith(esmshBaseUrl)) {
33
33
  const version = importUrl.slice(esmshBaseUrl.length).split("/", 1)[0];
34
34
  module_or_path = esmshBaseUrl + version + "/pkg/oxide_wasm_bg.wasm";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxide-wasm",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A wasm build of the tailwindcss oxide",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",