@ferrflow/wasm 2.2.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,12 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export function build_changelog_section(version: string, commits_json: string): string;
5
+
6
+ export function compute_next_version(current: string, bump: string, strategy: string): string;
7
+
8
+ export function determine_bump(message: string): string;
9
+
10
+ export function serialize_config(config_json: string, format: string): string;
11
+
12
+ export function validate_config(config_json: string): string;
@@ -0,0 +1,9 @@
1
+ /* @ts-self-types="./ferrflow_wasm.d.ts" */
2
+
3
+ import * as wasm from "./ferrflow_wasm_bg.wasm";
4
+ import { __wbg_set_wasm } from "./ferrflow_wasm_bg.js";
5
+ __wbg_set_wasm(wasm);
6
+ wasm.__wbindgen_start();
7
+ export {
8
+ build_changelog_section, compute_next_version, determine_bump, serialize_config, validate_config
9
+ } from "./ferrflow_wasm_bg.js";
@@ -0,0 +1,251 @@
1
+ /**
2
+ * @param {string} version
3
+ * @param {string} commits_json
4
+ * @returns {string}
5
+ */
6
+ export function build_changelog_section(version, commits_json) {
7
+ let deferred4_0;
8
+ let deferred4_1;
9
+ try {
10
+ const ptr0 = passStringToWasm0(version, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11
+ const len0 = WASM_VECTOR_LEN;
12
+ const ptr1 = passStringToWasm0(commits_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
13
+ const len1 = WASM_VECTOR_LEN;
14
+ const ret = wasm.build_changelog_section(ptr0, len0, ptr1, len1);
15
+ var ptr3 = ret[0];
16
+ var len3 = ret[1];
17
+ if (ret[3]) {
18
+ ptr3 = 0; len3 = 0;
19
+ throw takeFromExternrefTable0(ret[2]);
20
+ }
21
+ deferred4_0 = ptr3;
22
+ deferred4_1 = len3;
23
+ return getStringFromWasm0(ptr3, len3);
24
+ } finally {
25
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
26
+ }
27
+ }
28
+
29
+ /**
30
+ * @param {string} current
31
+ * @param {string} bump
32
+ * @param {string} strategy
33
+ * @returns {string}
34
+ */
35
+ export function compute_next_version(current, bump, strategy) {
36
+ let deferred5_0;
37
+ let deferred5_1;
38
+ try {
39
+ const ptr0 = passStringToWasm0(current, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
40
+ const len0 = WASM_VECTOR_LEN;
41
+ const ptr1 = passStringToWasm0(bump, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
42
+ const len1 = WASM_VECTOR_LEN;
43
+ const ptr2 = passStringToWasm0(strategy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
44
+ const len2 = WASM_VECTOR_LEN;
45
+ const ret = wasm.compute_next_version(ptr0, len0, ptr1, len1, ptr2, len2);
46
+ var ptr4 = ret[0];
47
+ var len4 = ret[1];
48
+ if (ret[3]) {
49
+ ptr4 = 0; len4 = 0;
50
+ throw takeFromExternrefTable0(ret[2]);
51
+ }
52
+ deferred5_0 = ptr4;
53
+ deferred5_1 = len4;
54
+ return getStringFromWasm0(ptr4, len4);
55
+ } finally {
56
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
57
+ }
58
+ }
59
+
60
+ /**
61
+ * @param {string} message
62
+ * @returns {string}
63
+ */
64
+ export function determine_bump(message) {
65
+ let deferred2_0;
66
+ let deferred2_1;
67
+ try {
68
+ const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
69
+ const len0 = WASM_VECTOR_LEN;
70
+ const ret = wasm.determine_bump(ptr0, len0);
71
+ deferred2_0 = ret[0];
72
+ deferred2_1 = ret[1];
73
+ return getStringFromWasm0(ret[0], ret[1]);
74
+ } finally {
75
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
76
+ }
77
+ }
78
+
79
+ /**
80
+ * @param {string} config_json
81
+ * @param {string} format
82
+ * @returns {string}
83
+ */
84
+ export function serialize_config(config_json, format) {
85
+ let deferred4_0;
86
+ let deferred4_1;
87
+ try {
88
+ const ptr0 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
89
+ const len0 = WASM_VECTOR_LEN;
90
+ const ptr1 = passStringToWasm0(format, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
91
+ const len1 = WASM_VECTOR_LEN;
92
+ const ret = wasm.serialize_config(ptr0, len0, ptr1, len1);
93
+ var ptr3 = ret[0];
94
+ var len3 = ret[1];
95
+ if (ret[3]) {
96
+ ptr3 = 0; len3 = 0;
97
+ throw takeFromExternrefTable0(ret[2]);
98
+ }
99
+ deferred4_0 = ptr3;
100
+ deferred4_1 = len3;
101
+ return getStringFromWasm0(ptr3, len3);
102
+ } finally {
103
+ wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
104
+ }
105
+ }
106
+
107
+ /**
108
+ * @param {string} config_json
109
+ * @returns {string}
110
+ */
111
+ export function validate_config(config_json) {
112
+ let deferred2_0;
113
+ let deferred2_1;
114
+ try {
115
+ const ptr0 = passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
116
+ const len0 = WASM_VECTOR_LEN;
117
+ const ret = wasm.validate_config(ptr0, len0);
118
+ deferred2_0 = ret[0];
119
+ deferred2_1 = ret[1];
120
+ return getStringFromWasm0(ret[0], ret[1]);
121
+ } finally {
122
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
123
+ }
124
+ }
125
+ export function __wbg_Error_55538483de6e3abe(arg0, arg1) {
126
+ const ret = Error(getStringFromWasm0(arg0, arg1));
127
+ return ret;
128
+ }
129
+ export function __wbg___wbindgen_throw_5549492daedad139(arg0, arg1) {
130
+ throw new Error(getStringFromWasm0(arg0, arg1));
131
+ }
132
+ export function __wbg_getTime_c3af35594e283356(arg0) {
133
+ const ret = arg0.getTime();
134
+ return ret;
135
+ }
136
+ export function __wbg_getTimezoneOffset_c60f1a836e59b3db(arg0) {
137
+ const ret = arg0.getTimezoneOffset();
138
+ return ret;
139
+ }
140
+ export function __wbg_new_0_e649c99e7382313f() {
141
+ const ret = new Date();
142
+ return ret;
143
+ }
144
+ export function __wbg_new_d51bf22e953dcfd1(arg0) {
145
+ const ret = new Date(arg0);
146
+ return ret;
147
+ }
148
+ export function __wbindgen_cast_0000000000000001(arg0) {
149
+ // Cast intrinsic for `F64 -> Externref`.
150
+ const ret = arg0;
151
+ return ret;
152
+ }
153
+ export function __wbindgen_init_externref_table() {
154
+ const table = wasm.__wbindgen_externrefs;
155
+ const offset = table.grow(4);
156
+ table.set(0, undefined);
157
+ table.set(offset + 0, undefined);
158
+ table.set(offset + 1, null);
159
+ table.set(offset + 2, true);
160
+ table.set(offset + 3, false);
161
+ }
162
+ function getStringFromWasm0(ptr, len) {
163
+ ptr = ptr >>> 0;
164
+ return decodeText(ptr, len);
165
+ }
166
+
167
+ let cachedUint8ArrayMemory0 = null;
168
+ function getUint8ArrayMemory0() {
169
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
170
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
171
+ }
172
+ return cachedUint8ArrayMemory0;
173
+ }
174
+
175
+ function passStringToWasm0(arg, malloc, realloc) {
176
+ if (realloc === undefined) {
177
+ const buf = cachedTextEncoder.encode(arg);
178
+ const ptr = malloc(buf.length, 1) >>> 0;
179
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
180
+ WASM_VECTOR_LEN = buf.length;
181
+ return ptr;
182
+ }
183
+
184
+ let len = arg.length;
185
+ let ptr = malloc(len, 1) >>> 0;
186
+
187
+ const mem = getUint8ArrayMemory0();
188
+
189
+ let offset = 0;
190
+
191
+ for (; offset < len; offset++) {
192
+ const code = arg.charCodeAt(offset);
193
+ if (code > 0x7F) break;
194
+ mem[ptr + offset] = code;
195
+ }
196
+ if (offset !== len) {
197
+ if (offset !== 0) {
198
+ arg = arg.slice(offset);
199
+ }
200
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
201
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
202
+ const ret = cachedTextEncoder.encodeInto(arg, view);
203
+
204
+ offset += ret.written;
205
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
206
+ }
207
+
208
+ WASM_VECTOR_LEN = offset;
209
+ return ptr;
210
+ }
211
+
212
+ function takeFromExternrefTable0(idx) {
213
+ const value = wasm.__wbindgen_externrefs.get(idx);
214
+ wasm.__externref_table_dealloc(idx);
215
+ return value;
216
+ }
217
+
218
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
219
+ cachedTextDecoder.decode();
220
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
221
+ let numBytesDecoded = 0;
222
+ function decodeText(ptr, len) {
223
+ numBytesDecoded += len;
224
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
225
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
226
+ cachedTextDecoder.decode();
227
+ numBytesDecoded = len;
228
+ }
229
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
230
+ }
231
+
232
+ const cachedTextEncoder = new TextEncoder();
233
+
234
+ if (!('encodeInto' in cachedTextEncoder)) {
235
+ cachedTextEncoder.encodeInto = function (arg, view) {
236
+ const buf = cachedTextEncoder.encode(arg);
237
+ view.set(buf);
238
+ return {
239
+ read: arg.length,
240
+ written: buf.length
241
+ };
242
+ };
243
+ }
244
+
245
+ let WASM_VECTOR_LEN = 0;
246
+
247
+
248
+ let wasm;
249
+ export function __wbg_set_wasm(val) {
250
+ wasm = val;
251
+ }
Binary file
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@ferrflow/wasm",
3
+ "type": "module",
4
+ "description": "FerrFlow core functions compiled to WebAssembly",
5
+ "version": "2.2.0",
6
+ "license": "MPL-2.0",
7
+ "files": [
8
+ "ferrflow_wasm_bg.wasm",
9
+ "ferrflow_wasm.js",
10
+ "ferrflow_wasm_bg.js",
11
+ "ferrflow_wasm.d.ts"
12
+ ],
13
+ "main": "ferrflow_wasm.js",
14
+ "types": "ferrflow_wasm.d.ts",
15
+ "sideEffects": [
16
+ "./ferrflow_wasm.js",
17
+ "./snippets/*"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/FerrFlow-Org/FerrFlow.git",
22
+ "directory": "ferrflow-wasm"
23
+ },
24
+ "homepage": "https://ferrflow.com"
25
+ }