@r2o3/rgskin-nodejs 0.0.4 → 0.0.6

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/README.md CHANGED
@@ -44,7 +44,7 @@ A library for loading and creating skins for various rhythm games. It supports m
44
44
  Add this to your `Cargo.toml`:
45
45
  ```toml
46
46
  [dependencies]
47
- rgskin = "0.0.4"
47
+ rgskin = "0.0.6"
48
48
  ```
49
49
 
50
50
  Or run:
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "menvae"
5
5
  ],
6
6
  "description": "A library for converting, loading and creating skins for various rhythm games.",
7
- "version": "0.0.4",
7
+ "version": "0.0.6",
8
8
  "license": "MIT",
9
9
  "repository": {
10
10
  "type": "git",
package/rgskin.js CHANGED
@@ -2,7 +2,7 @@
2
2
  let imports = {};
3
3
  imports['__wbindgen_placeholder__'] = module.exports;
4
4
 
5
- const { createDirAll, isDirectory, joinPath, readDir, readFileBytes, readFileString, writeFile } = require(String.raw`./snippets/rgskin-1ac328c7fce651f2/inline0.js`);
5
+ const { createDirAll, isDirectory, joinPath, readDir, readFileBytes, readFileString, writeFile } = require(String.raw`./snippets/rgskin-8f133b2515c75408/inline0.js`);
6
6
 
7
7
  function addToExternrefTable0(obj) {
8
8
  const idx = wasm.__externref_table_alloc();
@@ -109,7 +109,7 @@ function getArrayU8FromWasm0(ptr, len) {
109
109
 
110
110
  let cachedDataViewMemory0 = null;
111
111
  function getDataViewMemory0() {
112
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
112
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
113
113
  cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
114
114
  }
115
115
  return cachedDataViewMemory0;
@@ -117,7 +117,7 @@ function getDataViewMemory0() {
117
117
 
118
118
  let cachedFloat32ArrayMemory0 = null;
119
119
  function getFloat32ArrayMemory0() {
120
- if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
120
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.buffer !== wasm.memory.buffer) {
121
121
  cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
122
122
  }
123
123
  return cachedFloat32ArrayMemory0;
@@ -130,7 +130,7 @@ function getStringFromWasm0(ptr, len) {
130
130
 
131
131
  let cachedUint16ArrayMemory0 = null;
132
132
  function getUint16ArrayMemory0() {
133
- if (cachedUint16ArrayMemory0 === null || cachedUint16ArrayMemory0.byteLength === 0) {
133
+ if (cachedUint16ArrayMemory0 === null || cachedUint16ArrayMemory0.buffer !== wasm.memory.buffer) {
134
134
  cachedUint16ArrayMemory0 = new Uint16Array(wasm.memory.buffer);
135
135
  }
136
136
  return cachedUint16ArrayMemory0;
@@ -138,7 +138,7 @@ function getUint16ArrayMemory0() {
138
138
 
139
139
  let cachedUint8ArrayMemory0 = null;
140
140
  function getUint8ArrayMemory0() {
141
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
141
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.buffer !== wasm.memory.buffer) {
142
142
  cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
143
143
  }
144
144
  return cachedUint8ArrayMemory0;
@@ -231,15 +231,16 @@ function takeFromExternrefTable0(idx) {
231
231
  return value;
232
232
  }
233
233
 
234
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
235
- cachedTextDecoder.decode();
234
+ let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : undefined);
235
+ if (cachedTextDecoder) cachedTextDecoder.decode();
236
+
236
237
  function decodeText(ptr, len) {
237
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
238
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().slice(ptr, ptr + len));
238
239
  }
239
240
 
240
- const cachedTextEncoder = new TextEncoder();
241
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder() : undefined);
241
242
 
242
- if (!('encodeInto' in cachedTextEncoder)) {
243
+ if (cachedTextEncoder) {
243
244
  cachedTextEncoder.encodeInto = function (arg, view) {
244
245
  const buf = cachedTextEncoder.encode(arg);
245
246
  view.set(buf);
@@ -5706,7 +5707,7 @@ exports.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
5706
5707
  throw new Error(getStringFromWasm0(arg0, arg1));
5707
5708
  };
5708
5709
 
5709
- exports.__wbg_createDirAll_12a67205521e99f7 = function() { return handleError(function (arg0, arg1) {
5710
+ exports.__wbg_createDirAll_170575e19256a2d4 = function() { return handleError(function (arg0, arg1) {
5710
5711
  createDirAll(getStringFromWasm0(arg0, arg1));
5711
5712
  }, arguments) };
5712
5713
 
@@ -5725,12 +5726,12 @@ exports.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
5725
5726
  return ret;
5726
5727
  };
5727
5728
 
5728
- exports.__wbg_isDirectory_c077b41f3b7b2df7 = function() { return handleError(function (arg0, arg1) {
5729
+ exports.__wbg_isDirectory_05f3d3d916186588 = function() { return handleError(function (arg0, arg1) {
5729
5730
  const ret = isDirectory(getStringFromWasm0(arg0, arg1));
5730
5731
  return ret;
5731
5732
  }, arguments) };
5732
5733
 
5733
- exports.__wbg_joinPath_bff79219513ef55a = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
5734
+ exports.__wbg_joinPath_9dc05c716a1dd5e6 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
5734
5735
  const ret = joinPath(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
5735
5736
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5736
5737
  const len1 = WASM_VECTOR_LEN;
@@ -5792,17 +5793,17 @@ exports.__wbg_quakeymode_unwrap = function(arg0) {
5792
5793
  return ret;
5793
5794
  };
5794
5795
 
5795
- exports.__wbg_readDir_cc088e74c8a41f13 = function() { return handleError(function (arg0, arg1) {
5796
+ exports.__wbg_readDir_a354ae11474d6793 = function() { return handleError(function (arg0, arg1) {
5796
5797
  const ret = readDir(getStringFromWasm0(arg0, arg1));
5797
5798
  return ret;
5798
5799
  }, arguments) };
5799
5800
 
5800
- exports.__wbg_readFileBytes_395b9d2be29cedd1 = function() { return handleError(function (arg0, arg1) {
5801
+ exports.__wbg_readFileBytes_c0e41f15cab20875 = function() { return handleError(function (arg0, arg1) {
5801
5802
  const ret = readFileBytes(getStringFromWasm0(arg0, arg1));
5802
5803
  return ret;
5803
5804
  }, arguments) };
5804
5805
 
5805
- exports.__wbg_readFileString_2a9c67574a6580d7 = function() { return handleError(function (arg0, arg1, arg2) {
5806
+ exports.__wbg_readFileString_5fc6abd83b694120 = function() { return handleError(function (arg0, arg1, arg2) {
5806
5807
  const ret = readFileString(getStringFromWasm0(arg1, arg2));
5807
5808
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5808
5809
  const len1 = WASM_VECTOR_LEN;
@@ -5810,7 +5811,7 @@ exports.__wbg_readFileString_2a9c67574a6580d7 = function() { return handleError(
5810
5811
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
5811
5812
  }, arguments) };
5812
5813
 
5813
- exports.__wbg_writeFile_f3f5d75134f8e6ee = function() { return handleError(function (arg0, arg1, arg2, arg3) {
5814
+ exports.__wbg_writeFile_0884471a7d47b37b = function() { return handleError(function (arg0, arg1, arg2, arg3) {
5814
5815
  writeFile(getStringFromWasm0(arg0, arg1), getArrayU8FromWasm0(arg2, arg3));
5815
5816
  }, arguments) };
5816
5817
 
@@ -5830,6 +5831,8 @@ exports.__wbindgen_init_externref_table = function() {
5830
5831
  table.set(offset + 3, false);
5831
5832
  };
5832
5833
 
5834
+ exports.memory = new WebAssembly.Memory({initial:20,maximum:16384,shared:true});
5835
+
5833
5836
  const wasmPath = `${__dirname}/rgskin_bg.wasm`;
5834
5837
  const wasmBytes = require('fs').readFileSync(wasmPath);
5835
5838
  const wasmModule = new WebAssembly.Module(wasmBytes);
package/rgskin_bg.wasm CHANGED
Binary file