minijinja-js 2.8.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.
@@ -0,0 +1,866 @@
1
+
2
+ let imports = {};
3
+ imports['__wbindgen_placeholder__'] = module.exports;
4
+ let wasm;
5
+ const { TextEncoder, TextDecoder } = require(`util`);
6
+
7
+ const heap = new Array(128).fill(undefined);
8
+
9
+ heap.push(undefined, null, true, false);
10
+
11
+ function getObject(idx) { return heap[idx]; }
12
+
13
+ let WASM_VECTOR_LEN = 0;
14
+
15
+ let cachedUint8ArrayMemory0 = null;
16
+
17
+ function getUint8ArrayMemory0() {
18
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
19
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
20
+ }
21
+ return cachedUint8ArrayMemory0;
22
+ }
23
+
24
+ let cachedTextEncoder = new TextEncoder('utf-8');
25
+
26
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
27
+ ? function (arg, view) {
28
+ return cachedTextEncoder.encodeInto(arg, view);
29
+ }
30
+ : function (arg, view) {
31
+ const buf = cachedTextEncoder.encode(arg);
32
+ view.set(buf);
33
+ return {
34
+ read: arg.length,
35
+ written: buf.length
36
+ };
37
+ });
38
+
39
+ function passStringToWasm0(arg, malloc, realloc) {
40
+
41
+ if (realloc === undefined) {
42
+ const buf = cachedTextEncoder.encode(arg);
43
+ const ptr = malloc(buf.length, 1) >>> 0;
44
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
45
+ WASM_VECTOR_LEN = buf.length;
46
+ return ptr;
47
+ }
48
+
49
+ let len = arg.length;
50
+ let ptr = malloc(len, 1) >>> 0;
51
+
52
+ const mem = getUint8ArrayMemory0();
53
+
54
+ let offset = 0;
55
+
56
+ for (; offset < len; offset++) {
57
+ const code = arg.charCodeAt(offset);
58
+ if (code > 0x7F) break;
59
+ mem[ptr + offset] = code;
60
+ }
61
+
62
+ if (offset !== len) {
63
+ if (offset !== 0) {
64
+ arg = arg.slice(offset);
65
+ }
66
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
67
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
68
+ const ret = encodeString(arg, view);
69
+
70
+ offset += ret.written;
71
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
72
+ }
73
+
74
+ WASM_VECTOR_LEN = offset;
75
+ return ptr;
76
+ }
77
+
78
+ let cachedDataViewMemory0 = null;
79
+
80
+ function getDataViewMemory0() {
81
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
82
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
83
+ }
84
+ return cachedDataViewMemory0;
85
+ }
86
+
87
+ let heap_next = heap.length;
88
+
89
+ function addHeapObject(obj) {
90
+ if (heap_next === heap.length) heap.push(heap.length + 1);
91
+ const idx = heap_next;
92
+ heap_next = heap[idx];
93
+
94
+ heap[idx] = obj;
95
+ return idx;
96
+ }
97
+
98
+ function handleError(f, args) {
99
+ try {
100
+ return f.apply(this, args);
101
+ } catch (e) {
102
+ wasm.__wbindgen_export_2(addHeapObject(e));
103
+ }
104
+ }
105
+
106
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
107
+
108
+ cachedTextDecoder.decode();
109
+
110
+ function getStringFromWasm0(ptr, len) {
111
+ ptr = ptr >>> 0;
112
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
113
+ }
114
+
115
+ function dropObject(idx) {
116
+ if (idx < 132) return;
117
+ heap[idx] = heap_next;
118
+ heap_next = idx;
119
+ }
120
+
121
+ function takeObject(idx) {
122
+ const ret = getObject(idx);
123
+ dropObject(idx);
124
+ return ret;
125
+ }
126
+
127
+ function isLikeNone(x) {
128
+ return x === undefined || x === null;
129
+ }
130
+
131
+ function debugString(val) {
132
+ // primitive types
133
+ const type = typeof val;
134
+ if (type == 'number' || type == 'boolean' || val == null) {
135
+ return `${val}`;
136
+ }
137
+ if (type == 'string') {
138
+ return `"${val}"`;
139
+ }
140
+ if (type == 'symbol') {
141
+ const description = val.description;
142
+ if (description == null) {
143
+ return 'Symbol';
144
+ } else {
145
+ return `Symbol(${description})`;
146
+ }
147
+ }
148
+ if (type == 'function') {
149
+ const name = val.name;
150
+ if (typeof name == 'string' && name.length > 0) {
151
+ return `Function(${name})`;
152
+ } else {
153
+ return 'Function';
154
+ }
155
+ }
156
+ // objects
157
+ if (Array.isArray(val)) {
158
+ const length = val.length;
159
+ let debug = '[';
160
+ if (length > 0) {
161
+ debug += debugString(val[0]);
162
+ }
163
+ for(let i = 1; i < length; i++) {
164
+ debug += ', ' + debugString(val[i]);
165
+ }
166
+ debug += ']';
167
+ return debug;
168
+ }
169
+ // Test for built-in
170
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
171
+ let className;
172
+ if (builtInMatches && builtInMatches.length > 1) {
173
+ className = builtInMatches[1];
174
+ } else {
175
+ // Failed to match the standard '[object ClassName]'
176
+ return toString.call(val);
177
+ }
178
+ if (className == 'Object') {
179
+ // we're a user defined class or Object
180
+ // JSON.stringify avoids problems with cycles, and is generally much
181
+ // easier than looping through ownProperties of `val`.
182
+ try {
183
+ return 'Object(' + JSON.stringify(val) + ')';
184
+ } catch (_) {
185
+ return 'Object';
186
+ }
187
+ }
188
+ // errors
189
+ if (val instanceof Error) {
190
+ return `${val.name}: ${val.message}\n${val.stack}`;
191
+ }
192
+ // TODO we could test for more things here, like `Set`s and `Map`s.
193
+ return className;
194
+ }
195
+
196
+ const __wbindgen_enum_UndefinedBehavior = ["strict", "chainable", "lenient", "semi_strct"];
197
+
198
+ const EnvironmentFinalization = (typeof FinalizationRegistry === 'undefined')
199
+ ? { register: () => {}, unregister: () => {} }
200
+ : new FinalizationRegistry(ptr => wasm.__wbg_environment_free(ptr >>> 0, 1));
201
+ /**
202
+ * Represents a MiniJinja environment.
203
+ */
204
+ class Environment {
205
+
206
+ __destroy_into_raw() {
207
+ const ptr = this.__wbg_ptr;
208
+ this.__wbg_ptr = 0;
209
+ EnvironmentFinalization.unregister(this);
210
+ return ptr;
211
+ }
212
+
213
+ free() {
214
+ const ptr = this.__destroy_into_raw();
215
+ wasm.__wbg_environment_free(ptr, 0);
216
+ }
217
+ constructor() {
218
+ const ret = wasm.environment_new();
219
+ this.__wbg_ptr = ret >>> 0;
220
+ EnvironmentFinalization.register(this, this.__wbg_ptr, this);
221
+ return this;
222
+ }
223
+ /**
224
+ * Registers a new template by name and source.
225
+ * @param {string} name
226
+ * @param {string} source
227
+ */
228
+ addTemplate(name, source) {
229
+ try {
230
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
231
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
232
+ const len0 = WASM_VECTOR_LEN;
233
+ const ptr1 = passStringToWasm0(source, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
234
+ const len1 = WASM_VECTOR_LEN;
235
+ wasm.environment_addTemplate(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
236
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
237
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
238
+ if (r1) {
239
+ throw takeObject(r0);
240
+ }
241
+ } finally {
242
+ wasm.__wbindgen_add_to_stack_pointer(16);
243
+ }
244
+ }
245
+ /**
246
+ * Removes a template by name.
247
+ * @param {string} name
248
+ */
249
+ removeTemplate(name) {
250
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
251
+ const len0 = WASM_VECTOR_LEN;
252
+ wasm.environment_removeTemplate(this.__wbg_ptr, ptr0, len0);
253
+ }
254
+ /**
255
+ * Clears all templates from the environment.
256
+ */
257
+ clearTemplates() {
258
+ wasm.environment_clearTemplates(this.__wbg_ptr);
259
+ }
260
+ /**
261
+ * Renders a registered template by name with the given context.
262
+ * @param {string} name
263
+ * @param {any} ctx
264
+ * @returns {string}
265
+ */
266
+ renderTemplate(name, ctx) {
267
+ let deferred3_0;
268
+ let deferred3_1;
269
+ try {
270
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
271
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
272
+ const len0 = WASM_VECTOR_LEN;
273
+ wasm.environment_renderTemplate(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(ctx));
274
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
275
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
276
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
277
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
278
+ var ptr2 = r0;
279
+ var len2 = r1;
280
+ if (r3) {
281
+ ptr2 = 0; len2 = 0;
282
+ throw takeObject(r2);
283
+ }
284
+ deferred3_0 = ptr2;
285
+ deferred3_1 = len2;
286
+ return getStringFromWasm0(ptr2, len2);
287
+ } finally {
288
+ wasm.__wbindgen_add_to_stack_pointer(16);
289
+ wasm.__wbindgen_export_3(deferred3_0, deferred3_1, 1);
290
+ }
291
+ }
292
+ /**
293
+ * Renders a string template with the given context.
294
+ *
295
+ * This is useful for one-off template rendering without registering the template. The
296
+ * template is parsed and rendered immediately.
297
+ * @param {string} source
298
+ * @param {any} ctx
299
+ * @returns {string}
300
+ */
301
+ renderStr(source, ctx) {
302
+ let deferred3_0;
303
+ let deferred3_1;
304
+ try {
305
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
306
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
307
+ const len0 = WASM_VECTOR_LEN;
308
+ wasm.environment_renderStr(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(ctx));
309
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
310
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
311
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
312
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
313
+ var ptr2 = r0;
314
+ var len2 = r1;
315
+ if (r3) {
316
+ ptr2 = 0; len2 = 0;
317
+ throw takeObject(r2);
318
+ }
319
+ deferred3_0 = ptr2;
320
+ deferred3_1 = len2;
321
+ return getStringFromWasm0(ptr2, len2);
322
+ } finally {
323
+ wasm.__wbindgen_add_to_stack_pointer(16);
324
+ wasm.__wbindgen_export_3(deferred3_0, deferred3_1, 1);
325
+ }
326
+ }
327
+ /**
328
+ * Like `renderStr` but with a named template for auto escape detection.
329
+ * @param {string} name
330
+ * @param {string} source
331
+ * @param {any} ctx
332
+ * @returns {string}
333
+ */
334
+ renderNamedStr(name, source, ctx) {
335
+ let deferred4_0;
336
+ let deferred4_1;
337
+ try {
338
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
339
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
340
+ const len0 = WASM_VECTOR_LEN;
341
+ const ptr1 = passStringToWasm0(source, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
342
+ const len1 = WASM_VECTOR_LEN;
343
+ wasm.environment_renderNamedStr(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(ctx));
344
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
345
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
346
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
347
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
348
+ var ptr3 = r0;
349
+ var len3 = r1;
350
+ if (r3) {
351
+ ptr3 = 0; len3 = 0;
352
+ throw takeObject(r2);
353
+ }
354
+ deferred4_0 = ptr3;
355
+ deferred4_1 = len3;
356
+ return getStringFromWasm0(ptr3, len3);
357
+ } finally {
358
+ wasm.__wbindgen_add_to_stack_pointer(16);
359
+ wasm.__wbindgen_export_3(deferred4_0, deferred4_1, 1);
360
+ }
361
+ }
362
+ /**
363
+ * Evaluates an expression with the given context.
364
+ *
365
+ * This is useful for evaluating expressions outside of templates. The expression is
366
+ * parsed and evaluated immediately.
367
+ * @param {string} expr
368
+ * @param {any} ctx
369
+ * @returns {any}
370
+ */
371
+ evalExpr(expr, ctx) {
372
+ try {
373
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
374
+ const ptr0 = passStringToWasm0(expr, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
375
+ const len0 = WASM_VECTOR_LEN;
376
+ wasm.environment_evalExpr(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(ctx));
377
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
378
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
379
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
380
+ if (r2) {
381
+ throw takeObject(r1);
382
+ }
383
+ return takeObject(r0);
384
+ } finally {
385
+ wasm.__wbindgen_add_to_stack_pointer(16);
386
+ }
387
+ }
388
+ /**
389
+ * Registers a filter function.
390
+ * @param {string} name
391
+ * @param {Function} func
392
+ */
393
+ addFilter(name, func) {
394
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
395
+ const len0 = WASM_VECTOR_LEN;
396
+ wasm.environment_addFilter(this.__wbg_ptr, ptr0, len0, addHeapObject(func));
397
+ }
398
+ /**
399
+ * Registers a test function.
400
+ * @param {string} name
401
+ * @param {Function} func
402
+ */
403
+ addTest(name, func) {
404
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
405
+ const len0 = WASM_VECTOR_LEN;
406
+ wasm.environment_addTest(this.__wbg_ptr, ptr0, len0, addHeapObject(func));
407
+ }
408
+ /**
409
+ * Enables python compatibility.
410
+ */
411
+ enablePyCompat() {
412
+ wasm.environment_enablePyCompat(this.__wbg_ptr);
413
+ }
414
+ /**
415
+ * Enables or disables debug mode.
416
+ * @returns {boolean}
417
+ */
418
+ get debug() {
419
+ const ret = wasm.environment_debug(this.__wbg_ptr);
420
+ return ret !== 0;
421
+ }
422
+ /**
423
+ * @param {boolean} yes
424
+ */
425
+ set debug(yes) {
426
+ wasm.environment_set_debug(this.__wbg_ptr, yes);
427
+ }
428
+ /**
429
+ * Enables or disables block trimming.
430
+ * @returns {boolean}
431
+ */
432
+ get trimBlocks() {
433
+ const ret = wasm.environment_trimBlocks(this.__wbg_ptr);
434
+ return ret !== 0;
435
+ }
436
+ /**
437
+ * @param {boolean} yes
438
+ */
439
+ set trimBlocks(yes) {
440
+ wasm.environment_set_trimBlocks(this.__wbg_ptr, yes);
441
+ }
442
+ /**
443
+ * Enables or disables the lstrip blocks feature.
444
+ * @returns {boolean}
445
+ */
446
+ get lstripBlocks() {
447
+ const ret = wasm.environment_lstripBlocks(this.__wbg_ptr);
448
+ return ret !== 0;
449
+ }
450
+ /**
451
+ * @param {boolean} yes
452
+ */
453
+ set lstripBlocks(yes) {
454
+ wasm.environment_set_lstripBlocks(this.__wbg_ptr, yes);
455
+ }
456
+ /**
457
+ * Enables or disables keeping of the final newline.
458
+ * @returns {boolean}
459
+ */
460
+ get keepTrailingNewline() {
461
+ const ret = wasm.environment_keepTrailingNewline(this.__wbg_ptr);
462
+ return ret !== 0;
463
+ }
464
+ /**
465
+ * @param {boolean} yes
466
+ */
467
+ set keepTrailingNewline(yes) {
468
+ wasm.environment_set_keepTrailingNewline(this.__wbg_ptr, yes);
469
+ }
470
+ /**
471
+ * Reconfigures the behavior of undefined variables.
472
+ * @returns {UndefinedBehavior}
473
+ */
474
+ get undefinedBehavior() {
475
+ const ret = wasm.environment_undefinedBehavior(this.__wbg_ptr);
476
+ return __wbindgen_enum_UndefinedBehavior[ret];
477
+ }
478
+ /**
479
+ * @param {UndefinedBehavior} value
480
+ */
481
+ set undefinedBehavior(value) {
482
+ try {
483
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
484
+ wasm.environment_set_undefinedBehavior(retptr, this.__wbg_ptr, (__wbindgen_enum_UndefinedBehavior.indexOf(value) + 1 || 5) - 1);
485
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
486
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
487
+ if (r1) {
488
+ throw takeObject(r0);
489
+ }
490
+ } finally {
491
+ wasm.__wbindgen_add_to_stack_pointer(16);
492
+ }
493
+ }
494
+ /**
495
+ * Configures the max-fuel for template evaluation.
496
+ * @returns {number | undefined}
497
+ */
498
+ get fuel() {
499
+ const ret = wasm.environment_fuel(this.__wbg_ptr);
500
+ return ret === 0x100000001 ? undefined : ret;
501
+ }
502
+ /**
503
+ * @param {number | null} [value]
504
+ */
505
+ set fuel(value) {
506
+ wasm.environment_set_fuel(this.__wbg_ptr, isLikeNone(value) ? 0x100000001 : (value) >>> 0);
507
+ }
508
+ /**
509
+ * Registers a value as global.
510
+ * @param {string} name
511
+ * @param {any} value
512
+ */
513
+ addGlobal(name, value) {
514
+ try {
515
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
516
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
517
+ const len0 = WASM_VECTOR_LEN;
518
+ wasm.environment_addGlobal(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(value));
519
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
520
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
521
+ if (r1) {
522
+ throw takeObject(r0);
523
+ }
524
+ } finally {
525
+ wasm.__wbindgen_add_to_stack_pointer(16);
526
+ }
527
+ }
528
+ /**
529
+ * Removes a global again.
530
+ * @param {string} name
531
+ */
532
+ removeGlobal(name) {
533
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
534
+ const len0 = WASM_VECTOR_LEN;
535
+ wasm.environment_removeGlobal(this.__wbg_ptr, ptr0, len0);
536
+ }
537
+ }
538
+ module.exports.Environment = Environment;
539
+
540
+ module.exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
541
+ const ret = String(getObject(arg1));
542
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
543
+ const len1 = WASM_VECTOR_LEN;
544
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
545
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
546
+ };
547
+
548
+ module.exports.__wbg_apply_36be6a55257c99bf = function() { return handleError(function (arg0, arg1, arg2) {
549
+ const ret = getObject(arg0).apply(getObject(arg1), getObject(arg2));
550
+ return addHeapObject(ret);
551
+ }, arguments) };
552
+
553
+ module.exports.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
554
+ const ret = getObject(arg0).buffer;
555
+ return addHeapObject(ret);
556
+ };
557
+
558
+ module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
559
+ const ret = getObject(arg0).call(getObject(arg1));
560
+ return addHeapObject(ret);
561
+ }, arguments) };
562
+
563
+ module.exports.__wbg_done_769e5ede4b31c67b = function(arg0) {
564
+ const ret = getObject(arg0).done;
565
+ return ret;
566
+ };
567
+
568
+ module.exports.__wbg_entries_3265d4158b33e5dc = function(arg0) {
569
+ const ret = Object.entries(getObject(arg0));
570
+ return addHeapObject(ret);
571
+ };
572
+
573
+ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
574
+ let deferred0_0;
575
+ let deferred0_1;
576
+ try {
577
+ deferred0_0 = arg0;
578
+ deferred0_1 = arg1;
579
+ console.error(getStringFromWasm0(arg0, arg1));
580
+ } finally {
581
+ wasm.__wbindgen_export_3(deferred0_0, deferred0_1, 1);
582
+ }
583
+ };
584
+
585
+ module.exports.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
586
+ const ret = Array.from(getObject(arg0));
587
+ return addHeapObject(ret);
588
+ };
589
+
590
+ module.exports.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
591
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
592
+ return addHeapObject(ret);
593
+ }, arguments) };
594
+
595
+ module.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
596
+ const ret = getObject(arg0)[arg1 >>> 0];
597
+ return addHeapObject(ret);
598
+ };
599
+
600
+ module.exports.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
601
+ let result;
602
+ try {
603
+ result = getObject(arg0) instanceof ArrayBuffer;
604
+ } catch (_) {
605
+ result = false;
606
+ }
607
+ const ret = result;
608
+ return ret;
609
+ };
610
+
611
+ module.exports.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
612
+ let result;
613
+ try {
614
+ result = getObject(arg0) instanceof Map;
615
+ } catch (_) {
616
+ result = false;
617
+ }
618
+ const ret = result;
619
+ return ret;
620
+ };
621
+
622
+ module.exports.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
623
+ let result;
624
+ try {
625
+ result = getObject(arg0) instanceof Uint8Array;
626
+ } catch (_) {
627
+ result = false;
628
+ }
629
+ const ret = result;
630
+ return ret;
631
+ };
632
+
633
+ module.exports.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
634
+ const ret = Array.isArray(getObject(arg0));
635
+ return ret;
636
+ };
637
+
638
+ module.exports.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
639
+ const ret = Number.isSafeInteger(getObject(arg0));
640
+ return ret;
641
+ };
642
+
643
+ module.exports.__wbg_iterator_9a24c88df860dc65 = function() {
644
+ const ret = Symbol.iterator;
645
+ return addHeapObject(ret);
646
+ };
647
+
648
+ module.exports.__wbg_length_a446193dc22c12f8 = function(arg0) {
649
+ const ret = getObject(arg0).length;
650
+ return ret;
651
+ };
652
+
653
+ module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
654
+ const ret = getObject(arg0).length;
655
+ return ret;
656
+ };
657
+
658
+ module.exports.__wbg_new_405e22f390576ce2 = function() {
659
+ const ret = new Object();
660
+ return addHeapObject(ret);
661
+ };
662
+
663
+ module.exports.__wbg_new_5e0be73521bc8c17 = function() {
664
+ const ret = new Map();
665
+ return addHeapObject(ret);
666
+ };
667
+
668
+ module.exports.__wbg_new_78feb108b6472713 = function() {
669
+ const ret = new Array();
670
+ return addHeapObject(ret);
671
+ };
672
+
673
+ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
674
+ const ret = new Error();
675
+ return addHeapObject(ret);
676
+ };
677
+
678
+ module.exports.__wbg_new_a12002a7f91c75be = function(arg0) {
679
+ const ret = new Uint8Array(getObject(arg0));
680
+ return addHeapObject(ret);
681
+ };
682
+
683
+ module.exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
684
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
685
+ return addHeapObject(ret);
686
+ };
687
+
688
+ module.exports.__wbg_next_25feadfc0913fea9 = function(arg0) {
689
+ const ret = getObject(arg0).next;
690
+ return addHeapObject(ret);
691
+ };
692
+
693
+ module.exports.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
694
+ const ret = getObject(arg0).next();
695
+ return addHeapObject(ret);
696
+ }, arguments) };
697
+
698
+ module.exports.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
699
+ const ret = getObject(arg0).push(getObject(arg1));
700
+ return ret;
701
+ };
702
+
703
+ module.exports.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
704
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
705
+ };
706
+
707
+ module.exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
708
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
709
+ };
710
+
711
+ module.exports.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
712
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
713
+ };
714
+
715
+ module.exports.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
716
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
717
+ return addHeapObject(ret);
718
+ };
719
+
720
+ module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
721
+ const ret = getObject(arg1).stack;
722
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
723
+ const len1 = WASM_VECTOR_LEN;
724
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
725
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
726
+ };
727
+
728
+ module.exports.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
729
+ const ret = getObject(arg0).value;
730
+ return addHeapObject(ret);
731
+ };
732
+
733
+ module.exports.__wbindgen_bigint_from_i128 = function(arg0, arg1) {
734
+ const ret = arg0 << BigInt(64) | BigInt.asUintN(64, arg1);
735
+ return addHeapObject(ret);
736
+ };
737
+
738
+ module.exports.__wbindgen_bigint_from_i64 = function(arg0) {
739
+ const ret = arg0;
740
+ return addHeapObject(ret);
741
+ };
742
+
743
+ module.exports.__wbindgen_bigint_from_u128 = function(arg0, arg1) {
744
+ const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1);
745
+ return addHeapObject(ret);
746
+ };
747
+
748
+ module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
749
+ const ret = BigInt.asUintN(64, arg0);
750
+ return addHeapObject(ret);
751
+ };
752
+
753
+ module.exports.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
754
+ const v = getObject(arg1);
755
+ const ret = typeof(v) === 'bigint' ? v : undefined;
756
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
757
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
758
+ };
759
+
760
+ module.exports.__wbindgen_boolean_get = function(arg0) {
761
+ const v = getObject(arg0);
762
+ const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
763
+ return ret;
764
+ };
765
+
766
+ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
767
+ const ret = debugString(getObject(arg1));
768
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
769
+ const len1 = WASM_VECTOR_LEN;
770
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
771
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
772
+ };
773
+
774
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
775
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
776
+ return addHeapObject(ret);
777
+ };
778
+
779
+ module.exports.__wbindgen_in = function(arg0, arg1) {
780
+ const ret = getObject(arg0) in getObject(arg1);
781
+ return ret;
782
+ };
783
+
784
+ module.exports.__wbindgen_is_array = function(arg0) {
785
+ const ret = Array.isArray(getObject(arg0));
786
+ return ret;
787
+ };
788
+
789
+ module.exports.__wbindgen_is_bigint = function(arg0) {
790
+ const ret = typeof(getObject(arg0)) === 'bigint';
791
+ return ret;
792
+ };
793
+
794
+ module.exports.__wbindgen_is_function = function(arg0) {
795
+ const ret = typeof(getObject(arg0)) === 'function';
796
+ return ret;
797
+ };
798
+
799
+ module.exports.__wbindgen_is_object = function(arg0) {
800
+ const val = getObject(arg0);
801
+ const ret = typeof(val) === 'object' && val !== null;
802
+ return ret;
803
+ };
804
+
805
+ module.exports.__wbindgen_is_string = function(arg0) {
806
+ const ret = typeof(getObject(arg0)) === 'string';
807
+ return ret;
808
+ };
809
+
810
+ module.exports.__wbindgen_jsval_eq = function(arg0, arg1) {
811
+ const ret = getObject(arg0) === getObject(arg1);
812
+ return ret;
813
+ };
814
+
815
+ module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
816
+ const ret = getObject(arg0) == getObject(arg1);
817
+ return ret;
818
+ };
819
+
820
+ module.exports.__wbindgen_memory = function() {
821
+ const ret = wasm.memory;
822
+ return addHeapObject(ret);
823
+ };
824
+
825
+ module.exports.__wbindgen_number_get = function(arg0, arg1) {
826
+ const obj = getObject(arg1);
827
+ const ret = typeof(obj) === 'number' ? obj : undefined;
828
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
829
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
830
+ };
831
+
832
+ module.exports.__wbindgen_number_new = function(arg0) {
833
+ const ret = arg0;
834
+ return addHeapObject(ret);
835
+ };
836
+
837
+ module.exports.__wbindgen_object_drop_ref = function(arg0) {
838
+ takeObject(arg0);
839
+ };
840
+
841
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
842
+ const obj = getObject(arg1);
843
+ const ret = typeof(obj) === 'string' ? obj : undefined;
844
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
845
+ var len1 = WASM_VECTOR_LEN;
846
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
847
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
848
+ };
849
+
850
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
851
+ const ret = getStringFromWasm0(arg0, arg1);
852
+ return addHeapObject(ret);
853
+ };
854
+
855
+ module.exports.__wbindgen_throw = function(arg0, arg1) {
856
+ throw new Error(getStringFromWasm0(arg0, arg1));
857
+ };
858
+
859
+ const path = require('path').join(__dirname, 'minijinja_js_bg.wasm');
860
+ const bytes = require('fs').readFileSync(path);
861
+
862
+ const wasmModule = new WebAssembly.Module(bytes);
863
+ const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
864
+ wasm = wasmInstance.exports;
865
+ module.exports.__wasm = wasm;
866
+