firefly-compiler 0.4.79 → 0.4.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/.hintrc +4 -4
  2. package/.vscode/settings.json +4 -4
  3. package/bin/Release.ff +153 -153
  4. package/bin/firefly.mjs +1 -1
  5. package/compiler/Builder.ff +257 -257
  6. package/compiler/Compiler.ff +227 -227
  7. package/compiler/Dependencies.ff +187 -187
  8. package/compiler/DependencyLock.ff +17 -17
  9. package/compiler/Inference.ff +2 -1
  10. package/compiler/JsEmitter.ff +940 -946
  11. package/compiler/LspHook.ff +202 -202
  12. package/compiler/Main.ff +3 -3
  13. package/compiler/ModuleCache.ff +178 -178
  14. package/compiler/Tokenizer.ff +1 -1
  15. package/compiler/Unification.ff +1 -1
  16. package/compiler/Workspace.ff +88 -88
  17. package/core/.firefly/include/package-lock.json +564 -564
  18. package/core/.firefly/include/package.json +5 -5
  19. package/core/.firefly/include/prepare.sh +1 -1
  20. package/core/.firefly/package.ff +2 -2
  21. package/core/Array.ff +265 -265
  22. package/core/Atomic.ff +64 -64
  23. package/core/Box.ff +7 -7
  24. package/core/BrowserSystem.ff +40 -40
  25. package/core/BuildSystem.ff +148 -148
  26. package/core/Crypto.ff +96 -96
  27. package/core/Equal.ff +36 -36
  28. package/core/Float.ff +25 -0
  29. package/core/HttpClient.ff +148 -148
  30. package/core/JsSystem.ff +69 -69
  31. package/core/Json.ff +434 -434
  32. package/core/List.ff +486 -486
  33. package/core/Lock.ff +144 -144
  34. package/core/NodeSystem.ff +216 -216
  35. package/core/Ordering.ff +161 -161
  36. package/core/Path.ff +401 -401
  37. package/core/Random.ff +134 -134
  38. package/core/RbMap.ff +216 -216
  39. package/core/Show.ff +43 -43
  40. package/core/SourceLocation.ff +68 -68
  41. package/core/Stream.ff +9 -9
  42. package/core/Task.ff +141 -141
  43. package/core/Try.ff +25 -4
  44. package/experimental/benchmarks/ListGrab.ff +23 -23
  45. package/experimental/benchmarks/ListGrab.java +55 -55
  46. package/experimental/benchmarks/Pyrotek45.ff +30 -30
  47. package/experimental/benchmarks/Pyrotek45.java +64 -64
  48. package/experimental/bidirectional/Bidi.ff +88 -88
  49. package/experimental/random/Index.ff +53 -53
  50. package/experimental/random/Process.ff +120 -120
  51. package/experimental/random/Scrape.ff +51 -51
  52. package/experimental/random/Symbols.ff +73 -73
  53. package/experimental/random/Tensor.ff +52 -52
  54. package/experimental/random/Units.ff +36 -36
  55. package/experimental/s3/S3TestAuthorizationHeader.ff +39 -39
  56. package/experimental/s3/S3TestPut.ff +16 -16
  57. package/experimental/tests/TestJson.ff +26 -26
  58. package/firefly.sh +0 -0
  59. package/fireflysite/.firefly/package.ff +4 -4
  60. package/fireflysite/CommunityOverview.ff +20 -20
  61. package/fireflysite/CountingButtonDemo.ff +58 -58
  62. package/fireflysite/DocumentParser.ff +331 -217
  63. package/fireflysite/ExamplesOverview.ff +40 -40
  64. package/fireflysite/FrontPage.ff +344 -360
  65. package/fireflysite/{GuideIntroduction.ff → GettingStarted.ff} +45 -52
  66. package/fireflysite/Guide.ff +443 -411
  67. package/fireflysite/Main.ff +141 -137
  68. package/fireflysite/MatchingPasswordsDemo.ff +82 -82
  69. package/fireflysite/PackagesOverview.ff +49 -49
  70. package/fireflysite/PostgresqlDemo.ff +34 -34
  71. package/fireflysite/ReferenceAll.ff +19 -0
  72. package/fireflysite/ReferenceIntroduction.ff +11 -0
  73. package/fireflysite/Styles.ff +567 -495
  74. package/fireflysite/Test.ff +38 -0
  75. package/fireflysite/assets/markdown/reference/BaseTypes.md +209 -0
  76. package/fireflysite/assets/markdown/reference/FunctionsAndMethods.md +208 -0
  77. package/fireflysite/assets/markdown/reference/ModulesAndPackages.md +168 -0
  78. package/fireflysite/assets/markdown/reference/PatternMatching.md +224 -0
  79. package/fireflysite/assets/markdown/reference/StatementsAndExpressions.md +86 -0
  80. package/fireflysite/assets/markdown/reference/TraitsAndInstances.md +100 -0
  81. package/fireflysite/assets/markdown/reference/UserDefinedTypes.md +184 -0
  82. package/fireflysite/assets/markdown/{ControlFlow.md → scratch/ControlFlow.md} +136 -136
  83. package/fireflysite/assets/markdown/scratch/Toc.md +41 -0
  84. package/lsp/.firefly/package.ff +1 -1
  85. package/lsp/CompletionHandler.ff +828 -828
  86. package/lsp/Handler.ff +714 -714
  87. package/lsp/HoverHandler.ff +79 -79
  88. package/lsp/LanguageServer.ff +272 -272
  89. package/lsp/SignatureHelpHandler.ff +55 -55
  90. package/lsp/SymbolHandler.ff +181 -181
  91. package/lsp/TestReferences.ff +17 -17
  92. package/lsp/TestReferencesCase.ff +7 -7
  93. package/lsp/stderr.txt +1 -1
  94. package/lsp/stdout.txt +34 -34
  95. package/lux/.firefly/package.ff +1 -1
  96. package/lux/Css.ff +648 -648
  97. package/lux/CssTest.ff +48 -48
  98. package/lux/Lux.ff +487 -487
  99. package/lux/LuxEvent.ff +116 -116
  100. package/lux/Main.ff +123 -123
  101. package/lux/Main2.ff +143 -143
  102. package/output/js/ff/compiler/Builder.mjs +47 -47
  103. package/output/js/ff/compiler/Dependencies.mjs +3 -3
  104. package/output/js/ff/compiler/Inference.mjs +2 -2
  105. package/output/js/ff/compiler/JsEmitter.mjs +18 -72
  106. package/output/js/ff/compiler/Main.mjs +4 -4
  107. package/output/js/ff/compiler/ModuleCache.mjs +4 -4
  108. package/output/js/ff/core/Array.mjs +59 -59
  109. package/output/js/ff/core/Atomic.mjs +36 -36
  110. package/output/js/ff/core/BrowserSystem.mjs +11 -11
  111. package/output/js/ff/core/BuildSystem.mjs +30 -30
  112. package/output/js/ff/core/Crypto.mjs +40 -40
  113. package/output/js/ff/core/Float.mjs +50 -0
  114. package/output/js/ff/core/HttpClient.mjs +56 -56
  115. package/output/js/ff/core/Json.mjs +147 -147
  116. package/output/js/ff/core/List.mjs +50 -50
  117. package/output/js/ff/core/Lock.mjs +97 -97
  118. package/output/js/ff/core/NodeSystem.mjs +87 -87
  119. package/output/js/ff/core/Ordering.mjs +8 -8
  120. package/output/js/ff/core/Path.mjs +231 -231
  121. package/output/js/ff/core/Random.mjs +56 -56
  122. package/output/js/ff/core/Task.mjs +39 -39
  123. package/output/js/ff/core/Try.mjs +98 -4
  124. package/package.json +1 -1
  125. package/postgresql/Pg.ff +1 -1
  126. package/rpc/.firefly/package.ff +1 -1
  127. package/rpc/Rpc.ff +70 -70
  128. package/s3/.firefly/package.ff +1 -1
  129. package/s3/S3.ff +94 -94
  130. package/unsafejs/UnsafeJs.ff +19 -19
  131. package/vscode/LICENSE.txt +21 -21
  132. package/vscode/Prepublish.ff +15 -15
  133. package/vscode/README.md +16 -16
  134. package/vscode/client/package.json +22 -22
  135. package/vscode/client/src/extension.ts +104 -104
  136. package/vscode/icons/firefly-icon.svg +10 -10
  137. package/vscode/language-configuration.json +61 -61
  138. package/vscode/package-lock.json +3623 -3623
  139. package/vscode/package.json +1 -1
  140. package/vscode/snippets.json +241 -241
  141. package/vscode/syntaxes/firefly-markdown-injection.json +45 -45
  142. package/webserver/.firefly/include/package-lock.json +22 -22
  143. package/webserver/.firefly/include/package.json +5 -5
  144. package/webserver/.firefly/package.ff +2 -2
  145. package/webserver/WebServer.ff +685 -685
  146. package/websocket/.firefly/package.ff +1 -1
  147. package/websocket/WebSocket.ff +131 -131
  148. package/fireflysite/GuideAll.ff +0 -21
  149. package/fireflysite/GuideBaseTypes.ff +0 -168
  150. package/fireflysite/GuideControlFlow.ff +0 -212
  151. package/fireflysite/assets/markdown/Example.md +0 -78
  152. /package/fireflysite/assets/{NotoSansMono-Regular.ttf → font/NotoSansMono-Regular.ttf} +0 -0
  153. /package/fireflysite/assets/{NunitoSans-VariableFont_YTLC,opsz,wdth,wght.ttf → font/NunitoSans-VariableFont_YTLC,opsz,wdth,wght.ttf} +0 -0
  154. /package/fireflysite/assets/{autocomplete-small.png → image/autocomplete-small.png} +0 -0
  155. /package/fireflysite/assets/{autocomplete.png → image/autocomplete.png} +0 -0
  156. /package/fireflysite/assets/{edit-time-error.png → image/edit-time-error.png} +0 -0
  157. /package/fireflysite/assets/{firefly-logo-notext.png → image/firefly-logo-notext.png} +0 -0
  158. /package/fireflysite/assets/{firefly-logo-yellow.png → image/firefly-logo-yellow.png} +0 -0
@@ -121,13 +121,13 @@ return {redirect_, referrer_, integrity_, mode_, credentials_, cache_};
121
121
 
122
122
 
123
123
  export function internalCheck_(fetchResponse_) {
124
-
125
- if(fetchResponse_.response === null) {
126
- throw new Error("Response closed");
127
- }
128
- if(!fetchResponse_.statusChecked && !fetchResponse_.response.ok) {
129
- throw new Error("Unchecked HTTP status code: " + fetchResponse_.response.status);
130
- }
124
+
125
+ if(fetchResponse_.response === null) {
126
+ throw new Error("Response closed");
127
+ }
128
+ if(!fetchResponse_.statusChecked && !fetchResponse_.response.ok) {
129
+ throw new Error("Unchecked HTTP status code: " + fetchResponse_.response.status);
130
+ }
131
131
 
132
132
  }
133
133
 
@@ -172,28 +172,28 @@ return (await ff_core_HttpClient.HttpClient_fetch$(self_, "DELETE", url_, header
172
172
  }
173
173
 
174
174
  export async function HttpClient_fetch$(self_, method_, url_, headers_ = [], payload_ = ff_core_Option.None(), options_ = ff_core_HttpClient.FetchOptions(), body_, $task) {
175
-
176
- const fetchResponse = {response: null, statusChecked: false};
177
- try {
178
- const options = {headers: {}, signal: $task.controller.signal};
179
- options.method = method_;
180
- headers_.forEach(pair => {options.headers[pair.first_] = pair.second_});
181
- if(payload_.value_) options.body = payload_.value_;
182
- if(options_.redirect_.RedirectError) options.redirect = "error";
183
- else if(options_.redirect_.RedirectManual) options.redirect = "manual";
184
- if(options_.referrer_.value_) options.referrer = options_.referrer_.value_;
185
- if(options_.integrity_.value_) options.integrity = options_.integrity_.value_;
186
- if(options_.mode_.value_) options.mode = options_.mode_.value_;
187
- if(options_.credentials_.value_) options.credentials = options_.credentials_.value_;
188
- if(options_.cache_.value_) options.cache = options_.cache_.value_;
189
- fetchResponse.response = await self_.fetch(url_, options);
190
- const result = await body_(fetchResponse, $task);
191
- internalCheck_(fetchResponse);
192
- return result;
193
- } finally {
194
- fetchResponse.response = null;
195
- if($task.controller.signal.aborted) $task.controller = new AbortController()
196
- }
175
+
176
+ const fetchResponse = {response: null, statusChecked: false};
177
+ try {
178
+ const options = {headers: {}, signal: $task.controller.signal};
179
+ options.method = method_;
180
+ headers_.forEach(pair => {options.headers[pair.first_] = pair.second_});
181
+ if(payload_.value_) options.body = payload_.value_;
182
+ if(options_.redirect_.RedirectError) options.redirect = "error";
183
+ else if(options_.redirect_.RedirectManual) options.redirect = "manual";
184
+ if(options_.referrer_.value_) options.referrer = options_.referrer_.value_;
185
+ if(options_.integrity_.value_) options.integrity = options_.integrity_.value_;
186
+ if(options_.mode_.value_) options.mode = options_.mode_.value_;
187
+ if(options_.credentials_.value_) options.credentials = options_.credentials_.value_;
188
+ if(options_.cache_.value_) options.cache = options_.cache_.value_;
189
+ fetchResponse.response = await self_.fetch(url_, options);
190
+ const result = await body_(fetchResponse, $task);
191
+ internalCheck_(fetchResponse);
192
+ return result;
193
+ } finally {
194
+ fetchResponse.response = null;
195
+ if($task.controller.signal.aborted) $task.controller = new AbortController()
196
+ }
197
197
 
198
198
  }
199
199
 
@@ -226,57 +226,57 @@ throw new Error('Function FetchResponse_readBuffer is missing on this target in
226
226
  }
227
227
 
228
228
  export async function FetchResponse_ok$(self_, $task) {
229
-
230
- self_.statusChecked = true;
231
- internalCheck_(self_);
232
- return self_.response.ok;
229
+
230
+ self_.statusChecked = true;
231
+ internalCheck_(self_);
232
+ return self_.response.ok;
233
233
 
234
234
  }
235
235
 
236
236
  export async function FetchResponse_status$(self_, $task) {
237
-
238
- self_.statusChecked = true;
239
- internalCheck_(self_);
240
- return self_.response.status;
237
+
238
+ self_.statusChecked = true;
239
+ internalCheck_(self_);
240
+ return self_.response.status;
241
241
 
242
242
  }
243
243
 
244
244
  export async function FetchResponse_statusText$(self_, $task) {
245
-
246
- self_.statusChecked = true;
247
- internalCheck_(self_);
248
- return self_.response.statusText;
245
+
246
+ self_.statusChecked = true;
247
+ internalCheck_(self_);
248
+ return self_.response.statusText;
249
249
 
250
250
  }
251
251
 
252
252
  export async function FetchResponse_header$(self_, name_, $task) {
253
-
254
- internalCheck_(self_);
255
- const header = self_.response.headers.get(name_);
256
- return header != null
257
- ? ff_core_Option.Some(header)
258
- : ff_core_Option.None();
253
+
254
+ internalCheck_(self_);
255
+ const header = self_.response.headers.get(name_);
256
+ return header != null
257
+ ? ff_core_Option.Some(header)
258
+ : ff_core_Option.None();
259
259
 
260
260
  }
261
261
 
262
262
  export async function FetchResponse_readText$(self_, $task) {
263
-
264
- internalCheck_(self_);
265
- return await self_.response.text();
263
+
264
+ internalCheck_(self_);
265
+ return await self_.response.text();
266
266
 
267
267
  }
268
268
 
269
269
  export async function FetchResponse_readJson$(self_, $task) {
270
-
271
- internalCheck_(self_);
272
- return await self_.response.json();
270
+
271
+ internalCheck_(self_);
272
+ return await self_.response.json();
273
273
 
274
274
  }
275
275
 
276
276
  export async function FetchResponse_readBuffer$(self_, $task) {
277
-
278
- internalCheck_(self_);
279
- return new DataView(await self_.response.arrayBuffer());
277
+
278
+ internalCheck_(self_);
279
+ return new DataView(await self_.response.arrayBuffer());
280
280
 
281
281
  }
282
282
 
@@ -96,71 +96,71 @@ import * as ff_core_Unit from "../../ff/core/Unit.mjs"
96
96
 
97
97
 
98
98
  export function read_(json_) {
99
-
100
- try {
101
- return ff_core_Option.Some(JSON.parse(json_));
102
- } catch(e) {
103
- return ff_core_Option.None();
104
- }
99
+
100
+ try {
101
+ return ff_core_Option.Some(JSON.parse(json_));
102
+ } catch(e) {
103
+ return ff_core_Option.None();
104
+ }
105
105
 
106
106
  }
107
107
 
108
108
  export function string_(json_) {
109
-
110
- return json_;
109
+
110
+ return json_;
111
111
 
112
112
  }
113
113
 
114
114
  export function int_(json_) {
115
-
116
- return json_;
115
+
116
+ return json_;
117
117
 
118
118
  }
119
119
 
120
120
  export function float_(json_) {
121
-
122
- return json_;
121
+
122
+ return json_;
123
123
 
124
124
  }
125
125
 
126
126
  export function bool_(json_) {
127
-
128
- return json_;
127
+
128
+ return json_;
129
129
 
130
130
  }
131
131
 
132
132
  export function null_() {
133
-
134
- return null;
133
+
134
+ return null;
135
135
 
136
136
  }
137
137
 
138
138
  export function array_(json_) {
139
-
140
- return json_;
139
+
140
+ return json_;
141
141
 
142
142
  }
143
143
 
144
144
  export function object_() {
145
-
146
- return {};
145
+
146
+ return {};
147
147
 
148
148
  }
149
149
 
150
150
  export function fields_(body_) {
151
-
152
- const result = {};
153
- body_((k, v) => {result[k] = v});
154
- return result;
151
+
152
+ const result = {};
153
+ body_((k, v) => {result[k] = v});
154
+ return result;
155
155
 
156
156
  }
157
157
 
158
158
  export function internalWith_(self_, field_, value_) {
159
-
160
- if(typeof self_ !== 'object' || self_ === null || Array.isArray(self_)) {
161
- throw new Error('Not an object: ' + JSON.stringify(self_));
162
- }
163
- return {...self_, [field_]: value_};
159
+
160
+ if(typeof self_ !== 'object' || self_ === null || Array.isArray(self_)) {
161
+ throw new Error('Not an object: ' + JSON.stringify(self_));
162
+ }
163
+ return {...self_, [field_]: value_};
164
164
 
165
165
  }
166
166
 
@@ -173,69 +173,69 @@ for(const [key, value] of Object.entries(self_)) if(!body_(key, value)) break
173
173
  }
174
174
 
175
175
  export function internalEquals_(a_, b_) {
176
-
177
- if(a_ === b_) {
178
- return true;
179
- } else if(Array.isArray(a_) || Array.isArray(b_)) {
180
- if(!Array.isArray(a_) || !Array.isArray(b_)) return false;
181
- if(a_.length !== b_.length) return false;
182
- for(let i = 0; i < a_.length; i++) {
183
- if(!internalEquals_(a_[i], b_[i])) return false;
184
- }
185
- return true;
186
- } else if(typeof a_ === 'object' && typeof b_ === 'object' && a_ !== null && b_ !== null) {
187
- const aKeys = Object.keys(a_);
188
- const bKeys = Object.keys(b_);
189
- if(aKeys.length !== bKeys.length) return false;
190
- for(const key of aKeys) {
191
- if(!Object.hasOwn(b_, key) || !internalEquals_(a_[key], b_[key])) return false;
192
- }
193
- return true;
194
- } else {
195
- return false;
196
- }
176
+
177
+ if(a_ === b_) {
178
+ return true;
179
+ } else if(Array.isArray(a_) || Array.isArray(b_)) {
180
+ if(!Array.isArray(a_) || !Array.isArray(b_)) return false;
181
+ if(a_.length !== b_.length) return false;
182
+ for(let i = 0; i < a_.length; i++) {
183
+ if(!internalEquals_(a_[i], b_[i])) return false;
184
+ }
185
+ return true;
186
+ } else if(typeof a_ === 'object' && typeof b_ === 'object' && a_ !== null && b_ !== null) {
187
+ const aKeys = Object.keys(a_);
188
+ const bKeys = Object.keys(b_);
189
+ if(aKeys.length !== bKeys.length) return false;
190
+ for(const key of aKeys) {
191
+ if(!Object.hasOwn(b_, key) || !internalEquals_(a_[key], b_[key])) return false;
192
+ }
193
+ return true;
194
+ } else {
195
+ return false;
196
+ }
197
197
 
198
198
  }
199
199
 
200
200
  export function internalCompare_(a_, b_) {
201
-
202
- if(a_ === b_) {
203
- return 0;
204
- } else if (a_ === null || b_ === null) {
205
- return a_ === null ? -1 : 1;
206
- } else if (typeof a_ === 'boolean' || typeof b_ === 'boolean') {
207
- if(typeof b_ !== 'boolean') return -1;
208
- if(typeof a_ !== 'boolean') return 1;
209
- return a_ < b_ ? -1 : 1;
210
- } else if (typeof a_ === 'number' || typeof b_ === 'number') {
211
- if(typeof b_ !== 'number') return -1;
212
- if(typeof a_ !== 'number') return 1;
213
- if(isNaN(a_)) return isNaN(b_) ? 0 : -1;
214
- if(isNaN(b_)) return 1;
215
- return a_ < b_ ? -1 : 1;
216
- } else if (typeof a_ === 'string' || typeof b_ === 'string') {
217
- if(typeof b_ !== 'string') return -1;
218
- if(typeof a_ !== 'string') return 1;
219
- return a_.localeCompare(b_, 'en');
220
- } else if(Array.isArray(a_) || Array.isArray(b_)) {
221
- if(!Array.isArray(a_) || !Array.isArray(b_)) return a_ < b_ ? -1 : 1;
222
- const length = Math.min(a_.length, b_.length);
223
- for(let i = 0; i < length; i++) {
224
- const cmp = internalCompare_(a_[i], b_[i]);
225
- if(cmp !== 0) return cmp;
226
- }
227
- return a_.length - b_.length;
228
- } else {
229
- const aKeys = Object.keys(a_).sort();
230
- const bKeys = Object.keys(b_).sort();
231
- const keyResult = internalCompare_(aKeys, bKeys);
232
- if(keyResult !== 0) return keyResult;
233
- for(const key of aKeys) {
234
- const result = internalCompare_(a_[key], b_[key]);
235
- if(result !== 0) return result;
236
- }
237
- return 0;
238
- }
201
+
202
+ if(a_ === b_) {
203
+ return 0;
204
+ } else if (a_ === null || b_ === null) {
205
+ return a_ === null ? -1 : 1;
206
+ } else if (typeof a_ === 'boolean' || typeof b_ === 'boolean') {
207
+ if(typeof b_ !== 'boolean') return -1;
208
+ if(typeof a_ !== 'boolean') return 1;
209
+ return a_ < b_ ? -1 : 1;
210
+ } else if (typeof a_ === 'number' || typeof b_ === 'number') {
211
+ if(typeof b_ !== 'number') return -1;
212
+ if(typeof a_ !== 'number') return 1;
213
+ if(isNaN(a_)) return isNaN(b_) ? 0 : -1;
214
+ if(isNaN(b_)) return 1;
215
+ return a_ < b_ ? -1 : 1;
216
+ } else if (typeof a_ === 'string' || typeof b_ === 'string') {
217
+ if(typeof b_ !== 'string') return -1;
218
+ if(typeof a_ !== 'string') return 1;
219
+ return a_.localeCompare(b_, 'en');
220
+ } else if(Array.isArray(a_) || Array.isArray(b_)) {
221
+ if(!Array.isArray(a_) || !Array.isArray(b_)) return a_ < b_ ? -1 : 1;
222
+ const length = Math.min(a_.length, b_.length);
223
+ for(let i = 0; i < length; i++) {
224
+ const cmp = internalCompare_(a_[i], b_[i]);
225
+ if(cmp !== 0) return cmp;
226
+ }
227
+ return a_.length - b_.length;
228
+ } else {
229
+ const aKeys = Object.keys(a_).sort();
230
+ const bKeys = Object.keys(b_).sort();
231
+ const keyResult = internalCompare_(aKeys, bKeys);
232
+ if(keyResult !== 0) return keyResult;
233
+ for(const key of aKeys) {
234
+ const result = internalCompare_(a_[key], b_[key]);
235
+ if(result !== 0) return result;
236
+ }
237
+ return 0;
238
+ }
239
239
 
240
240
  }
241
241
 
@@ -272,10 +272,10 @@ throw new Error('Function object is missing on this target in async context.');
272
272
  }
273
273
 
274
274
  export async function fields_$(body_, $task) {
275
-
276
- const result = {};
277
- await body_((k, v) => {result[k] = v}, $task);
278
- return result;
275
+
276
+ const result = {};
277
+ await body_((k, v) => {result[k] = v}, $task);
278
+ return result;
279
279
 
280
280
  }
281
281
 
@@ -300,8 +300,8 @@ throw new Error('Function internalCompare is missing on this target in async con
300
300
  }
301
301
 
302
302
  export function Json_write(self_, indentation_ = ff_core_Option.None()) {
303
-
304
- return JSON.stringify(self_, null, indentation_.value_);
303
+
304
+ return JSON.stringify(self_, null, indentation_.value_);
305
305
 
306
306
  }
307
307
 
@@ -310,50 +310,50 @@ return ff_core_Json.internalWith_(self_, field_, ff_core_Json_JsonLike$T.toJson_
310
310
  }
311
311
 
312
312
  export function Json_merge(self_, that_) {
313
-
314
- if(typeof self_ !== 'object' || self_ === null || Array.isArray(self_)) {
315
- throw new Error('Not an object: ' + JSON.stringify(self_));
316
- }
317
- if(typeof that_ !== 'object' || that_ === null || Array.isArray(that_)) {
318
- throw new Error('Not an object: ' + JSON.stringify(that_));
319
- }
320
- return {...self_, ...that_};
313
+
314
+ if(typeof self_ !== 'object' || self_ === null || Array.isArray(self_)) {
315
+ throw new Error('Not an object: ' + JSON.stringify(self_));
316
+ }
317
+ if(typeof that_ !== 'object' || that_ === null || Array.isArray(that_)) {
318
+ throw new Error('Not an object: ' + JSON.stringify(that_));
319
+ }
320
+ return {...self_, ...that_};
321
321
 
322
322
  }
323
323
 
324
324
  export function Json_grabString(self_) {
325
-
326
- if(typeof self_ !== 'string') throw new Error('Not a string: ' + JSON.stringify(self_));
327
- return self_;
325
+
326
+ if(typeof self_ !== 'string') throw new Error('Not a string: ' + JSON.stringify(self_));
327
+ return self_;
328
328
 
329
329
  }
330
330
 
331
331
  export function Json_grabInt(self_) {
332
-
333
- if(!Number.isSafeInteger(self_)) throw new Error('Not an int: ' + JSON.stringify(self_));
334
- return Math.trunc(self_);
332
+
333
+ if(!Number.isSafeInteger(self_)) throw new Error('Not an int: ' + JSON.stringify(self_));
334
+ return Math.trunc(self_);
335
335
 
336
336
  }
337
337
 
338
338
  export function Json_grabFloat(self_) {
339
-
340
- if(typeof self_ !== 'number') throw new Error('Not a float: ' + JSON.stringify(self_));
341
- return self_;
339
+
340
+ if(typeof self_ !== 'number') throw new Error('Not a float: ' + JSON.stringify(self_));
341
+ return self_;
342
342
 
343
343
  }
344
344
 
345
345
  export function Json_grabBool(self_) {
346
-
347
- if(self_ === true) return true;
348
- if(self_ === false) return false;
349
- throw new Error('Not a bool: ' + JSON.stringify(self_));
346
+
347
+ if(self_ === true) return true;
348
+ if(self_ === false) return false;
349
+ throw new Error('Not a bool: ' + JSON.stringify(self_));
350
350
 
351
351
  }
352
352
 
353
353
  export function Json_grabArray(self_) {
354
-
355
- if(!Array.isArray(self_)) throw new Error('Not an array: ' + JSON.stringify(self_));
356
- return self_;
354
+
355
+ if(!Array.isArray(self_)) throw new Error('Not an array: ' + JSON.stringify(self_));
356
+ return self_;
357
357
 
358
358
  }
359
359
 
@@ -402,83 +402,83 @@ return ff_core_Option.Some(ff_core_Json.Json_grabMap(self_))
402
402
  }
403
403
 
404
404
  export function Json_isString(self_) {
405
-
406
- return typeof self_ === 'string';
405
+
406
+ return typeof self_ === 'string';
407
407
 
408
408
  }
409
409
 
410
410
  export function Json_isInt(self_) {
411
-
412
- return Number.isSafeInteger(self_);
411
+
412
+ return Number.isSafeInteger(self_);
413
413
 
414
414
  }
415
415
 
416
416
  export function Json_isFloat(self_) {
417
-
418
- return typeof self_ === 'number';
417
+
418
+ return typeof self_ === 'number';
419
419
 
420
420
  }
421
421
 
422
422
  export function Json_isBool(self_) {
423
-
424
- return typeof self_ === 'boolean';
423
+
424
+ return typeof self_ === 'boolean';
425
425
 
426
426
  }
427
427
 
428
428
  export function Json_isArray(self_) {
429
-
430
- return Array.isArray(self_);
429
+
430
+ return Array.isArray(self_);
431
431
 
432
432
  }
433
433
 
434
434
  export function Json_isObject(self_) {
435
-
436
- return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_);
435
+
436
+ return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_);
437
437
 
438
438
  }
439
439
 
440
440
  export function Json_isNull(self_) {
441
-
442
- return self_ === null;
441
+
442
+ return self_ === null;
443
443
 
444
444
  }
445
445
 
446
446
  export function Json_field(self_, key_) {
447
-
448
- return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_) && Object.hasOwn(self_, key_)
449
- ? self_[key_] : null;
447
+
448
+ return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_) && Object.hasOwn(self_, key_)
449
+ ? self_[key_] : null;
450
450
 
451
451
  }
452
452
 
453
453
  export function Json_index(self_, key_) {
454
-
455
- return Array.isArray(self_) ? self_[key] ?? null : null;
454
+
455
+ return Array.isArray(self_) ? self_[key] ?? null : null;
456
456
 
457
457
  }
458
458
 
459
459
  export function Json_hasField(self_, key_) {
460
-
461
- return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_) && Object.hasOwn(self_, key_);
460
+
461
+ return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_) && Object.hasOwn(self_, key_);
462
462
 
463
463
  }
464
464
 
465
465
  export function Json_getField(self_, key_) {
466
-
467
- return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_) && Object.hasOwn(self_, key_)
468
- ? ff_core_Option.Some(self_[key_]) : ff_core_Option.None();
466
+
467
+ return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_) && Object.hasOwn(self_, key_)
468
+ ? ff_core_Option.Some(self_[key_]) : ff_core_Option.None();
469
469
 
470
470
  }
471
471
 
472
472
  export function Json_getIndex(self_, key_) {
473
-
474
- return Array.isArray(self_) ? ff_core_Option.Some(self_[key_] ?? null) : ff_core_Option.None();
473
+
474
+ return Array.isArray(self_) ? ff_core_Option.Some(self_[key_] ?? null) : ff_core_Option.None();
475
475
 
476
476
  }
477
477
 
478
478
  export function Json_getFields(self_) {
479
-
480
- return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_)
481
- ? ff_core_Option.Some(Object.keys(self_)) : ff_core_Option.None();
479
+
480
+ return typeof self_ === 'object' && self_ !== null && !Array.isArray(self_)
481
+ ? ff_core_Option.Some(Object.keys(self_)) : ff_core_Option.None();
482
482
 
483
483
  }
484
484