timed-automata-analyzer 1.0.4 → 1.0.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/README.md CHANGED
@@ -21,7 +21,7 @@ In case you want to contribute to the tool or fork the repository, only few step
21
21
  - As a first step, you need to install Rust.
22
22
  See the [Rust website](https://www.rust-lang.org/tools/install) for information on how to do this.
23
23
  - Additionally, you need to install _wasm-pack_ with `cargo install wasm-pack` for WebAssembly outputs.
24
- - The WebAssembly binary (including glue code for JavaScript/TypeScript and an npm package) is generated by running `wasm-pack build --target bundler` and published to the npm registry by running `wasm-pack publish`.
24
+ - The WebAssembly binary (including glue code for JavaScript/TypeScript and an NPM package) is generated by running `wasm-pack build --target bundler` and published to the npm registry by running `wasm-pack publish`.
25
25
  - This project includes an extensive test suite. Tests can be run with `cargo test`.
26
26
  - For linting, this project uses the built-in linter of Rust as well as [Clippy](https://github.com/rust-lang/rust-clippy).
27
27
  To run the linters, execute `cargo check` and `cargo clippy`, respectively.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "luth1um"
6
6
  ],
7
7
  "description": "An analyzer for Timed Automata written in Rust",
8
- "version": "1.0.4",
8
+ "version": "1.0.5",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
@@ -4,12 +4,6 @@ export function __wbg_set_wasm(val) {
4
4
  }
5
5
 
6
6
 
7
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
8
-
9
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
10
-
11
- cachedTextDecoder.decode();
12
-
13
7
  let cachedUint8ArrayMemory0 = null;
14
8
 
15
9
  function getUint8ArrayMemory0() {
@@ -19,16 +13,34 @@ function getUint8ArrayMemory0() {
19
13
  return cachedUint8ArrayMemory0;
20
14
  }
21
15
 
16
+ const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
17
+
18
+ let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
19
+
20
+ cachedTextDecoder.decode();
21
+
22
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
23
+ let numBytesDecoded = 0;
24
+ function decodeText(ptr, len) {
25
+ numBytesDecoded += len;
26
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
27
+ cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
28
+ cachedTextDecoder.decode();
29
+ numBytesDecoded = len;
30
+ }
31
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
32
+ }
33
+
22
34
  function getStringFromWasm0(ptr, len) {
23
35
  ptr = ptr >>> 0;
24
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
36
+ return decodeText(ptr, len);
25
37
  }
26
38
 
27
39
  let WASM_VECTOR_LEN = 0;
28
40
 
29
41
  const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
30
42
 
31
- let cachedTextEncoder = new lTextEncoder('utf-8');
43
+ const cachedTextEncoder = new lTextEncoder('utf-8');
32
44
 
33
45
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
34
46
  ? function (arg, view) {
Binary file