@databio/peprs 0.2.3 → 0.2.5

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@databio/peprs",
3
3
  "type": "module",
4
- "version": "0.2.3",
4
+ "version": "0.2.5",
5
5
  "files": [
6
6
  "peprs_wasm_bg.wasm",
7
7
  "peprs_wasm.js",
@@ -14,6 +14,6 @@
14
14
  ],
15
15
  "repository": {
16
16
  "type": "git",
17
- "url": "https://github.com/khoroshevskyi/peprs"
17
+ "url": "git+https://github.com/pepkit/peprs.git"
18
18
  }
19
19
  }
package/peprs_wasm.js CHANGED
@@ -18,7 +18,7 @@ export class WasmProject {
18
18
  const ret = wasm.wasmproject_get_description(this.__wbg_ptr);
19
19
  let v1;
20
20
  if (ret[0] !== 0) {
21
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
21
+ v1 = getStringFromWasm0(ret[0], ret[1]);
22
22
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
23
23
  }
24
24
  return v1;
@@ -30,7 +30,7 @@ export class WasmProject {
30
30
  const ret = wasm.wasmproject_get_name(this.__wbg_ptr);
31
31
  let v1;
32
32
  if (ret[0] !== 0) {
33
- v1 = getStringFromWasm0(ret[0], ret[1]).slice();
33
+ v1 = getStringFromWasm0(ret[0], ret[1]);
34
34
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
35
35
  }
36
36
  return v1;
@@ -130,7 +130,7 @@ export function validate(project, schema_json) {
130
130
  function __wbg_get_imports() {
131
131
  const import0 = {
132
132
  __proto__: null,
133
- __wbg_Error_92b29b0548f8b746: function(arg0, arg1) {
133
+ __wbg_Error_208446807d0d1e30: function(arg0, arg1) {
134
134
  const ret = Error(getStringFromWasm0(arg0, arg1));
135
135
  return ret;
136
136
  },
@@ -138,13 +138,13 @@ function __wbg_get_imports() {
138
138
  const ret = String(arg1);
139
139
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
140
140
  const len1 = WASM_VECTOR_LEN;
141
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
142
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
141
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
142
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
143
143
  },
144
- __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
144
+ __wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
145
145
  throw new Error(getStringFromWasm0(arg0, arg1));
146
146
  },
147
- __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
147
+ __wbg_error_757e9472f8410341: function(arg0, arg1) {
148
148
  let deferred0_0;
149
149
  let deferred0_1;
150
150
  try {
@@ -155,50 +155,52 @@ function __wbg_get_imports() {
155
155
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
156
156
  }
157
157
  },
158
- __wbg_getRandomValues_3f44b700395062e5: function() { return handleError(function (arg0, arg1) {
158
+ __wbg_getRandomValues_01076ebaa66264dc: function() { return handleError(function (arg0, arg1) {
159
159
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
160
160
  }, arguments); },
161
- __wbg_getRandomValues_bf16787eede473f5: function() { return handleError(function (arg0, arg1) {
161
+ __wbg_getRandomValues_5d8c030b527203a6: function() { return handleError(function (arg0, arg1) {
162
162
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
163
163
  }, arguments); },
164
- __wbg_new_227d7c05414eb861: function() {
165
- const ret = new Error();
164
+ __wbg_getRandomValues_8b6f1f663e6f188d: function() { return handleError(function (arg0, arg1) {
165
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
166
+ }, arguments); },
167
+ __wbg_new_37eb45aaf5eeb820: function() {
168
+ const ret = new Array();
166
169
  return ret;
167
170
  },
168
- __wbg_new_32b398fb48b6d94a: function() {
169
- const ret = new Array();
171
+ __wbg_new_bb74001155cb8ca8: function() {
172
+ const ret = new Error();
170
173
  return ret;
171
174
  },
172
- __wbg_new_da52cf8fe3429cb2: function() {
175
+ __wbg_new_cd4348290afae586: function() {
173
176
  const ret = new Object();
174
177
  return ret;
175
178
  },
176
- __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
177
- arg0[arg1] = arg2;
178
- },
179
- __wbg_set_8a16b38e4805b298: function(arg0, arg1, arg2) {
179
+ __wbg_set_d2d33b52458e984a: function(arg0, arg1, arg2) {
180
180
  arg0[arg1 >>> 0] = arg2;
181
181
  },
182
- __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
182
+ __wbg_set_e4b9a833d288759a: function(arg0, arg1, arg2) {
183
+ arg0[arg1] = arg2;
184
+ },
185
+ __wbg_stack_575c4e0918581b9c: function(arg0, arg1) {
183
186
  const ret = arg1.stack;
184
187
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
185
188
  const len1 = WASM_VECTOR_LEN;
186
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
187
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
189
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
190
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
188
191
  },
189
- __wbindgen_cast_0000000000000001: function(arg0, arg1) {
192
+ __wbindgen_generic_0000000000000001: function(arg0, arg1) {
190
193
  // Cast intrinsic for `Ref(String) -> Externref`.
191
194
  const ret = getStringFromWasm0(arg0, arg1);
192
195
  return ret;
193
196
  },
194
197
  __wbindgen_init_externref_table: function() {
195
198
  const table = wasm.__wbindgen_externrefs;
196
- const offset = table.grow(4);
197
199
  table.set(0, undefined);
198
- table.set(offset + 0, undefined);
199
- table.set(offset + 1, null);
200
- table.set(offset + 2, true);
201
- table.set(offset + 3, false);
200
+ table.set(1024, undefined);
201
+ table.set(1025, null);
202
+ table.set(1026, true);
203
+ table.set(1027, false);
202
204
  },
203
205
  };
204
206
  return {
@@ -237,7 +239,8 @@ function getDataViewMemory0() {
237
239
  }
238
240
 
239
241
  function getStringFromWasm0(ptr, len) {
240
- return decodeText(ptr >>> 0, len);
242
+ ptr = ptr >>> 0;
243
+ return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
241
244
  }
242
245
 
243
246
  let cachedUint8ArrayMemory0 = null;
@@ -300,18 +303,18 @@ function takeFromExternrefTable0(idx) {
300
303
  return value;
301
304
  }
302
305
 
303
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
306
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
304
307
  cachedTextDecoder.decode();
305
308
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
306
309
  let numBytesDecoded = 0;
307
- function decodeText(ptr, len) {
308
- numBytesDecoded += len;
310
+ function decodeText(bytes) {
311
+ numBytesDecoded += bytes.length;
309
312
  if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
310
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
313
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
311
314
  cachedTextDecoder.decode();
312
- numBytesDecoded = len;
315
+ numBytesDecoded = bytes.length;
313
316
  }
314
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
317
+ return cachedTextDecoder.decode(bytes);
315
318
  }
316
319
 
317
320
  const cachedTextEncoder = new TextEncoder();
@@ -342,11 +345,15 @@ function __wbg_finalize_init(instance, module) {
342
345
 
343
346
  async function __wbg_load(module, imports) {
344
347
  if (typeof Response === 'function' && module instanceof Response) {
348
+ if (!module.ok) {
349
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
350
+ }
351
+
345
352
  if (typeof WebAssembly.instantiateStreaming === 'function') {
346
353
  try {
347
354
  return await WebAssembly.instantiateStreaming(module, imports);
348
355
  } catch (e) {
349
- const validResponse = module.ok && expectedResponseType(module.type);
356
+ const validResponse = expectedResponseType(module.type);
350
357
 
351
358
  if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
352
359
  console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
@@ -395,9 +402,17 @@ function initSync(module) {
395
402
  return __wbg_finalize_init(instance, module);
396
403
  }
397
404
 
405
+ let __wbg_init_promise;
398
406
  async function __wbg_init(module_or_path) {
399
407
  if (wasm !== undefined) return wasm;
408
+ if (__wbg_init_promise === undefined) {
409
+ __wbg_init_promise = __wbg_init_once(module_or_path);
410
+ __wbg_init_promise.catch(() => { __wbg_init_promise = undefined; });
411
+ }
412
+ return __wbg_init_promise;
413
+ }
400
414
 
415
+ async function __wbg_init_once(module_or_path) {
401
416
 
402
417
  if (module_or_path !== undefined) {
403
418
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
Binary file