@ajitems/devtools 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ajitem Sahasrabuddhe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/devtools.d.ts ADDED
@@ -0,0 +1,110 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export function base64_decode(input: string, url_safe: boolean): any;
5
+
6
+ export function base64_encode(input: string, url_safe: boolean): any;
7
+
8
+ export function calculate_automation_roi(input: any): any;
9
+
10
+ export function calculate_retry_budget(input: any): any;
11
+
12
+ export function calculate_sprint_velocity(input: any): any;
13
+
14
+ export function calculate_working_days(input: any): any;
15
+
16
+ export function cron_parse(expression: string): any;
17
+
18
+ export function ctc_calculate(annual_ctc: number, is_metro: boolean, regime: string): any;
19
+
20
+ export function docker_convert(command: string): any;
21
+
22
+ export function env_validate(content: string): any;
23
+
24
+ export function estimate_cloud_cost(input: any): any;
25
+
26
+ export function freelance_calculate(target_annual_net: number, working_days: number, utilisation_percent: number, gst_registered: boolean): any;
27
+
28
+ export function gst_calculate(amount: number, rate_percent: number, transaction_type: string, is_inclusive: boolean): any;
29
+
30
+ export function gstin_validate(input: string): any;
31
+
32
+ export function init(): void;
33
+
34
+ export function json_diff(left: string, right: string): any;
35
+
36
+ export function json_format(input: string, indent: number): any;
37
+
38
+ export function jwt_decode(token: string): any;
39
+
40
+ export function pan_validate(input: string): any;
41
+
42
+ export function prompt_analyse(input: string): any;
43
+
44
+ export function regex_test(pattern: string, input: string, flags: string): any;
45
+
46
+ export function sla_calculate(uptime_percent: number): any;
47
+
48
+ export function tokens_estimate(input: string): any;
49
+
50
+ export function url_process(input: string, mode: string, variant: string): any;
51
+
52
+ export function validate_ifsc(ifsc: string): any;
53
+
54
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
55
+
56
+ export interface InitOutput {
57
+ readonly memory: WebAssembly.Memory;
58
+ readonly base64_decode: (a: number, b: number, c: number) => number;
59
+ readonly base64_encode: (a: number, b: number, c: number) => number;
60
+ readonly calculate_automation_roi: (a: number) => number;
61
+ readonly calculate_retry_budget: (a: number) => number;
62
+ readonly calculate_sprint_velocity: (a: number) => number;
63
+ readonly calculate_working_days: (a: number) => number;
64
+ readonly cron_parse: (a: number, b: number) => number;
65
+ readonly ctc_calculate: (a: number, b: number, c: number, d: number) => number;
66
+ readonly docker_convert: (a: number, b: number) => number;
67
+ readonly env_validate: (a: number, b: number) => number;
68
+ readonly estimate_cloud_cost: (a: number) => number;
69
+ readonly freelance_calculate: (a: number, b: number, c: number, d: number) => number;
70
+ readonly gst_calculate: (a: number, b: number, c: number, d: number, e: number) => number;
71
+ readonly gstin_validate: (a: number, b: number) => number;
72
+ readonly init: () => void;
73
+ readonly json_diff: (a: number, b: number, c: number, d: number) => number;
74
+ readonly json_format: (a: number, b: number, c: number) => number;
75
+ readonly jwt_decode: (a: number, b: number) => number;
76
+ readonly pan_validate: (a: number, b: number) => number;
77
+ readonly prompt_analyse: (a: number, b: number) => number;
78
+ readonly regex_test: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
79
+ readonly sla_calculate: (a: number) => number;
80
+ readonly tokens_estimate: (a: number, b: number) => number;
81
+ readonly url_process: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
82
+ readonly validate_ifsc: (a: number, b: number) => number;
83
+ readonly __wbindgen_export: (a: number, b: number) => number;
84
+ readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
85
+ readonly __wbindgen_export3: (a: number) => void;
86
+ readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
87
+ readonly __wbindgen_start: () => void;
88
+ }
89
+
90
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
91
+
92
+ /**
93
+ * Instantiates the given `module`, which can either be bytes or
94
+ * a precompiled `WebAssembly.Module`.
95
+ *
96
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
97
+ *
98
+ * @returns {InitOutput}
99
+ */
100
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
101
+
102
+ /**
103
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
104
+ * for everything else, calls `WebAssembly.instantiate` directly.
105
+ *
106
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
107
+ *
108
+ * @returns {Promise<InitOutput>}
109
+ */
110
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
package/devtools.js ADDED
@@ -0,0 +1,825 @@
1
+ /* @ts-self-types="./devtools.d.ts" */
2
+
3
+ /**
4
+ * @param {string} input
5
+ * @param {boolean} url_safe
6
+ * @returns {any}
7
+ */
8
+ export function base64_decode(input, url_safe) {
9
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
10
+ const len0 = WASM_VECTOR_LEN;
11
+ const ret = wasm.base64_decode(ptr0, len0, url_safe);
12
+ return takeObject(ret);
13
+ }
14
+
15
+ /**
16
+ * @param {string} input
17
+ * @param {boolean} url_safe
18
+ * @returns {any}
19
+ */
20
+ export function base64_encode(input, url_safe) {
21
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
22
+ const len0 = WASM_VECTOR_LEN;
23
+ const ret = wasm.base64_encode(ptr0, len0, url_safe);
24
+ return takeObject(ret);
25
+ }
26
+
27
+ /**
28
+ * @param {any} input
29
+ * @returns {any}
30
+ */
31
+ export function calculate_automation_roi(input) {
32
+ const ret = wasm.calculate_automation_roi(addHeapObject(input));
33
+ return takeObject(ret);
34
+ }
35
+
36
+ /**
37
+ * @param {any} input
38
+ * @returns {any}
39
+ */
40
+ export function calculate_retry_budget(input) {
41
+ const ret = wasm.calculate_retry_budget(addHeapObject(input));
42
+ return takeObject(ret);
43
+ }
44
+
45
+ /**
46
+ * @param {any} input
47
+ * @returns {any}
48
+ */
49
+ export function calculate_sprint_velocity(input) {
50
+ const ret = wasm.calculate_sprint_velocity(addHeapObject(input));
51
+ return takeObject(ret);
52
+ }
53
+
54
+ /**
55
+ * @param {any} input
56
+ * @returns {any}
57
+ */
58
+ export function calculate_working_days(input) {
59
+ const ret = wasm.calculate_working_days(addHeapObject(input));
60
+ return takeObject(ret);
61
+ }
62
+
63
+ /**
64
+ * @param {string} expression
65
+ * @returns {any}
66
+ */
67
+ export function cron_parse(expression) {
68
+ const ptr0 = passStringToWasm0(expression, wasm.__wbindgen_export, wasm.__wbindgen_export2);
69
+ const len0 = WASM_VECTOR_LEN;
70
+ const ret = wasm.cron_parse(ptr0, len0);
71
+ return takeObject(ret);
72
+ }
73
+
74
+ /**
75
+ * @param {number} annual_ctc
76
+ * @param {boolean} is_metro
77
+ * @param {string} regime
78
+ * @returns {any}
79
+ */
80
+ export function ctc_calculate(annual_ctc, is_metro, regime) {
81
+ const ptr0 = passStringToWasm0(regime, wasm.__wbindgen_export, wasm.__wbindgen_export2);
82
+ const len0 = WASM_VECTOR_LEN;
83
+ const ret = wasm.ctc_calculate(annual_ctc, is_metro, ptr0, len0);
84
+ return takeObject(ret);
85
+ }
86
+
87
+ /**
88
+ * @param {string} command
89
+ * @returns {any}
90
+ */
91
+ export function docker_convert(command) {
92
+ const ptr0 = passStringToWasm0(command, wasm.__wbindgen_export, wasm.__wbindgen_export2);
93
+ const len0 = WASM_VECTOR_LEN;
94
+ const ret = wasm.docker_convert(ptr0, len0);
95
+ return takeObject(ret);
96
+ }
97
+
98
+ /**
99
+ * @param {string} content
100
+ * @returns {any}
101
+ */
102
+ export function env_validate(content) {
103
+ const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
104
+ const len0 = WASM_VECTOR_LEN;
105
+ const ret = wasm.env_validate(ptr0, len0);
106
+ return takeObject(ret);
107
+ }
108
+
109
+ /**
110
+ * @param {any} input
111
+ * @returns {any}
112
+ */
113
+ export function estimate_cloud_cost(input) {
114
+ const ret = wasm.estimate_cloud_cost(addHeapObject(input));
115
+ return takeObject(ret);
116
+ }
117
+
118
+ /**
119
+ * @param {number} target_annual_net
120
+ * @param {number} working_days
121
+ * @param {number} utilisation_percent
122
+ * @param {boolean} gst_registered
123
+ * @returns {any}
124
+ */
125
+ export function freelance_calculate(target_annual_net, working_days, utilisation_percent, gst_registered) {
126
+ const ret = wasm.freelance_calculate(target_annual_net, working_days, utilisation_percent, gst_registered);
127
+ return takeObject(ret);
128
+ }
129
+
130
+ /**
131
+ * @param {number} amount
132
+ * @param {number} rate_percent
133
+ * @param {string} transaction_type
134
+ * @param {boolean} is_inclusive
135
+ * @returns {any}
136
+ */
137
+ export function gst_calculate(amount, rate_percent, transaction_type, is_inclusive) {
138
+ const ptr0 = passStringToWasm0(transaction_type, wasm.__wbindgen_export, wasm.__wbindgen_export2);
139
+ const len0 = WASM_VECTOR_LEN;
140
+ const ret = wasm.gst_calculate(amount, rate_percent, ptr0, len0, is_inclusive);
141
+ return takeObject(ret);
142
+ }
143
+
144
+ /**
145
+ * @param {string} input
146
+ * @returns {any}
147
+ */
148
+ export function gstin_validate(input) {
149
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
150
+ const len0 = WASM_VECTOR_LEN;
151
+ const ret = wasm.gstin_validate(ptr0, len0);
152
+ return takeObject(ret);
153
+ }
154
+
155
+ export function init() {
156
+ wasm.init();
157
+ }
158
+
159
+ /**
160
+ * @param {string} left
161
+ * @param {string} right
162
+ * @returns {any}
163
+ */
164
+ export function json_diff(left, right) {
165
+ const ptr0 = passStringToWasm0(left, wasm.__wbindgen_export, wasm.__wbindgen_export2);
166
+ const len0 = WASM_VECTOR_LEN;
167
+ const ptr1 = passStringToWasm0(right, wasm.__wbindgen_export, wasm.__wbindgen_export2);
168
+ const len1 = WASM_VECTOR_LEN;
169
+ const ret = wasm.json_diff(ptr0, len0, ptr1, len1);
170
+ return takeObject(ret);
171
+ }
172
+
173
+ /**
174
+ * @param {string} input
175
+ * @param {number} indent
176
+ * @returns {any}
177
+ */
178
+ export function json_format(input, indent) {
179
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
180
+ const len0 = WASM_VECTOR_LEN;
181
+ const ret = wasm.json_format(ptr0, len0, indent);
182
+ return takeObject(ret);
183
+ }
184
+
185
+ /**
186
+ * @param {string} token
187
+ * @returns {any}
188
+ */
189
+ export function jwt_decode(token) {
190
+ const ptr0 = passStringToWasm0(token, wasm.__wbindgen_export, wasm.__wbindgen_export2);
191
+ const len0 = WASM_VECTOR_LEN;
192
+ const ret = wasm.jwt_decode(ptr0, len0);
193
+ return takeObject(ret);
194
+ }
195
+
196
+ /**
197
+ * @param {string} input
198
+ * @returns {any}
199
+ */
200
+ export function pan_validate(input) {
201
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
202
+ const len0 = WASM_VECTOR_LEN;
203
+ const ret = wasm.pan_validate(ptr0, len0);
204
+ return takeObject(ret);
205
+ }
206
+
207
+ /**
208
+ * @param {string} input
209
+ * @returns {any}
210
+ */
211
+ export function prompt_analyse(input) {
212
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
213
+ const len0 = WASM_VECTOR_LEN;
214
+ const ret = wasm.prompt_analyse(ptr0, len0);
215
+ return takeObject(ret);
216
+ }
217
+
218
+ /**
219
+ * @param {string} pattern
220
+ * @param {string} input
221
+ * @param {string} flags
222
+ * @returns {any}
223
+ */
224
+ export function regex_test(pattern, input, flags) {
225
+ const ptr0 = passStringToWasm0(pattern, wasm.__wbindgen_export, wasm.__wbindgen_export2);
226
+ const len0 = WASM_VECTOR_LEN;
227
+ const ptr1 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
228
+ const len1 = WASM_VECTOR_LEN;
229
+ const ptr2 = passStringToWasm0(flags, wasm.__wbindgen_export, wasm.__wbindgen_export2);
230
+ const len2 = WASM_VECTOR_LEN;
231
+ const ret = wasm.regex_test(ptr0, len0, ptr1, len1, ptr2, len2);
232
+ return takeObject(ret);
233
+ }
234
+
235
+ /**
236
+ * @param {number} uptime_percent
237
+ * @returns {any}
238
+ */
239
+ export function sla_calculate(uptime_percent) {
240
+ const ret = wasm.sla_calculate(uptime_percent);
241
+ return takeObject(ret);
242
+ }
243
+
244
+ /**
245
+ * @param {string} input
246
+ * @returns {any}
247
+ */
248
+ export function tokens_estimate(input) {
249
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
250
+ const len0 = WASM_VECTOR_LEN;
251
+ const ret = wasm.tokens_estimate(ptr0, len0);
252
+ return takeObject(ret);
253
+ }
254
+
255
+ /**
256
+ * @param {string} input
257
+ * @param {string} mode
258
+ * @param {string} variant
259
+ * @returns {any}
260
+ */
261
+ export function url_process(input, mode, variant) {
262
+ const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
263
+ const len0 = WASM_VECTOR_LEN;
264
+ const ptr1 = passStringToWasm0(mode, wasm.__wbindgen_export, wasm.__wbindgen_export2);
265
+ const len1 = WASM_VECTOR_LEN;
266
+ const ptr2 = passStringToWasm0(variant, wasm.__wbindgen_export, wasm.__wbindgen_export2);
267
+ const len2 = WASM_VECTOR_LEN;
268
+ const ret = wasm.url_process(ptr0, len0, ptr1, len1, ptr2, len2);
269
+ return takeObject(ret);
270
+ }
271
+
272
+ /**
273
+ * @param {string} ifsc
274
+ * @returns {any}
275
+ */
276
+ export function validate_ifsc(ifsc) {
277
+ const ptr0 = passStringToWasm0(ifsc, wasm.__wbindgen_export, wasm.__wbindgen_export2);
278
+ const len0 = WASM_VECTOR_LEN;
279
+ const ret = wasm.validate_ifsc(ptr0, len0);
280
+ return takeObject(ret);
281
+ }
282
+
283
+ function __wbg_get_imports() {
284
+ const import0 = {
285
+ __proto__: null,
286
+ __wbg_Error_2e59b1b37a9a34c3: function(arg0, arg1) {
287
+ const ret = Error(getStringFromWasm0(arg0, arg1));
288
+ return addHeapObject(ret);
289
+ },
290
+ __wbg_Number_e6ffdb596c888833: function(arg0) {
291
+ const ret = Number(getObject(arg0));
292
+ return ret;
293
+ },
294
+ __wbg___wbindgen_boolean_get_a86c216575a75c30: function(arg0) {
295
+ const v = getObject(arg0);
296
+ const ret = typeof(v) === 'boolean' ? v : undefined;
297
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
298
+ },
299
+ __wbg___wbindgen_debug_string_dd5d2d07ce9e6c57: function(arg0, arg1) {
300
+ const ret = debugString(getObject(arg1));
301
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
302
+ const len1 = WASM_VECTOR_LEN;
303
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
304
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
305
+ },
306
+ __wbg___wbindgen_in_4bd7a57e54337366: function(arg0, arg1) {
307
+ const ret = getObject(arg0) in getObject(arg1);
308
+ return ret;
309
+ },
310
+ __wbg___wbindgen_is_function_49868bde5eb1e745: function(arg0) {
311
+ const ret = typeof(getObject(arg0)) === 'function';
312
+ return ret;
313
+ },
314
+ __wbg___wbindgen_is_object_40c5a80572e8f9d3: function(arg0) {
315
+ const val = getObject(arg0);
316
+ const ret = typeof(val) === 'object' && val !== null;
317
+ return ret;
318
+ },
319
+ __wbg___wbindgen_is_string_b29b5c5a8065ba1a: function(arg0) {
320
+ const ret = typeof(getObject(arg0)) === 'string';
321
+ return ret;
322
+ },
323
+ __wbg___wbindgen_is_undefined_c0cca72b82b86f4d: function(arg0) {
324
+ const ret = getObject(arg0) === undefined;
325
+ return ret;
326
+ },
327
+ __wbg___wbindgen_jsval_loose_eq_3a72ae764d46d944: function(arg0, arg1) {
328
+ const ret = getObject(arg0) == getObject(arg1);
329
+ return ret;
330
+ },
331
+ __wbg___wbindgen_number_get_7579aab02a8a620c: function(arg0, arg1) {
332
+ const obj = getObject(arg1);
333
+ const ret = typeof(obj) === 'number' ? obj : undefined;
334
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
335
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
336
+ },
337
+ __wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
338
+ const obj = getObject(arg1);
339
+ const ret = typeof(obj) === 'string' ? obj : undefined;
340
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
341
+ var len1 = WASM_VECTOR_LEN;
342
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
343
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
344
+ },
345
+ __wbg___wbindgen_throw_81fc77679af83bc6: function(arg0, arg1) {
346
+ throw new Error(getStringFromWasm0(arg0, arg1));
347
+ },
348
+ __wbg_call_7f2987183bb62793: function() { return handleError(function (arg0, arg1) {
349
+ const ret = getObject(arg0).call(getObject(arg1));
350
+ return addHeapObject(ret);
351
+ }, arguments); },
352
+ __wbg_done_547d467e97529006: function(arg0) {
353
+ const ret = getObject(arg0).done;
354
+ return ret;
355
+ },
356
+ __wbg_entries_616b1a459b85be0b: function(arg0) {
357
+ const ret = Object.entries(getObject(arg0));
358
+ return addHeapObject(ret);
359
+ },
360
+ __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
361
+ let deferred0_0;
362
+ let deferred0_1;
363
+ try {
364
+ deferred0_0 = arg0;
365
+ deferred0_1 = arg1;
366
+ console.error(getStringFromWasm0(arg0, arg1));
367
+ } finally {
368
+ wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
369
+ }
370
+ },
371
+ __wbg_fromCodePoint_967e9ce245607f1b: function() { return handleError(function (arg0) {
372
+ const ret = String.fromCodePoint(arg0 >>> 0);
373
+ return addHeapObject(ret);
374
+ }, arguments); },
375
+ __wbg_getTime_f6ac312467f7cf09: function(arg0) {
376
+ const ret = getObject(arg0).getTime();
377
+ return ret;
378
+ },
379
+ __wbg_get_4848e350b40afc16: function(arg0, arg1) {
380
+ const ret = getObject(arg0)[arg1 >>> 0];
381
+ return addHeapObject(ret);
382
+ },
383
+ __wbg_get_ed0642c4b9d31ddf: function() { return handleError(function (arg0, arg1) {
384
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
385
+ return addHeapObject(ret);
386
+ }, arguments); },
387
+ __wbg_get_unchecked_7d7babe32e9e6a54: function(arg0, arg1) {
388
+ const ret = getObject(arg0)[arg1 >>> 0];
389
+ return addHeapObject(ret);
390
+ },
391
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
392
+ const ret = getObject(arg0)[getObject(arg1)];
393
+ return addHeapObject(ret);
394
+ },
395
+ __wbg_instanceof_ArrayBuffer_ff7c1337a5e3b33a: function(arg0) {
396
+ let result;
397
+ try {
398
+ result = getObject(arg0) instanceof ArrayBuffer;
399
+ } catch (_) {
400
+ result = false;
401
+ }
402
+ const ret = result;
403
+ return ret;
404
+ },
405
+ __wbg_instanceof_Uint8Array_4b8da683deb25d72: function(arg0) {
406
+ let result;
407
+ try {
408
+ result = getObject(arg0) instanceof Uint8Array;
409
+ } catch (_) {
410
+ result = false;
411
+ }
412
+ const ret = result;
413
+ return ret;
414
+ },
415
+ __wbg_isArray_db61795ad004c139: function(arg0) {
416
+ const ret = Array.isArray(getObject(arg0));
417
+ return ret;
418
+ },
419
+ __wbg_isSafeInteger_ea83862ba994770c: function(arg0) {
420
+ const ret = Number.isSafeInteger(getObject(arg0));
421
+ return ret;
422
+ },
423
+ __wbg_iterator_de403ef31815a3e6: function() {
424
+ const ret = Symbol.iterator;
425
+ return addHeapObject(ret);
426
+ },
427
+ __wbg_length_0c32cb8543c8e4c8: function(arg0) {
428
+ const ret = getObject(arg0).length;
429
+ return ret;
430
+ },
431
+ __wbg_length_6e821edde497a532: function(arg0) {
432
+ const ret = getObject(arg0).length;
433
+ return ret;
434
+ },
435
+ __wbg_new_0_bfa2ef4bc447daa2: function() {
436
+ const ret = new Date();
437
+ return addHeapObject(ret);
438
+ },
439
+ __wbg_new_0f6d2ddfe083319b: function(arg0) {
440
+ const ret = new Date(getObject(arg0));
441
+ return addHeapObject(ret);
442
+ },
443
+ __wbg_new_227d7c05414eb861: function() {
444
+ const ret = new Error();
445
+ return addHeapObject(ret);
446
+ },
447
+ __wbg_new_4f9fafbb3909af72: function() {
448
+ const ret = new Object();
449
+ return addHeapObject(ret);
450
+ },
451
+ __wbg_new_99cabae501c0a8a0: function() {
452
+ const ret = new Map();
453
+ return addHeapObject(ret);
454
+ },
455
+ __wbg_new_a560378ea1240b14: function(arg0) {
456
+ const ret = new Uint8Array(getObject(arg0));
457
+ return addHeapObject(ret);
458
+ },
459
+ __wbg_new_f3c9df4f38f3f798: function() {
460
+ const ret = new Array();
461
+ return addHeapObject(ret);
462
+ },
463
+ __wbg_next_01132ed6134b8ef5: function(arg0) {
464
+ const ret = getObject(arg0).next;
465
+ return addHeapObject(ret);
466
+ },
467
+ __wbg_next_b3713ec761a9dbfd: function() { return handleError(function (arg0) {
468
+ const ret = getObject(arg0).next();
469
+ return addHeapObject(ret);
470
+ }, arguments); },
471
+ __wbg_now_88621c9c9a4f3ffc: function() {
472
+ const ret = Date.now();
473
+ return ret;
474
+ },
475
+ __wbg_prototypesetcall_3e05eb9545565046: function(arg0, arg1, arg2) {
476
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
477
+ },
478
+ __wbg_set_08463b1df38a7e29: function(arg0, arg1, arg2) {
479
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
480
+ return addHeapObject(ret);
481
+ },
482
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
483
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
484
+ },
485
+ __wbg_set_6c60b2e8ad0e9383: function(arg0, arg1, arg2) {
486
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
487
+ },
488
+ __wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
489
+ const ret = getObject(arg1).stack;
490
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
491
+ const len1 = WASM_VECTOR_LEN;
492
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
493
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
494
+ },
495
+ __wbg_toISOString_dd2b776a2cef739c: function(arg0) {
496
+ const ret = getObject(arg0).toISOString();
497
+ return addHeapObject(ret);
498
+ },
499
+ __wbg_value_7f6052747ccf940f: function(arg0) {
500
+ const ret = getObject(arg0).value;
501
+ return addHeapObject(ret);
502
+ },
503
+ __wbindgen_cast_0000000000000001: function(arg0) {
504
+ // Cast intrinsic for `F64 -> Externref`.
505
+ const ret = arg0;
506
+ return addHeapObject(ret);
507
+ },
508
+ __wbindgen_cast_0000000000000002: function(arg0) {
509
+ // Cast intrinsic for `I64 -> Externref`.
510
+ const ret = arg0;
511
+ return addHeapObject(ret);
512
+ },
513
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
514
+ // Cast intrinsic for `Ref(String) -> Externref`.
515
+ const ret = getStringFromWasm0(arg0, arg1);
516
+ return addHeapObject(ret);
517
+ },
518
+ __wbindgen_cast_0000000000000004: function(arg0) {
519
+ // Cast intrinsic for `U64 -> Externref`.
520
+ const ret = BigInt.asUintN(64, arg0);
521
+ return addHeapObject(ret);
522
+ },
523
+ __wbindgen_object_clone_ref: function(arg0) {
524
+ const ret = getObject(arg0);
525
+ return addHeapObject(ret);
526
+ },
527
+ __wbindgen_object_drop_ref: function(arg0) {
528
+ takeObject(arg0);
529
+ },
530
+ };
531
+ return {
532
+ __proto__: null,
533
+ "./devtools_bg.js": import0,
534
+ };
535
+ }
536
+
537
+ function addHeapObject(obj) {
538
+ if (heap_next === heap.length) heap.push(heap.length + 1);
539
+ const idx = heap_next;
540
+ heap_next = heap[idx];
541
+
542
+ heap[idx] = obj;
543
+ return idx;
544
+ }
545
+
546
+ function debugString(val) {
547
+ // primitive types
548
+ const type = typeof val;
549
+ if (type == 'number' || type == 'boolean' || val == null) {
550
+ return `${val}`;
551
+ }
552
+ if (type == 'string') {
553
+ return `"${val}"`;
554
+ }
555
+ if (type == 'symbol') {
556
+ const description = val.description;
557
+ if (description == null) {
558
+ return 'Symbol';
559
+ } else {
560
+ return `Symbol(${description})`;
561
+ }
562
+ }
563
+ if (type == 'function') {
564
+ const name = val.name;
565
+ if (typeof name == 'string' && name.length > 0) {
566
+ return `Function(${name})`;
567
+ } else {
568
+ return 'Function';
569
+ }
570
+ }
571
+ // objects
572
+ if (Array.isArray(val)) {
573
+ const length = val.length;
574
+ let debug = '[';
575
+ if (length > 0) {
576
+ debug += debugString(val[0]);
577
+ }
578
+ for(let i = 1; i < length; i++) {
579
+ debug += ', ' + debugString(val[i]);
580
+ }
581
+ debug += ']';
582
+ return debug;
583
+ }
584
+ // Test for built-in
585
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
586
+ let className;
587
+ if (builtInMatches && builtInMatches.length > 1) {
588
+ className = builtInMatches[1];
589
+ } else {
590
+ // Failed to match the standard '[object ClassName]'
591
+ return toString.call(val);
592
+ }
593
+ if (className == 'Object') {
594
+ // we're a user defined class or Object
595
+ // JSON.stringify avoids problems with cycles, and is generally much
596
+ // easier than looping through ownProperties of `val`.
597
+ try {
598
+ return 'Object(' + JSON.stringify(val) + ')';
599
+ } catch (_) {
600
+ return 'Object';
601
+ }
602
+ }
603
+ // errors
604
+ if (val instanceof Error) {
605
+ return `${val.name}: ${val.message}\n${val.stack}`;
606
+ }
607
+ // TODO we could test for more things here, like `Set`s and `Map`s.
608
+ return className;
609
+ }
610
+
611
+ function dropObject(idx) {
612
+ if (idx < 1028) return;
613
+ heap[idx] = heap_next;
614
+ heap_next = idx;
615
+ }
616
+
617
+ function getArrayU8FromWasm0(ptr, len) {
618
+ ptr = ptr >>> 0;
619
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
620
+ }
621
+
622
+ let cachedDataViewMemory0 = null;
623
+ function getDataViewMemory0() {
624
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
625
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
626
+ }
627
+ return cachedDataViewMemory0;
628
+ }
629
+
630
+ function getStringFromWasm0(ptr, len) {
631
+ ptr = ptr >>> 0;
632
+ return decodeText(ptr, len);
633
+ }
634
+
635
+ let cachedUint8ArrayMemory0 = null;
636
+ function getUint8ArrayMemory0() {
637
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
638
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
639
+ }
640
+ return cachedUint8ArrayMemory0;
641
+ }
642
+
643
+ function getObject(idx) { return heap[idx]; }
644
+
645
+ function handleError(f, args) {
646
+ try {
647
+ return f.apply(this, args);
648
+ } catch (e) {
649
+ wasm.__wbindgen_export3(addHeapObject(e));
650
+ }
651
+ }
652
+
653
+ let heap = new Array(1024).fill(undefined);
654
+ heap.push(undefined, null, true, false);
655
+
656
+ let heap_next = heap.length;
657
+
658
+ function isLikeNone(x) {
659
+ return x === undefined || x === null;
660
+ }
661
+
662
+ function passStringToWasm0(arg, malloc, realloc) {
663
+ if (realloc === undefined) {
664
+ const buf = cachedTextEncoder.encode(arg);
665
+ const ptr = malloc(buf.length, 1) >>> 0;
666
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
667
+ WASM_VECTOR_LEN = buf.length;
668
+ return ptr;
669
+ }
670
+
671
+ let len = arg.length;
672
+ let ptr = malloc(len, 1) >>> 0;
673
+
674
+ const mem = getUint8ArrayMemory0();
675
+
676
+ let offset = 0;
677
+
678
+ for (; offset < len; offset++) {
679
+ const code = arg.charCodeAt(offset);
680
+ if (code > 0x7F) break;
681
+ mem[ptr + offset] = code;
682
+ }
683
+ if (offset !== len) {
684
+ if (offset !== 0) {
685
+ arg = arg.slice(offset);
686
+ }
687
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
688
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
689
+ const ret = cachedTextEncoder.encodeInto(arg, view);
690
+
691
+ offset += ret.written;
692
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
693
+ }
694
+
695
+ WASM_VECTOR_LEN = offset;
696
+ return ptr;
697
+ }
698
+
699
+ function takeObject(idx) {
700
+ const ret = getObject(idx);
701
+ dropObject(idx);
702
+ return ret;
703
+ }
704
+
705
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
706
+ cachedTextDecoder.decode();
707
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
708
+ let numBytesDecoded = 0;
709
+ function decodeText(ptr, len) {
710
+ numBytesDecoded += len;
711
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
712
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
713
+ cachedTextDecoder.decode();
714
+ numBytesDecoded = len;
715
+ }
716
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
717
+ }
718
+
719
+ const cachedTextEncoder = new TextEncoder();
720
+
721
+ if (!('encodeInto' in cachedTextEncoder)) {
722
+ cachedTextEncoder.encodeInto = function (arg, view) {
723
+ const buf = cachedTextEncoder.encode(arg);
724
+ view.set(buf);
725
+ return {
726
+ read: arg.length,
727
+ written: buf.length
728
+ };
729
+ };
730
+ }
731
+
732
+ let WASM_VECTOR_LEN = 0;
733
+
734
+ let wasmModule, wasm;
735
+ function __wbg_finalize_init(instance, module) {
736
+ wasm = instance.exports;
737
+ wasmModule = module;
738
+ cachedDataViewMemory0 = null;
739
+ cachedUint8ArrayMemory0 = null;
740
+ wasm.__wbindgen_start();
741
+ return wasm;
742
+ }
743
+
744
+ async function __wbg_load(module, imports) {
745
+ if (typeof Response === 'function' && module instanceof Response) {
746
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
747
+ try {
748
+ return await WebAssembly.instantiateStreaming(module, imports);
749
+ } catch (e) {
750
+ const validResponse = module.ok && expectedResponseType(module.type);
751
+
752
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
753
+ 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);
754
+
755
+ } else { throw e; }
756
+ }
757
+ }
758
+
759
+ const bytes = await module.arrayBuffer();
760
+ return await WebAssembly.instantiate(bytes, imports);
761
+ } else {
762
+ const instance = await WebAssembly.instantiate(module, imports);
763
+
764
+ if (instance instanceof WebAssembly.Instance) {
765
+ return { instance, module };
766
+ } else {
767
+ return instance;
768
+ }
769
+ }
770
+
771
+ function expectedResponseType(type) {
772
+ switch (type) {
773
+ case 'basic': case 'cors': case 'default': return true;
774
+ }
775
+ return false;
776
+ }
777
+ }
778
+
779
+ function initSync(module) {
780
+ if (wasm !== undefined) return wasm;
781
+
782
+
783
+ if (module !== undefined) {
784
+ if (Object.getPrototypeOf(module) === Object.prototype) {
785
+ ({module} = module)
786
+ } else {
787
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
788
+ }
789
+ }
790
+
791
+ const imports = __wbg_get_imports();
792
+ if (!(module instanceof WebAssembly.Module)) {
793
+ module = new WebAssembly.Module(module);
794
+ }
795
+ const instance = new WebAssembly.Instance(module, imports);
796
+ return __wbg_finalize_init(instance, module);
797
+ }
798
+
799
+ async function __wbg_init(module_or_path) {
800
+ if (wasm !== undefined) return wasm;
801
+
802
+
803
+ if (module_or_path !== undefined) {
804
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
805
+ ({module_or_path} = module_or_path)
806
+ } else {
807
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
808
+ }
809
+ }
810
+
811
+ if (module_or_path === undefined) {
812
+ module_or_path = new URL('devtools_bg.wasm', import.meta.url);
813
+ }
814
+ const imports = __wbg_get_imports();
815
+
816
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
817
+ module_or_path = fetch(module_or_path);
818
+ }
819
+
820
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
821
+
822
+ return __wbg_finalize_init(instance, module);
823
+ }
824
+
825
+ export { initSync, __wbg_init as default };
Binary file
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@ajitems/devtools",
3
+ "type": "module",
4
+ "collaborators": [
5
+ "Ajitem Sahasrabuddhe"
6
+ ],
7
+ "description": "Headless engines for common developer utilities. Compiled to WASM.",
8
+ "version": "0.1.0",
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/asahasrabuddhe/devtools"
13
+ },
14
+ "files": [
15
+ "devtools_bg.wasm",
16
+ "devtools.js",
17
+ "devtools.d.ts"
18
+ ],
19
+ "main": "devtools.js",
20
+ "types": "devtools.d.ts",
21
+ "sideEffects": [
22
+ "./snippets/*"
23
+ ]
24
+ }