merfix 0.1.69 → 0.1.70

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/merfix.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ export function detect_image_extension(data: Uint8Array): string | undefined;
4
+ export function supported_extensions(): any[];
5
+ export function detect_image_mime_type(data: Uint8Array): string | undefined;
3
6
  export function supported_mime_types(): any[];
4
7
  export function version(): string;
5
8
  export function remove_exif(input: Uint8Array, extension: string): ExifRemovalResult;
6
- export function detect_image_mime_type(data: Uint8Array): string | undefined;
7
- export function supported_extensions(): any[];
8
- export function detect_image_extension(data: Uint8Array): string | undefined;
9
9
  export enum ExifRemovalStatus {
10
10
  Success = 0,
11
11
  Error = 1,
@@ -37,8 +37,8 @@ export interface InitOutput {
37
37
  readonly version: () => [number, number];
38
38
  readonly __wbindgen_externrefs: WebAssembly.Table;
39
39
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
40
- readonly __externref_drop_slice: (a: number, b: number) => void;
41
40
  readonly __wbindgen_malloc: (a: number, b: number) => number;
41
+ readonly __externref_drop_slice: (a: number, b: number) => void;
42
42
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
43
43
  readonly __wbindgen_start: () => void;
44
44
  }
package/merfix.js CHANGED
@@ -35,6 +35,30 @@ function getArrayU8FromWasm0(ptr, len) {
35
35
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
36
36
  }
37
37
 
38
+ let WASM_VECTOR_LEN = 0;
39
+
40
+ function passArray8ToWasm0(arg, malloc) {
41
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
42
+ getUint8ArrayMemory0().set(arg, ptr / 1);
43
+ WASM_VECTOR_LEN = arg.length;
44
+ return ptr;
45
+ }
46
+ /**
47
+ * @param {Uint8Array} data
48
+ * @returns {string | undefined}
49
+ */
50
+ export function detect_image_extension(data) {
51
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
52
+ const len0 = WASM_VECTOR_LEN;
53
+ const ret = wasm.detect_image_extension(ptr0, len0);
54
+ let v2;
55
+ if (ret[0] !== 0) {
56
+ v2 = getStringFromWasm0(ret[0], ret[1]).slice();
57
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
58
+ }
59
+ return v2;
60
+ }
61
+
38
62
  let cachedDataViewMemory0 = null;
39
63
 
40
64
  function getDataViewMemory0() {
@@ -54,6 +78,32 @@ function getArrayJsValueFromWasm0(ptr, len) {
54
78
  wasm.__externref_drop_slice(ptr, len);
55
79
  return result;
56
80
  }
81
+ /**
82
+ * @returns {any[]}
83
+ */
84
+ export function supported_extensions() {
85
+ const ret = wasm.supported_extensions();
86
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
87
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
88
+ return v1;
89
+ }
90
+
91
+ /**
92
+ * @param {Uint8Array} data
93
+ * @returns {string | undefined}
94
+ */
95
+ export function detect_image_mime_type(data) {
96
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
97
+ const len0 = WASM_VECTOR_LEN;
98
+ const ret = wasm.detect_image_mime_type(ptr0, len0);
99
+ let v2;
100
+ if (ret[0] !== 0) {
101
+ v2 = getStringFromWasm0(ret[0], ret[1]).slice();
102
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
103
+ }
104
+ return v2;
105
+ }
106
+
57
107
  /**
58
108
  * @returns {any[]}
59
109
  */
@@ -80,15 +130,6 @@ export function version() {
80
130
  }
81
131
  }
82
132
 
83
- let WASM_VECTOR_LEN = 0;
84
-
85
- function passArray8ToWasm0(arg, malloc) {
86
- const ptr = malloc(arg.length * 1, 1) >>> 0;
87
- getUint8ArrayMemory0().set(arg, ptr / 1);
88
- WASM_VECTOR_LEN = arg.length;
89
- return ptr;
90
- }
91
-
92
133
  const cachedTextEncoder = new TextEncoder();
93
134
 
94
135
  if (!('encodeInto' in cachedTextEncoder)) {
@@ -154,48 +195,6 @@ export function remove_exif(input, extension) {
154
195
  return ExifRemovalResult.__wrap(ret);
155
196
  }
156
197
 
157
- /**
158
- * @param {Uint8Array} data
159
- * @returns {string | undefined}
160
- */
161
- export function detect_image_mime_type(data) {
162
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
163
- const len0 = WASM_VECTOR_LEN;
164
- const ret = wasm.detect_image_mime_type(ptr0, len0);
165
- let v2;
166
- if (ret[0] !== 0) {
167
- v2 = getStringFromWasm0(ret[0], ret[1]).slice();
168
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
169
- }
170
- return v2;
171
- }
172
-
173
- /**
174
- * @returns {any[]}
175
- */
176
- export function supported_extensions() {
177
- const ret = wasm.supported_extensions();
178
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
179
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
180
- return v1;
181
- }
182
-
183
- /**
184
- * @param {Uint8Array} data
185
- * @returns {string | undefined}
186
- */
187
- export function detect_image_extension(data) {
188
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
189
- const len0 = WASM_VECTOR_LEN;
190
- const ret = wasm.detect_image_extension(ptr0, len0);
191
- let v2;
192
- if (ret[0] !== 0) {
193
- v2 = getStringFromWasm0(ret[0], ret[1]).slice();
194
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
195
- }
196
- return v2;
197
- }
198
-
199
198
  /**
200
199
  * @enum {0 | 1}
201
200
  */
package/merfix_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "merfix",
3
3
  "type": "module",
4
4
  "description": "Utility to remove EXIF metadata from images from browser",
5
- "version": "0.1.69",
5
+ "version": "0.1.70",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",