convert-buddy-js 0.6.0 → 0.9.0

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 (37) hide show
  1. package/dist/chunk-DESHN2IK.js.map +1 -0
  2. package/dist/{chunk-WBKHAQCT.js → chunk-EW7HKBIV.js} +3 -2
  3. package/dist/chunk-EW7HKBIV.js.map +1 -0
  4. package/dist/{chunk-C3RSVYQF.js → chunk-KMYCJF2Y.js} +2 -2
  5. package/dist/chunk-KMYCJF2Y.js.map +1 -0
  6. package/dist/src/bench/datasets.d.ts +12 -0
  7. package/dist/src/bench/datasets.js +149 -0
  8. package/dist/src/bench/datasets.js.map +1 -0
  9. package/dist/src/bench/runner-with-competitors.d.ts +2 -0
  10. package/dist/src/bench/runner-with-competitors.js +330 -0
  11. package/dist/src/bench/runner-with-competitors.js.map +1 -0
  12. package/dist/src/bench/runner.d.ts +2 -0
  13. package/dist/src/bench/runner.js +160 -0
  14. package/dist/src/bench/runner.js.map +1 -0
  15. package/dist/src/src/index.js +191 -0
  16. package/dist/src/src/index.js.map +1 -0
  17. package/dist/src/src/node.js +59 -0
  18. package/dist/src/src/node.js.map +1 -0
  19. package/dist/src/src/smoke-test.d.ts +2 -0
  20. package/dist/src/src/smoke-test.js +210 -0
  21. package/dist/src/src/smoke-test.js.map +1 -0
  22. package/dist/wasm/nodejs/convert_buddy.d.ts +52 -0
  23. package/dist/wasm/nodejs/convert_buddy.js +637 -0
  24. package/dist/wasm/nodejs/convert_buddy_bg.wasm +0 -0
  25. package/dist/wasm/nodejs/convert_buddy_bg.wasm.d.ts +31 -0
  26. package/dist/wasm/nodejs/package.json +13 -0
  27. package/dist/wasm/web/convert_buddy.d.ts +107 -0
  28. package/dist/wasm/web/convert_buddy.js +695 -0
  29. package/dist/wasm/web/convert_buddy_bg.wasm +0 -0
  30. package/dist/wasm/web/convert_buddy_bg.wasm.d.ts +31 -0
  31. package/dist/wasm/web/package.json +17 -0
  32. package/package.json +8 -12
  33. package/wasm-node.cjs +10 -1
  34. package/dist/src/index.js +0 -17
  35. package/dist/src/node.js +0 -21
  36. /package/dist/src/{index.d.ts → src/index.d.ts} +0 -0
  37. /package/dist/src/{node.d.ts → src/node.d.ts} +0 -0
@@ -0,0 +1,637 @@
1
+
2
+ let imports = {};
3
+ imports['__wbindgen_placeholder__'] = module.exports;
4
+ let wasm;
5
+ const { TextDecoder, TextEncoder } = require(`util`);
6
+
7
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
8
+
9
+ cachedTextDecoder.decode();
10
+
11
+ let cachedUint8ArrayMemory0 = null;
12
+
13
+ function getUint8ArrayMemory0() {
14
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
15
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
16
+ }
17
+ return cachedUint8ArrayMemory0;
18
+ }
19
+
20
+ function getStringFromWasm0(ptr, len) {
21
+ ptr = ptr >>> 0;
22
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
23
+ }
24
+
25
+ function addToExternrefTable0(obj) {
26
+ const idx = wasm.__externref_table_alloc();
27
+ wasm.__wbindgen_export_3.set(idx, obj);
28
+ return idx;
29
+ }
30
+
31
+ function handleError(f, args) {
32
+ try {
33
+ return f.apply(this, args);
34
+ } catch (e) {
35
+ const idx = addToExternrefTable0(e);
36
+ wasm.__wbindgen_exn_store(idx);
37
+ }
38
+ }
39
+
40
+ let WASM_VECTOR_LEN = 0;
41
+
42
+ let cachedTextEncoder = new TextEncoder('utf-8');
43
+
44
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
45
+ ? function (arg, view) {
46
+ return cachedTextEncoder.encodeInto(arg, view);
47
+ }
48
+ : function (arg, view) {
49
+ const buf = cachedTextEncoder.encode(arg);
50
+ view.set(buf);
51
+ return {
52
+ read: arg.length,
53
+ written: buf.length
54
+ };
55
+ });
56
+
57
+ function passStringToWasm0(arg, malloc, realloc) {
58
+
59
+ if (realloc === undefined) {
60
+ const buf = cachedTextEncoder.encode(arg);
61
+ const ptr = malloc(buf.length, 1) >>> 0;
62
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
63
+ WASM_VECTOR_LEN = buf.length;
64
+ return ptr;
65
+ }
66
+
67
+ let len = arg.length;
68
+ let ptr = malloc(len, 1) >>> 0;
69
+
70
+ const mem = getUint8ArrayMemory0();
71
+
72
+ let offset = 0;
73
+
74
+ for (; offset < len; offset++) {
75
+ const code = arg.charCodeAt(offset);
76
+ if (code > 0x7F) break;
77
+ mem[ptr + offset] = code;
78
+ }
79
+
80
+ if (offset !== len) {
81
+ if (offset !== 0) {
82
+ arg = arg.slice(offset);
83
+ }
84
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
85
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
86
+ const ret = encodeString(arg, view);
87
+
88
+ offset += ret.written;
89
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
90
+ }
91
+
92
+ WASM_VECTOR_LEN = offset;
93
+ return ptr;
94
+ }
95
+
96
+ let cachedDataViewMemory0 = null;
97
+
98
+ function getDataViewMemory0() {
99
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
100
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
101
+ }
102
+ return cachedDataViewMemory0;
103
+ }
104
+
105
+ function debugString(val) {
106
+ // primitive types
107
+ const type = typeof val;
108
+ if (type == 'number' || type == 'boolean' || val == null) {
109
+ return `${val}`;
110
+ }
111
+ if (type == 'string') {
112
+ return `"${val}"`;
113
+ }
114
+ if (type == 'symbol') {
115
+ const description = val.description;
116
+ if (description == null) {
117
+ return 'Symbol';
118
+ } else {
119
+ return `Symbol(${description})`;
120
+ }
121
+ }
122
+ if (type == 'function') {
123
+ const name = val.name;
124
+ if (typeof name == 'string' && name.length > 0) {
125
+ return `Function(${name})`;
126
+ } else {
127
+ return 'Function';
128
+ }
129
+ }
130
+ // objects
131
+ if (Array.isArray(val)) {
132
+ const length = val.length;
133
+ let debug = '[';
134
+ if (length > 0) {
135
+ debug += debugString(val[0]);
136
+ }
137
+ for(let i = 1; i < length; i++) {
138
+ debug += ', ' + debugString(val[i]);
139
+ }
140
+ debug += ']';
141
+ return debug;
142
+ }
143
+ // Test for built-in
144
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
145
+ let className;
146
+ if (builtInMatches && builtInMatches.length > 1) {
147
+ className = builtInMatches[1];
148
+ } else {
149
+ // Failed to match the standard '[object ClassName]'
150
+ return toString.call(val);
151
+ }
152
+ if (className == 'Object') {
153
+ // we're a user defined class or Object
154
+ // JSON.stringify avoids problems with cycles, and is generally much
155
+ // easier than looping through ownProperties of `val`.
156
+ try {
157
+ return 'Object(' + JSON.stringify(val) + ')';
158
+ } catch (_) {
159
+ return 'Object';
160
+ }
161
+ }
162
+ // errors
163
+ if (val instanceof Error) {
164
+ return `${val.name}: ${val.message}\n${val.stack}`;
165
+ }
166
+ // TODO we could test for more things here, like `Set`s and `Map`s.
167
+ return className;
168
+ }
169
+
170
+ function isLikeNone(x) {
171
+ return x === undefined || x === null;
172
+ }
173
+
174
+ function passArray8ToWasm0(arg, malloc) {
175
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
176
+ getUint8ArrayMemory0().set(arg, ptr / 1);
177
+ WASM_VECTOR_LEN = arg.length;
178
+ return ptr;
179
+ }
180
+ /**
181
+ * Detect CSV fields and delimiter from a sample of bytes.
182
+ * @param {Uint8Array} sample
183
+ * @returns {any}
184
+ */
185
+ module.exports.detectCsvFields = function(sample) {
186
+ const ptr0 = passArray8ToWasm0(sample, wasm.__wbindgen_malloc);
187
+ const len0 = WASM_VECTOR_LEN;
188
+ const ret = wasm.detectCsvFields(ptr0, len0);
189
+ return ret;
190
+ };
191
+
192
+ /**
193
+ * @param {boolean} debug_enabled
194
+ */
195
+ module.exports.init = function(debug_enabled) {
196
+ wasm.init(debug_enabled);
197
+ };
198
+
199
+ /**
200
+ * Detect the input format from a sample of bytes.
201
+ * @param {Uint8Array} sample
202
+ * @returns {string | undefined}
203
+ */
204
+ module.exports.detectFormat = function(sample) {
205
+ const ptr0 = passArray8ToWasm0(sample, wasm.__wbindgen_malloc);
206
+ const len0 = WASM_VECTOR_LEN;
207
+ const ret = wasm.detectFormat(ptr0, len0);
208
+ let v2;
209
+ if (ret[0] !== 0) {
210
+ v2 = getStringFromWasm0(ret[0], ret[1]).slice();
211
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
212
+ }
213
+ return v2;
214
+ };
215
+
216
+ function takeFromExternrefTable0(idx) {
217
+ const value = wasm.__wbindgen_export_3.get(idx);
218
+ wasm.__externref_table_dealloc(idx);
219
+ return value;
220
+ }
221
+
222
+ function getArrayU8FromWasm0(ptr, len) {
223
+ ptr = ptr >>> 0;
224
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
225
+ }
226
+
227
+ const ConverterFinalization = (typeof FinalizationRegistry === 'undefined')
228
+ ? { register: () => {}, unregister: () => {} }
229
+ : new FinalizationRegistry(ptr => wasm.__wbg_converter_free(ptr >>> 0, 1));
230
+ /**
231
+ * A streaming converter state machine.
232
+ * Converts between CSV, NDJSON, JSON, and XML formats with high performance.
233
+ */
234
+ class Converter {
235
+
236
+ static __wrap(ptr) {
237
+ ptr = ptr >>> 0;
238
+ const obj = Object.create(Converter.prototype);
239
+ obj.__wbg_ptr = ptr;
240
+ ConverterFinalization.register(obj, obj.__wbg_ptr, obj);
241
+ return obj;
242
+ }
243
+
244
+ __destroy_into_raw() {
245
+ const ptr = this.__wbg_ptr;
246
+ this.__wbg_ptr = 0;
247
+ ConverterFinalization.unregister(this);
248
+ return ptr;
249
+ }
250
+
251
+ free() {
252
+ const ptr = this.__destroy_into_raw();
253
+ wasm.__wbg_converter_free(ptr, 0);
254
+ }
255
+ /**
256
+ * Create a new converter with specific configuration
257
+ * @param {boolean} debug
258
+ * @param {string} input_format
259
+ * @param {string} output_format
260
+ * @param {number} chunk_target_bytes
261
+ * @param {boolean} enable_stats
262
+ * @param {any} csv_config
263
+ * @param {any} xml_config
264
+ * @returns {Converter}
265
+ */
266
+ static withConfig(debug, input_format, output_format, chunk_target_bytes, enable_stats, csv_config, xml_config) {
267
+ const ptr0 = passStringToWasm0(input_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
268
+ const len0 = WASM_VECTOR_LEN;
269
+ const ptr1 = passStringToWasm0(output_format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
270
+ const len1 = WASM_VECTOR_LEN;
271
+ const ret = wasm.converter_withConfig(debug, ptr0, len0, ptr1, len1, chunk_target_bytes, enable_stats, csv_config, xml_config);
272
+ if (ret[2]) {
273
+ throw takeFromExternrefTable0(ret[1]);
274
+ }
275
+ return Converter.__wrap(ret[0]);
276
+ }
277
+ /**
278
+ * @param {boolean} debug
279
+ */
280
+ constructor(debug) {
281
+ const ret = wasm.converter_new(debug);
282
+ this.__wbg_ptr = ret >>> 0;
283
+ ConverterFinalization.register(this, this.__wbg_ptr, this);
284
+ return this;
285
+ }
286
+ /**
287
+ * Push a chunk of bytes. Returns converted output bytes for that chunk.
288
+ * @param {Uint8Array} chunk
289
+ * @returns {Uint8Array}
290
+ */
291
+ push(chunk) {
292
+ const ptr0 = passArray8ToWasm0(chunk, wasm.__wbindgen_malloc);
293
+ const len0 = WASM_VECTOR_LEN;
294
+ const ret = wasm.converter_push(this.__wbg_ptr, ptr0, len0);
295
+ if (ret[3]) {
296
+ throw takeFromExternrefTable0(ret[2]);
297
+ }
298
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
299
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
300
+ return v2;
301
+ }
302
+ /**
303
+ * Finish the stream and return any remaining buffered output.
304
+ * @returns {Uint8Array}
305
+ */
306
+ finish() {
307
+ const ret = wasm.converter_finish(this.__wbg_ptr);
308
+ if (ret[3]) {
309
+ throw takeFromExternrefTable0(ret[2]);
310
+ }
311
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
312
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
313
+ return v1;
314
+ }
315
+ /**
316
+ * Get performance statistics
317
+ * @returns {Stats}
318
+ */
319
+ getStats() {
320
+ const ret = wasm.converter_getStats(this.__wbg_ptr);
321
+ return Stats.__wrap(ret);
322
+ }
323
+ }
324
+ module.exports.Converter = Converter;
325
+
326
+ const StatsFinalization = (typeof FinalizationRegistry === 'undefined')
327
+ ? { register: () => {}, unregister: () => {} }
328
+ : new FinalizationRegistry(ptr => wasm.__wbg_stats_free(ptr >>> 0, 1));
329
+ /**
330
+ * Performance statistics for the converter
331
+ */
332
+ class Stats {
333
+
334
+ static __wrap(ptr) {
335
+ ptr = ptr >>> 0;
336
+ const obj = Object.create(Stats.prototype);
337
+ obj.__wbg_ptr = ptr;
338
+ StatsFinalization.register(obj, obj.__wbg_ptr, obj);
339
+ return obj;
340
+ }
341
+
342
+ __destroy_into_raw() {
343
+ const ptr = this.__wbg_ptr;
344
+ this.__wbg_ptr = 0;
345
+ StatsFinalization.unregister(this);
346
+ return ptr;
347
+ }
348
+
349
+ free() {
350
+ const ptr = this.__destroy_into_raw();
351
+ wasm.__wbg_stats_free(ptr, 0);
352
+ }
353
+ /**
354
+ * @returns {number}
355
+ */
356
+ get parse_time_ms() {
357
+ const ret = wasm.stats_parse_time_ms(this.__wbg_ptr);
358
+ return ret;
359
+ }
360
+ /**
361
+ * @returns {number}
362
+ */
363
+ get write_time_ms() {
364
+ const ret = wasm.stats_write_time_ms(this.__wbg_ptr);
365
+ return ret;
366
+ }
367
+ /**
368
+ * @returns {number}
369
+ */
370
+ get max_buffer_size() {
371
+ const ret = wasm.stats_max_buffer_size(this.__wbg_ptr);
372
+ return ret >>> 0;
373
+ }
374
+ /**
375
+ * @returns {number}
376
+ */
377
+ get records_processed() {
378
+ const ret = wasm.stats_records_processed(this.__wbg_ptr);
379
+ return ret;
380
+ }
381
+ /**
382
+ * @returns {number}
383
+ */
384
+ get transform_time_ms() {
385
+ const ret = wasm.stats_transform_time_ms(this.__wbg_ptr);
386
+ return ret;
387
+ }
388
+ /**
389
+ * @returns {number}
390
+ */
391
+ get current_partial_size() {
392
+ const ret = wasm.stats_current_partial_size(this.__wbg_ptr);
393
+ return ret >>> 0;
394
+ }
395
+ /**
396
+ * @returns {number}
397
+ */
398
+ get throughput_mb_per_sec() {
399
+ const ret = wasm.stats_throughput_mb_per_sec(this.__wbg_ptr);
400
+ return ret;
401
+ }
402
+ /**
403
+ * @returns {number}
404
+ */
405
+ get bytes_in() {
406
+ const ret = wasm.stats_bytes_in(this.__wbg_ptr);
407
+ return ret;
408
+ }
409
+ /**
410
+ * @returns {number}
411
+ */
412
+ get bytes_out() {
413
+ const ret = wasm.stats_bytes_out(this.__wbg_ptr);
414
+ return ret;
415
+ }
416
+ /**
417
+ * @returns {number}
418
+ */
419
+ get chunks_in() {
420
+ const ret = wasm.stats_chunks_in(this.__wbg_ptr);
421
+ return ret;
422
+ }
423
+ }
424
+ module.exports.Stats = Stats;
425
+
426
+ module.exports.__wbg_buffer_61b7ce01341d7f88 = function(arg0) {
427
+ const ret = arg0.buffer;
428
+ return ret;
429
+ };
430
+
431
+ module.exports.__wbg_debug_156ca727dbc3150f = function(arg0) {
432
+ console.debug(arg0);
433
+ };
434
+
435
+ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
436
+ let deferred0_0;
437
+ let deferred0_1;
438
+ try {
439
+ deferred0_0 = arg0;
440
+ deferred0_1 = arg1;
441
+ console.error(getStringFromWasm0(arg0, arg1));
442
+ } finally {
443
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
444
+ }
445
+ };
446
+
447
+ module.exports.__wbg_error_fab41a42d22bf2bc = function(arg0) {
448
+ console.error(arg0);
449
+ };
450
+
451
+ module.exports.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
452
+ const ret = arg0[arg1];
453
+ return ret;
454
+ };
455
+
456
+ module.exports.__wbg_info_c3044c86ae29faab = function(arg0) {
457
+ console.info(arg0);
458
+ };
459
+
460
+ module.exports.__wbg_instanceof_ArrayBuffer_670ddde44cdb2602 = function(arg0) {
461
+ let result;
462
+ try {
463
+ result = arg0 instanceof ArrayBuffer;
464
+ } catch (_) {
465
+ result = false;
466
+ }
467
+ const ret = result;
468
+ return ret;
469
+ };
470
+
471
+ module.exports.__wbg_instanceof_Uint8Array_28af5bc19d6acad8 = function(arg0) {
472
+ let result;
473
+ try {
474
+ result = arg0 instanceof Uint8Array;
475
+ } catch (_) {
476
+ result = false;
477
+ }
478
+ const ret = result;
479
+ return ret;
480
+ };
481
+
482
+ module.exports.__wbg_length_65d1cd11729ced11 = function(arg0) {
483
+ const ret = arg0.length;
484
+ return ret;
485
+ };
486
+
487
+ module.exports.__wbg_log_464d1b2190ca1e04 = function(arg0) {
488
+ console.log(arg0);
489
+ };
490
+
491
+ module.exports.__wbg_new_254fa9eac11932ae = function() {
492
+ const ret = new Array();
493
+ return ret;
494
+ };
495
+
496
+ module.exports.__wbg_new_3ff5b33b1ce712df = function(arg0) {
497
+ const ret = new Uint8Array(arg0);
498
+ return ret;
499
+ };
500
+
501
+ module.exports.__wbg_new_688846f374351c92 = function() {
502
+ const ret = new Object();
503
+ return ret;
504
+ };
505
+
506
+ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
507
+ const ret = new Error();
508
+ return ret;
509
+ };
510
+
511
+ module.exports.__wbg_now_64d0bb151e5d3889 = function() {
512
+ const ret = Date.now();
513
+ return ret;
514
+ };
515
+
516
+ module.exports.__wbg_push_6edad0df4b546b2c = function(arg0, arg1) {
517
+ const ret = arg0.push(arg1);
518
+ return ret;
519
+ };
520
+
521
+ module.exports.__wbg_set_23d69db4e5c66a6e = function(arg0, arg1, arg2) {
522
+ arg0.set(arg1, arg2 >>> 0);
523
+ };
524
+
525
+ module.exports.__wbg_set_4e647025551483bd = function() { return handleError(function (arg0, arg1, arg2) {
526
+ const ret = Reflect.set(arg0, arg1, arg2);
527
+ return ret;
528
+ }, arguments) };
529
+
530
+ module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
531
+ const ret = arg1.stack;
532
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
533
+ const len1 = WASM_VECTOR_LEN;
534
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
535
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
536
+ };
537
+
538
+ module.exports.__wbg_warn_123db6aa8948382e = function(arg0) {
539
+ console.warn(arg0);
540
+ };
541
+
542
+ module.exports.__wbindgen_boolean_get = function(arg0) {
543
+ const v = arg0;
544
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
545
+ return ret;
546
+ };
547
+
548
+ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
549
+ const ret = debugString(arg1);
550
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
551
+ const len1 = WASM_VECTOR_LEN;
552
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
553
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
554
+ };
555
+
556
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
557
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
558
+ return ret;
559
+ };
560
+
561
+ module.exports.__wbindgen_in = function(arg0, arg1) {
562
+ const ret = arg0 in arg1;
563
+ return ret;
564
+ };
565
+
566
+ module.exports.__wbindgen_init_externref_table = function() {
567
+ const table = wasm.__wbindgen_export_3;
568
+ const offset = table.grow(4);
569
+ table.set(0, undefined);
570
+ table.set(offset + 0, undefined);
571
+ table.set(offset + 1, null);
572
+ table.set(offset + 2, true);
573
+ table.set(offset + 3, false);
574
+ ;
575
+ };
576
+
577
+ module.exports.__wbindgen_is_null = function(arg0) {
578
+ const ret = arg0 === null;
579
+ return ret;
580
+ };
581
+
582
+ module.exports.__wbindgen_is_object = function(arg0) {
583
+ const val = arg0;
584
+ const ret = typeof(val) === 'object' && val !== null;
585
+ return ret;
586
+ };
587
+
588
+ module.exports.__wbindgen_is_undefined = function(arg0) {
589
+ const ret = arg0 === undefined;
590
+ return ret;
591
+ };
592
+
593
+ module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
594
+ const ret = arg0 == arg1;
595
+ return ret;
596
+ };
597
+
598
+ module.exports.__wbindgen_memory = function() {
599
+ const ret = wasm.memory;
600
+ return ret;
601
+ };
602
+
603
+ module.exports.__wbindgen_number_get = function(arg0, arg1) {
604
+ const obj = arg1;
605
+ const ret = typeof(obj) === 'number' ? obj : undefined;
606
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
607
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
608
+ };
609
+
610
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
611
+ const obj = arg1;
612
+ const ret = typeof(obj) === 'string' ? obj : undefined;
613
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
614
+ var len1 = WASM_VECTOR_LEN;
615
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
616
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
617
+ };
618
+
619
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
620
+ const ret = getStringFromWasm0(arg0, arg1);
621
+ return ret;
622
+ };
623
+
624
+ module.exports.__wbindgen_throw = function(arg0, arg1) {
625
+ throw new Error(getStringFromWasm0(arg0, arg1));
626
+ };
627
+
628
+ const path = require('path').join(__dirname, 'convert_buddy_bg.wasm');
629
+ const bytes = require('fs').readFileSync(path);
630
+
631
+ const wasmModule = new WebAssembly.Module(bytes);
632
+ const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
633
+ wasm = wasmInstance.exports;
634
+ module.exports.__wasm = wasm;
635
+
636
+ wasm.__wbindgen_start();
637
+
@@ -0,0 +1,31 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const __wbg_converter_free: (a: number, b: number) => void;
5
+ export const __wbg_stats_free: (a: number, b: number) => void;
6
+ export const converter_finish: (a: number) => [number, number, number, number];
7
+ export const converter_getStats: (a: number) => number;
8
+ export const converter_new: (a: number) => number;
9
+ export const converter_push: (a: number, b: number, c: number) => [number, number, number, number];
10
+ export const converter_withConfig: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: any, i: any) => [number, number, number];
11
+ export const detectCsvFields: (a: number, b: number) => any;
12
+ export const detectFormat: (a: number, b: number) => [number, number];
13
+ export const init: (a: number) => void;
14
+ export const stats_bytes_in: (a: number) => number;
15
+ export const stats_bytes_out: (a: number) => number;
16
+ export const stats_chunks_in: (a: number) => number;
17
+ export const stats_current_partial_size: (a: number) => number;
18
+ export const stats_max_buffer_size: (a: number) => number;
19
+ export const stats_parse_time_ms: (a: number) => number;
20
+ export const stats_records_processed: (a: number) => number;
21
+ export const stats_throughput_mb_per_sec: (a: number) => number;
22
+ export const stats_transform_time_ms: (a: number) => number;
23
+ export const stats_write_time_ms: (a: number) => number;
24
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
25
+ export const __wbindgen_exn_store: (a: number) => void;
26
+ export const __externref_table_alloc: () => number;
27
+ export const __wbindgen_export_3: WebAssembly.Table;
28
+ export const __wbindgen_malloc: (a: number, b: number) => number;
29
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
30
+ export const __externref_table_dealloc: (a: number) => void;
31
+ export const __wbindgen_start: () => void;
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "convert-buddy",
3
+ "description": "High-performance streaming converters (CSV/XML/JSON/NDJSON) core",
4
+ "version": "0.1.0",
5
+ "license": "MIT",
6
+ "files": [
7
+ "convert_buddy_bg.wasm",
8
+ "convert_buddy.js",
9
+ "convert_buddy.d.ts"
10
+ ],
11
+ "main": "convert_buddy.js",
12
+ "types": "convert_buddy.d.ts"
13
+ }