@flock/wirespec 0.11.9 → 0.12.2
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/arrow-arrow-annotations.mjs +4 -0
- package/{kotlinx-io-kotlinx-io-bytestring.js.map → arrow-arrow-annotations.mjs.map} +1 -1
- package/arrow-arrow-atomic.mjs +43 -0
- package/arrow-arrow-atomic.mjs.map +1 -0
- package/arrow-arrow-continuations.mjs +18 -0
- package/{kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map → arrow-arrow-continuations.mjs.map} +1 -1
- package/arrow-arrow-core.mjs +532 -0
- package/arrow-arrow-core.mjs.map +1 -0
- package/clikt-clikt.mjs +6648 -0
- package/clikt-clikt.mjs.map +1 -0
- package/colormath-root-colormath.mjs +1696 -0
- package/colormath-root-colormath.mjs.map +1 -0
- package/kotlin-kotlin-stdlib.mjs +13106 -0
- package/kotlin-kotlin-stdlib.mjs.map +1 -0
- package/kotlin-openapi-bindings.mjs +13769 -0
- package/kotlin-openapi-bindings.mjs.map +1 -0
- package/kotlin-rgxgen.mjs +4298 -0
- package/kotlin-rgxgen.mjs.map +1 -0
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs +4 -0
- package/{arrow-arrow-annotations.js.map → kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map} +1 -1
- package/kotlinx-io-kotlinx-io-bytestring.mjs +4 -0
- package/{kotlin-kotlin-test.js.map → kotlinx-io-kotlinx-io-bytestring.mjs.map} +1 -1
- package/kotlinx-io-kotlinx-io-core.mjs +2201 -0
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -0
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +5880 -0
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -0
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +5109 -0
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
- package/markdown.mjs +6753 -0
- package/markdown.mjs.map +1 -0
- package/mordant-mordant.mjs +11839 -0
- package/mordant-mordant.mjs.map +1 -0
- package/package.json +4 -6
- package/wirespec-bin.mjs +18 -0
- package/wirespec-src-compiler-core.mjs +8313 -0
- package/wirespec-src-compiler-core.mjs.map +1 -0
- package/wirespec-src-compiler-lib.mjs +2565 -0
- package/wirespec-src-compiler-lib.mjs.map +1 -0
- package/wirespec-src-converter-avro.mjs +1933 -0
- package/wirespec-src-converter-avro.mjs.map +1 -0
- package/wirespec-src-converter-openapi.mjs +5301 -0
- package/wirespec-src-converter-openapi.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +587 -0
- package/wirespec-src-plugin-arguments.mjs.map +1 -0
- package/wirespec-src-plugin-cli.mjs +1487 -0
- package/wirespec-src-plugin-cli.mjs.map +1 -0
- package/wirespec-src-plugin-npm.d.ts +485 -466
- package/wirespec-src-plugin-npm.mjs +622 -0
- package/wirespec-src-plugin-npm.mjs.map +1 -0
- package/wirespec-src-tools-generator.mjs +284 -0
- package/wirespec-src-tools-generator.mjs.map +1 -0
- package/arrow-arrow-annotations.js +0 -15
- package/arrow-arrow-atomic.js +0 -55
- package/arrow-arrow-atomic.js.map +0 -1
- package/arrow-arrow-continuations.js +0 -30
- package/arrow-arrow-continuations.js.map +0 -1
- package/arrow-arrow-core.js +0 -410
- package/arrow-arrow-core.js.map +0 -1
- package/clikt-clikt.js +0 -6713
- package/clikt-clikt.js.map +0 -1
- package/colormath-root-colormath.js +0 -1727
- package/colormath-root-colormath.js.map +0 -1
- package/kotlin-kotlin-stdlib.js +0 -13263
- package/kotlin-kotlin-stdlib.js.map +0 -1
- package/kotlin-kotlin-test.js +0 -15
- package/kotlin-openapi-bindings.js +0 -13787
- package/kotlin-openapi-bindings.js.map +0 -1
- package/kotlin-rgxgen.js +0 -4315
- package/kotlin-rgxgen.js.map +0 -1
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +0 -15
- package/kotlinx-io-kotlinx-io-bytestring.js +0 -15
- package/kotlinx-io-kotlinx-io-core.js +0 -2219
- package/kotlinx-io-kotlinx-io-core.js.map +0 -1
- package/kotlinx-serialization-kotlinx-serialization-core.js +0 -5914
- package/kotlinx-serialization-kotlinx-serialization-core.js.map +0 -1
- package/kotlinx-serialization-kotlinx-serialization-json.js +0 -5126
- package/kotlinx-serialization-kotlinx-serialization-json.js.map +0 -1
- package/markdown.js +0 -6768
- package/markdown.js.map +0 -1
- package/mordant-mordant.js +0 -11981
- package/mordant-mordant.js.map +0 -1
- package/resources-library.js +0 -15
- package/resources-library.js.map +0 -1
- package/wirespec-bin.js +0 -3
- package/wirespec-src-compiler-core.js +0 -7894
- package/wirespec-src-compiler-core.js.map +0 -1
- package/wirespec-src-compiler-lib.js +0 -2603
- package/wirespec-src-compiler-lib.js.map +0 -1
- package/wirespec-src-converter-avro.js +0 -1650
- package/wirespec-src-converter-avro.js.map +0 -1
- package/wirespec-src-converter-openapi.js +0 -5366
- package/wirespec-src-converter-openapi.js.map +0 -1
- package/wirespec-src-plugin-arguments.js +0 -640
- package/wirespec-src-plugin-arguments.js.map +0 -1
- package/wirespec-src-plugin-cli.js +0 -1222
- package/wirespec-src-plugin-cli.js.map +0 -1
- package/wirespec-src-plugin-npm.js +0 -480
- package/wirespec-src-plugin-npm.js.map +0 -1
- package/wirespec-src-tools-generator.js +0 -306
- package/wirespec-src-tools-generator.js.map +0 -1
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof define === 'function' && define.amd)
|
|
3
|
-
define(['exports', './kotlin-kotlin-stdlib.js', './wirespec-src-compiler-core.js', './kotlinx-serialization-kotlinx-serialization-json.js', './kotlin-rgxgen.js'], factory);
|
|
4
|
-
else if (typeof exports === 'object')
|
|
5
|
-
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./wirespec-src-compiler-core.js'), require('./kotlinx-serialization-kotlinx-serialization-json.js'), require('./kotlin-rgxgen.js'));
|
|
6
|
-
else {
|
|
7
|
-
if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
|
|
8
|
-
throw new Error("Error loading module 'wirespec-src-tools-generator'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'wirespec-src-tools-generator'.");
|
|
9
|
-
}
|
|
10
|
-
if (typeof globalThis['wirespec-src-compiler-core'] === 'undefined') {
|
|
11
|
-
throw new Error("Error loading module 'wirespec-src-tools-generator'. Its dependency 'wirespec-src-compiler-core' was not found. Please, check whether 'wirespec-src-compiler-core' is loaded prior to 'wirespec-src-tools-generator'.");
|
|
12
|
-
}
|
|
13
|
-
if (typeof globalThis['kotlinx-serialization-kotlinx-serialization-json'] === 'undefined') {
|
|
14
|
-
throw new Error("Error loading module 'wirespec-src-tools-generator'. Its dependency 'kotlinx-serialization-kotlinx-serialization-json' was not found. Please, check whether 'kotlinx-serialization-kotlinx-serialization-json' is loaded prior to 'wirespec-src-tools-generator'.");
|
|
15
|
-
}
|
|
16
|
-
if (typeof globalThis['kotlin-rgxgen'] === 'undefined') {
|
|
17
|
-
throw new Error("Error loading module 'wirespec-src-tools-generator'. Its dependency 'kotlin-rgxgen' was not found. Please, check whether 'kotlin-rgxgen' is loaded prior to 'wirespec-src-tools-generator'.");
|
|
18
|
-
}
|
|
19
|
-
globalThis['wirespec-src-tools-generator'] = factory(typeof globalThis['wirespec-src-tools-generator'] === 'undefined' ? {} : globalThis['wirespec-src-tools-generator'], globalThis['kotlin-kotlin-stdlib'], globalThis['wirespec-src-compiler-core'], globalThis['kotlinx-serialization-kotlinx-serialization-json'], globalThis['kotlin-rgxgen']);
|
|
20
|
-
}
|
|
21
|
-
}(function (_, kotlin_kotlin, kotlin_community_flock_wirespec_compiler_core, kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json, kotlin_community_flock_kotlinx_rgxgen_kotlin_rgxgen) {
|
|
22
|
-
'use strict';
|
|
23
|
-
//region block: imports
|
|
24
|
-
var Default_getInstance = kotlin_kotlin.$_$.a4;
|
|
25
|
-
var VOID = kotlin_kotlin.$_$.g;
|
|
26
|
-
var removeSuffix = kotlin_kotlin.$_$.ld;
|
|
27
|
-
var Custom = kotlin_community_flock_wirespec_compiler_core.$_$.x;
|
|
28
|
-
var Iterable = kotlin_community_flock_wirespec_compiler_core.$_$.z;
|
|
29
|
-
var endsWith = kotlin_kotlin.$_$.sc;
|
|
30
|
-
var noWhenBranchMatchedException = kotlin_kotlin.$_$.kg;
|
|
31
|
-
var NotImplementedError = kotlin_kotlin.$_$.jf;
|
|
32
|
-
var Any = kotlin_community_flock_wirespec_compiler_core.$_$.w;
|
|
33
|
-
var JsonNull_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.c;
|
|
34
|
-
var Unit = kotlin_community_flock_wirespec_compiler_core.$_$.g1;
|
|
35
|
-
var Companion_instance = kotlin_community_flock_kotlinx_rgxgen_kotlin_rgxgen.$_$.a;
|
|
36
|
-
var JsonPrimitive = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.h;
|
|
37
|
-
var JsonPrimitive_0 = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.j;
|
|
38
|
-
var Boolean_0 = kotlin_community_flock_wirespec_compiler_core.$_$.a1;
|
|
39
|
-
var JsonPrimitive_1 = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.i;
|
|
40
|
-
var Number_0 = kotlin_community_flock_wirespec_compiler_core.$_$.d1;
|
|
41
|
-
var Integer = kotlin_community_flock_wirespec_compiler_core.$_$.c1;
|
|
42
|
-
var Primitive = kotlin_community_flock_wirespec_compiler_core.$_$.f1;
|
|
43
|
-
var Dict = kotlin_community_flock_wirespec_compiler_core.$_$.y;
|
|
44
|
-
var numberRangeToNumber = kotlin_kotlin.$_$.wa;
|
|
45
|
-
var collectionSizeOrDefault = kotlin_kotlin.$_$.n5;
|
|
46
|
-
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.k;
|
|
47
|
-
var Unit_instance = kotlin_kotlin.$_$.l4;
|
|
48
|
-
var JsonArray = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.e;
|
|
49
|
-
var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.l;
|
|
50
|
-
var Definition = kotlin_community_flock_wirespec_compiler_core.$_$.l;
|
|
51
|
-
var isInterface = kotlin_kotlin.$_$.ra;
|
|
52
|
-
var toString = kotlin_kotlin.$_$.gb;
|
|
53
|
-
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.p1;
|
|
54
|
-
var Channel = kotlin_community_flock_wirespec_compiler_core.$_$.i;
|
|
55
|
-
var Endpoint = kotlin_community_flock_wirespec_compiler_core.$_$.s;
|
|
56
|
-
var Union = kotlin_community_flock_wirespec_compiler_core.$_$.l1;
|
|
57
|
-
var Enum = kotlin_community_flock_wirespec_compiler_core.$_$.t;
|
|
58
|
-
var Refined = kotlin_community_flock_wirespec_compiler_core.$_$.i1;
|
|
59
|
-
var Type = kotlin_community_flock_wirespec_compiler_core.$_$.k1;
|
|
60
|
-
var emptyMap = kotlin_kotlin.$_$.h6;
|
|
61
|
-
var charSequenceLength = kotlin_kotlin.$_$.s9;
|
|
62
|
-
var charSequenceGet = kotlin_kotlin.$_$.r9;
|
|
63
|
-
var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.d2;
|
|
64
|
-
var Random = kotlin_kotlin.$_$.jb;
|
|
65
|
-
var to = kotlin_kotlin.$_$.ng;
|
|
66
|
-
var plus = kotlin_kotlin.$_$.w7;
|
|
67
|
-
var JsonObject = kotlin_org_jetbrains_kotlinx_kotlinx_serialization_json.$_$.g;
|
|
68
|
-
var toList = kotlin_kotlin.$_$.q8;
|
|
69
|
-
//endregion
|
|
70
|
-
//region block: pre-declaration
|
|
71
|
-
//endregion
|
|
72
|
-
function generate(_this__u8e3s4, type, random) {
|
|
73
|
-
random = random === VOID ? Default_getInstance() : random;
|
|
74
|
-
// Inline function 'kotlin.let' call
|
|
75
|
-
// Inline function 'kotlin.let' call
|
|
76
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
77
|
-
// Inline function 'community.flock.wirespec.generator.generate.<anonymous>' call
|
|
78
|
-
var it = new Custom(removeSuffix(type, '[]'), false);
|
|
79
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
80
|
-
// Inline function 'community.flock.wirespec.generator.generate.<anonymous>' call
|
|
81
|
-
var it_0 = endsWith(type, '[]') ? new Iterable(it, false) : it;
|
|
82
|
-
return generate_0(_this__u8e3s4, it_0, random);
|
|
83
|
-
}
|
|
84
|
-
function generate_0(_this__u8e3s4, type, random) {
|
|
85
|
-
random = random === VOID ? Default_getInstance() : random;
|
|
86
|
-
return generateReference(_this__u8e3s4, type, random);
|
|
87
|
-
}
|
|
88
|
-
function generateReference(_this__u8e3s4, ref, random) {
|
|
89
|
-
var tmp;
|
|
90
|
-
if (ref instanceof Dict) {
|
|
91
|
-
throw new NotImplementedError();
|
|
92
|
-
} else {
|
|
93
|
-
if (ref instanceof Iterable) {
|
|
94
|
-
tmp = generateIterator(_this__u8e3s4, resolveReference(_this__u8e3s4, ref.x25_1), random);
|
|
95
|
-
} else {
|
|
96
|
-
if (ref instanceof Primitive) {
|
|
97
|
-
var tmp1_subject = ref.g23_1;
|
|
98
|
-
var tmp_0;
|
|
99
|
-
if (tmp1_subject instanceof Integer) {
|
|
100
|
-
// Inline function 'kotlin.let' call
|
|
101
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
102
|
-
var p0 = random.ee();
|
|
103
|
-
tmp_0 = JsonPrimitive_1(p0);
|
|
104
|
-
} else {
|
|
105
|
-
if (tmp1_subject instanceof Number_0) {
|
|
106
|
-
// Inline function 'kotlin.let' call
|
|
107
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
108
|
-
var p0_0 = random.uf();
|
|
109
|
-
tmp_0 = JsonPrimitive_1(p0_0);
|
|
110
|
-
} else {
|
|
111
|
-
if (tmp1_subject instanceof Boolean_0) {
|
|
112
|
-
// Inline function 'kotlin.let' call
|
|
113
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
114
|
-
var p0_1 = random.tf();
|
|
115
|
-
tmp_0 = JsonPrimitive_0(p0_1);
|
|
116
|
-
} else {
|
|
117
|
-
// Inline function 'kotlin.let' call
|
|
118
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
119
|
-
var p0_2 = Companion_instance.y4b('\\w{1,50}').h4c(random);
|
|
120
|
-
tmp_0 = JsonPrimitive(p0_2);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
tmp = tmp_0;
|
|
125
|
-
} else {
|
|
126
|
-
if (ref instanceof Custom) {
|
|
127
|
-
tmp = generateObject(_this__u8e3s4, resolveReference(_this__u8e3s4, ref), random);
|
|
128
|
-
} else {
|
|
129
|
-
if (ref instanceof Unit) {
|
|
130
|
-
tmp = JsonNull_getInstance();
|
|
131
|
-
} else {
|
|
132
|
-
if (ref instanceof Any) {
|
|
133
|
-
throw new NotImplementedError('Cannot generate Any');
|
|
134
|
-
} else {
|
|
135
|
-
noWhenBranchMatchedException();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return tmp;
|
|
143
|
-
}
|
|
144
|
-
function generateIterator(_this__u8e3s4, def, random) {
|
|
145
|
-
// Inline function 'kotlin.let' call
|
|
146
|
-
// Inline function 'kotlin.collections.map' call
|
|
147
|
-
var this_0 = numberRangeToNumber(0, random.rf(10));
|
|
148
|
-
// Inline function 'kotlin.collections.mapTo' call
|
|
149
|
-
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
150
|
-
var inductionVariable = this_0.d1_1;
|
|
151
|
-
var last = this_0.e1_1;
|
|
152
|
-
if (inductionVariable <= last)
|
|
153
|
-
do {
|
|
154
|
-
var item = inductionVariable;
|
|
155
|
-
inductionVariable = inductionVariable + 1 | 0;
|
|
156
|
-
// Inline function 'community.flock.wirespec.generator.generateIterator.<anonymous>' call
|
|
157
|
-
var tmp$ret$0 = generateObject(_this__u8e3s4, def, random);
|
|
158
|
-
destination.e(tmp$ret$0);
|
|
159
|
-
}
|
|
160
|
-
while (!(item === last));
|
|
161
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
162
|
-
return new JsonArray(destination);
|
|
163
|
-
}
|
|
164
|
-
function resolveReference(_this__u8e3s4, type) {
|
|
165
|
-
// Inline function 'kotlin.collections.find' call
|
|
166
|
-
// Inline function 'kotlin.collections.filterIsInstance' call
|
|
167
|
-
// Inline function 'kotlin.collections.filterIsInstanceTo' call
|
|
168
|
-
var destination = ArrayList_init_$Create$_0();
|
|
169
|
-
var tmp0_iterator = _this__u8e3s4.g();
|
|
170
|
-
while (tmp0_iterator.h()) {
|
|
171
|
-
var element = tmp0_iterator.i();
|
|
172
|
-
if (!(element == null) ? isInterface(element, Definition) : false) {
|
|
173
|
-
destination.e(element);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
var tmp$ret$3;
|
|
177
|
-
$l$block: {
|
|
178
|
-
// Inline function 'kotlin.collections.firstOrNull' call
|
|
179
|
-
var tmp0_iterator_0 = destination.g();
|
|
180
|
-
while (tmp0_iterator_0.h()) {
|
|
181
|
-
var element_0 = tmp0_iterator_0.i();
|
|
182
|
-
// Inline function 'community.flock.wirespec.generator.resolveReference.<anonymous>' call
|
|
183
|
-
if (element_0.v28().b1() === type.b1()) {
|
|
184
|
-
tmp$ret$3 = element_0;
|
|
185
|
-
break $l$block;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
tmp$ret$3 = null;
|
|
189
|
-
}
|
|
190
|
-
var tmp0_elvis_lhs = tmp$ret$3;
|
|
191
|
-
var tmp;
|
|
192
|
-
if (tmp0_elvis_lhs == null) {
|
|
193
|
-
var message = 'Definition not found in AST: ' + toString(type);
|
|
194
|
-
throw IllegalStateException_init_$Create$(toString(message));
|
|
195
|
-
} else {
|
|
196
|
-
tmp = tmp0_elvis_lhs;
|
|
197
|
-
}
|
|
198
|
-
return tmp;
|
|
199
|
-
}
|
|
200
|
-
function generateObject(_this__u8e3s4, def, random) {
|
|
201
|
-
var tmp;
|
|
202
|
-
if (def instanceof Type) {
|
|
203
|
-
tmp = generateType(_this__u8e3s4, def, random);
|
|
204
|
-
} else {
|
|
205
|
-
if (def instanceof Refined) {
|
|
206
|
-
tmp = generateRefined(def, random);
|
|
207
|
-
} else {
|
|
208
|
-
if (def instanceof Enum) {
|
|
209
|
-
tmp = generateEnum(def, random);
|
|
210
|
-
} else {
|
|
211
|
-
if (def instanceof Union) {
|
|
212
|
-
tmp = generateUnion(_this__u8e3s4, def, random);
|
|
213
|
-
} else {
|
|
214
|
-
if (def instanceof Endpoint) {
|
|
215
|
-
throw new NotImplementedError('Endpoint cannot be generated');
|
|
216
|
-
} else {
|
|
217
|
-
if (def instanceof Channel) {
|
|
218
|
-
throw new NotImplementedError('Channel cannot be generated');
|
|
219
|
-
} else {
|
|
220
|
-
noWhenBranchMatchedException();
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
return tmp;
|
|
228
|
-
}
|
|
229
|
-
function generateType(_this__u8e3s4, def, random) {
|
|
230
|
-
// Inline function 'kotlin.let' call
|
|
231
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
232
|
-
// Inline function 'community.flock.wirespec.generator.generateType.<anonymous>' call
|
|
233
|
-
var typeSeed = random.ee();
|
|
234
|
-
// Inline function 'kotlin.let' call
|
|
235
|
-
// Inline function 'kotlin.collections.fold' call
|
|
236
|
-
var this_0 = def.e25_1.w25_1;
|
|
237
|
-
var accumulator = emptyMap();
|
|
238
|
-
var tmp0_iterator = this_0.g();
|
|
239
|
-
while (tmp0_iterator.h()) {
|
|
240
|
-
var element = tmp0_iterator.i();
|
|
241
|
-
// Inline function 'community.flock.wirespec.generator.generateType.<anonymous>.<anonymous>' call
|
|
242
|
-
var acc = accumulator;
|
|
243
|
-
// Inline function 'kotlin.let' call
|
|
244
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
245
|
-
// Inline function 'community.flock.wirespec.generator.generateType.<anonymous>.<anonymous>.<anonymous>' call
|
|
246
|
-
var value = element.i24_1.b1();
|
|
247
|
-
// Inline function 'kotlin.text.sumOf' call
|
|
248
|
-
var sum = 0;
|
|
249
|
-
var inductionVariable = 0;
|
|
250
|
-
while (inductionVariable < charSequenceLength(value)) {
|
|
251
|
-
var element_0 = charSequenceGet(value, inductionVariable);
|
|
252
|
-
inductionVariable = inductionVariable + 1 | 0;
|
|
253
|
-
var tmp = sum;
|
|
254
|
-
// Inline function 'community.flock.wirespec.generator.generateType.<anonymous>.<anonymous>.<anonymous>.<anonymous>' call
|
|
255
|
-
// Inline function 'kotlin.code' call
|
|
256
|
-
sum = tmp + Char__toInt_impl_vasixd(element_0) | 0;
|
|
257
|
-
}
|
|
258
|
-
var fieldSeed = typeSeed + sum | 0;
|
|
259
|
-
var fieldRandom = Random(fieldSeed);
|
|
260
|
-
accumulator = plus(acc, to(value, generateReference(_this__u8e3s4, element.j24_1, fieldRandom)));
|
|
261
|
-
}
|
|
262
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
263
|
-
var p0 = accumulator;
|
|
264
|
-
return new JsonObject(p0);
|
|
265
|
-
}
|
|
266
|
-
function generateRefined(def, random) {
|
|
267
|
-
// Inline function 'kotlin.let' call
|
|
268
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
269
|
-
var p0 = randomRegex(def.i25_1.f26_1, random);
|
|
270
|
-
return JsonPrimitive(p0);
|
|
271
|
-
}
|
|
272
|
-
function generateEnum(def, random) {
|
|
273
|
-
// Inline function 'kotlin.let' call
|
|
274
|
-
// Inline function 'kotlin.let' call
|
|
275
|
-
var this_0 = random.rf(def.l25_1.j());
|
|
276
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
277
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
278
|
-
var p0 = toList(def.l25_1).k(this_0);
|
|
279
|
-
return JsonPrimitive(p0);
|
|
280
|
-
}
|
|
281
|
-
function generateUnion(_this__u8e3s4, def, random) {
|
|
282
|
-
// Inline function 'kotlin.let' call
|
|
283
|
-
// Inline function 'kotlin.let' call
|
|
284
|
-
var this_0 = random.rf(def.b25_1.j());
|
|
285
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
286
|
-
// Inline function 'kotlin.contracts.contract' call
|
|
287
|
-
// Inline function 'community.flock.wirespec.generator.generateUnion.<anonymous>' call
|
|
288
|
-
var it = toList(def.b25_1).k(this_0);
|
|
289
|
-
return generate_0(_this__u8e3s4, it, random);
|
|
290
|
-
}
|
|
291
|
-
function randomRegex(regex, random) {
|
|
292
|
-
var tmp = Companion_instance;
|
|
293
|
-
// Inline function 'kotlin.text.substring' call
|
|
294
|
-
var endIndex = regex.length - 2 | 0;
|
|
295
|
-
// Inline function 'kotlin.js.asDynamic' call
|
|
296
|
-
var tmp$ret$1 = regex.substring(1, endIndex);
|
|
297
|
-
return tmp.y4b(tmp$ret$1).h4c(random);
|
|
298
|
-
}
|
|
299
|
-
//region block: exports
|
|
300
|
-
_.$_$ = _.$_$ || {};
|
|
301
|
-
_.$_$.a = generate;
|
|
302
|
-
//endregion
|
|
303
|
-
return _;
|
|
304
|
-
}));
|
|
305
|
-
|
|
306
|
-
//# sourceMappingURL=wirespec-src-tools-generator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/tools/generator/src/commonMain/kotlin/community/flock/wirespec/generator/Generator.kt","../../../../../src/plugin/npm/build/compileSync/js/main/productionLibrary/kotlin/src/kotlin/util/Standard.kt","../../../../../src/plugin/npm/build/compileSync/js/main/productionLibrary/kotlin/common/src/generated/_Collections.kt","../../../../../src/plugin/npm/build/compileSync/js/main/productionLibrary/kotlin/common/src/generated/_Strings.kt","../../../../../src/plugin/npm/build/compileSync/js/main/productionLibrary/kotlin/src/kotlin/CharCode.kt","../../../../../src/plugin/npm/build/compileSync/js/main/productionLibrary/kotlin/js/src/kotlin/text/stringJs.kt"],"sourcesContent":[null,null,null,null,null,null],"names":["generate","<this>","type","random","generateReference","ref","generateIterator","def","item","resolveReference","element","generateObject","generateType","accumulator","sum","fieldSeed","fieldRandom","generateRefined","generateEnum","generateUnion","randomRegex","regex"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAoBAA,CAAIC,a,EAAaC,I,EAAcC,MAA/BH,EAA+E;A;;;;;aCa9E,WACqB,aAAL,IAAK,EAAa,IAAb,CADrB,EAC0D,KAD1D,C;;;eDTmB,SAAL,IAAK,EAAS,IAAT,CAAL,GAA+B,aAAqB,EAArB,EAAsC,KAAtC,CAA/B,GAAiF,E;IAC/D,OAAtB,0BAAS,IAAT,EAAa,MAAb,C;EAAqB,C;qBAEhCA,CAAIC,a,EAAaC,I,EAAiBC,MAAlCH,EAAkF;A;IAA+B,OAA/B,iCAAkB,IAAlB,EAAwB,MAAxB,C;EAA8B,C;4BAUhHI,CAAYH,a,EAAsBI,G,EAAgBF,MAAlDC,EAAoE;A;IAChE,IADsE,GACtE,iB;MA1BoD,MACpD,yB;;MA0BA,IAFsE,GAEtE,qB;cAAyB,gCAAiB,gCAAiB,GAAjB,CAAqB,KAArB,CAAjB,EAAkD,MAAlD,C;;QACzB,IAHsE,GAGtE,sB;cAAoC,eAAJ,GAAI,M;;UAChC,oC;;;qBCqBsB,MAAO,K;oBAAc,mB;;YDpB3C,qC;;;yBCoB0G,MAAO,K;sBAAiB,qB;;cDnBlI,sC;;;2BCsBkB,MAAO,K;wBAAkB,qB;;;;2BAEzC,uBAAM,WAAN,CAAmB,KAAS,MAAT,C;wBAAqB,mB;;;;;;UDpB9C,IAVsE,GAUtE,mB;kBAAuB,8BAAe,gCAAiB,GAAjB,CAAf,EAAsC,MAAtC,C;;YACvB,IAXsE,GAWtE,iB;;;cACA,IA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