@nfdi4plants/arctrl 3.1.0 → 3.1.1

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 (89) hide show
  1. package/dist/ts/ts/CWL/CWLTypes.d.ts +162 -45
  2. package/dist/ts/ts/CWL/CWLTypes.d.ts.map +1 -1
  3. package/dist/ts/ts/CWL/CWLTypes.js +495 -104
  4. package/dist/ts/ts/CWL/Decode.d.ts +291 -48
  5. package/dist/ts/ts/CWL/Decode.d.ts.map +1 -1
  6. package/dist/ts/ts/CWL/Decode.js +911 -568
  7. package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts +37 -0
  8. package/dist/ts/ts/CWL/DynamicObjHelpers.d.ts.map +1 -0
  9. package/dist/ts/ts/CWL/DynamicObjHelpers.js +57 -0
  10. package/dist/ts/ts/CWL/Encode.d.ts +117 -2
  11. package/dist/ts/ts/CWL/Encode.d.ts.map +1 -1
  12. package/dist/ts/ts/CWL/Encode.js +399 -163
  13. package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts +2 -0
  14. package/dist/ts/ts/CWL/ExpressionToolDescription.d.ts.map +1 -1
  15. package/dist/ts/ts/CWL/ExpressionToolDescription.js +7 -0
  16. package/dist/ts/ts/CWL/Inputs.d.ts +65 -14
  17. package/dist/ts/ts/CWL/Inputs.d.ts.map +1 -1
  18. package/dist/ts/ts/CWL/Inputs.js +194 -51
  19. package/dist/ts/ts/CWL/OperationDescription.d.ts +2 -0
  20. package/dist/ts/ts/CWL/OperationDescription.d.ts.map +1 -1
  21. package/dist/ts/ts/CWL/OperationDescription.js +7 -0
  22. package/dist/ts/ts/CWL/Outputs.d.ts +51 -12
  23. package/dist/ts/ts/CWL/Outputs.d.ts.map +1 -1
  24. package/dist/ts/ts/CWL/Outputs.js +152 -76
  25. package/dist/ts/ts/CWL/ParameterReference.d.ts +4 -1
  26. package/dist/ts/ts/CWL/ParameterReference.d.ts.map +1 -1
  27. package/dist/ts/ts/CWL/ParameterReference.js +17 -6
  28. package/dist/ts/ts/CWL/Requirements.d.ts +140 -51
  29. package/dist/ts/ts/CWL/Requirements.d.ts.map +1 -1
  30. package/dist/ts/ts/CWL/Requirements.js +458 -128
  31. package/dist/ts/ts/CWL/ToolDescription.d.ts +27 -2
  32. package/dist/ts/ts/CWL/ToolDescription.d.ts.map +1 -1
  33. package/dist/ts/ts/CWL/ToolDescription.js +74 -4
  34. package/dist/ts/ts/CWL/WorkflowDescription.d.ts +2 -0
  35. package/dist/ts/ts/CWL/WorkflowDescription.d.ts.map +1 -1
  36. package/dist/ts/ts/CWL/WorkflowDescription.js +7 -0
  37. package/dist/ts/ts/CWL/WorkflowSteps.d.ts +50 -19
  38. package/dist/ts/ts/CWL/WorkflowSteps.d.ts.map +1 -1
  39. package/dist/ts/ts/CWL/WorkflowSteps.js +152 -23
  40. package/dist/ts/ts/ContractIO/ContractIO.d.ts.map +1 -1
  41. package/dist/ts/ts/ContractIO/ContractIO.js +4 -1
  42. package/dist/ts/ts/Conversion/Assay.d.ts.map +1 -1
  43. package/dist/ts/ts/Conversion/Assay.js +4 -3
  44. package/dist/ts/ts/Conversion/Investigation.js +2 -2
  45. package/dist/ts/ts/Conversion/Person.d.ts +1 -1
  46. package/dist/ts/ts/Conversion/Person.d.ts.map +1 -1
  47. package/dist/ts/ts/Conversion/Person.js +27 -11
  48. package/dist/ts/ts/Conversion/Run.d.ts.map +1 -1
  49. package/dist/ts/ts/Conversion/Run.js +3 -2
  50. package/dist/ts/ts/Conversion/ScholarlyArticle.d.ts.map +1 -1
  51. package/dist/ts/ts/Conversion/ScholarlyArticle.js +2 -1
  52. package/dist/ts/ts/Conversion/Study.d.ts.map +1 -1
  53. package/dist/ts/ts/Conversion/Study.js +5 -4
  54. package/dist/ts/ts/Conversion/Workflow.d.ts.map +1 -1
  55. package/dist/ts/ts/Conversion/Workflow.js +13 -12
  56. package/dist/ts/ts/Conversion.d.ts +14 -10
  57. package/dist/ts/ts/Conversion.d.ts.map +1 -1
  58. package/dist/ts/ts/Conversion.js +18 -11
  59. package/dist/ts/ts/Core/ArcTypes.d.ts.map +1 -1
  60. package/dist/ts/ts/Core/ArcTypes.js +18 -0
  61. package/dist/ts/ts/Json.d.ts +2 -2
  62. package/dist/ts/ts/Json.d.ts.map +1 -1
  63. package/dist/ts/ts/Json.js +3 -3
  64. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.d.ts.map +1 -1
  65. package/dist/ts/ts/WorkflowGraph/ReferenceParsing.js +2 -1
  66. package/dist/ts/ts/Yaml/ValidationPackage.d.ts +1 -1
  67. package/dist/ts/ts/Yaml/ValidationPackage.d.ts.map +1 -1
  68. package/dist/ts/ts/Yaml/ValidationPackage.js +5 -5
  69. package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts +1 -1
  70. package/dist/ts/ts/Yaml/ValidationPackagesConfig.d.ts.map +1 -1
  71. package/dist/ts/ts/Yaml/ValidationPackagesConfig.js +5 -5
  72. package/dist/ts/ts/Yaml.js +1 -1
  73. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Decode.fs.js +5 -33
  74. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Persil.fs.js +11 -159
  75. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.11/Preprocessing.fs.js +319 -0
  76. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.11/Reader.fs.js +1867 -0
  77. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Regex.fs.js +1 -1
  78. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/RegexActivePatterns.fs.js +2 -2
  79. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.11/Syntax.fs.js +819 -0
  80. package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Writer.fs.js +75 -48
  81. package/package.json +1 -1
  82. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.7/FlowToBlock.fs.js +0 -956
  83. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.7/Preprocessing.fs.js +0 -181
  84. package/dist/ts/ts/fable_modules/YAMLicious.1.0.0-alpha.7/Reader.fs.js +0 -1493
  85. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Encode.fs.js +0 -0
  86. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Escapes.fs.js +0 -0
  87. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/Interop/JsInterop.fs.js +0 -0
  88. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/StringBuffer.fs.js +0 -0
  89. /package/dist/ts/ts/fable_modules/{YAMLicious.1.0.0-alpha.7 → YAMLicious.1.0.0-alpha.11}/YAMLiciousTypes.fs.js +0 -0
@@ -1,17 +1,17 @@
1
- import { max, length, takeWhile, toList } from '../../../node_modules/@fable-org/fable-library-js/Seq.js';
1
+ import { max, toList } from '../../../node_modules/@fable-org/fable-library-js/Seq.js';
2
2
  import { comparePrimitives, getEnumerator, disposeSafe, equals } from '../../../node_modules/@fable-org/fable-library-js/Util.js';
3
3
  import { parse } from '../../../node_modules/@fable-org/fable-library-js/Int32.js';
4
4
  import { QuotedStringKind_SingleQuotedString, StringMapEntry, QuotedStringKind_DoubleQuotedString, YAMLDirective } from './YAMLiciousTypes.fs.js';
5
5
  import { StringBuffer_$ctor, StringBuffer__Append_244C7CD6, StringBuffer__get_Length, StringBuffer__get_Item_Z524259A4, StringBuffer__Append_Z721C83C5 } from './StringBuffer.fs.js';
6
- import { item, tryHead, tryFind, takeWhile as takeWhile$1, take, append } from '../../../node_modules/@fable-org/fable-library-js/Array.js';
7
- import { trimStart, trimEnd, replace, substring, toText, printf, isNullOrWhiteSpace, split } from '../../../node_modules/@fable-org/fable-library-js/String.js';
6
+ import { item, tryFind, takeWhile, take, append } from '../../../node_modules/@fable-org/fable-library-js/Array.js';
7
+ import { trimStart, trimEnd, replace, substring, toText, printf, split } from '../../../node_modules/@fable-org/fable-library-js/String.js';
8
8
  import { toString } from '../../../node_modules/@fable-org/fable-library-js/Types.js';
9
9
  import { addToDict } from '../../../node_modules/@fable-org/fable-library-js/MapUtil.js';
10
10
  import { FSharpSet__Contains, ofList, empty } from '../../../node_modules/@fable-org/fable-library-js/Set.js';
11
+ import { Line_normalizeNewlines, BlockScalar_tryDetectHeaderIndent, Line_countLeadingSpaces, Document_isStart, Document_tryInlineContentAfterStartMarker } from './Syntax.fs.js';
11
12
  import { value, defaultArg, map, unwrap } from '../../../node_modules/@fable-org/fable-library-js/Option.js';
12
13
  import { replace as replace$1, match } from '../../../node_modules/@fable-org/fable-library-js/RegExp.js';
13
14
  import { ofArray, isEmpty, head, tail, toArray, reverse } from '../../../node_modules/@fable-org/fable-library-js/List.js';
14
- import { isWhiteSpace } from '../../../node_modules/@fable-org/fable-library-js/Char.js';
15
15
  import { add, empty as empty$1 } from '../../../node_modules/@fable-org/fable-library-js/Map.js';
16
16
 
17
17
  function nextStringIndex(dict) {
@@ -271,139 +271,14 @@ function replaceQuotedStrings(target, dict, protectedBlockScalarLines, s) {
271
271
  }
272
272
  return toString(sb);
273
273
  }
274
- function encodingCleanUp(s) {
275
- return replace(s, "\r\n", "\n");
276
- }
277
- function countLeadingSpaces(line) {
278
- return length(takeWhile((c) => c === " ", line.split("")));
279
- }
280
- function parseBlockScalarHeaderToken(token) {
281
- let c;
282
- if (isNullOrWhiteSpace(token)) {
283
- return false;
284
- } else {
285
- const t = token.trim();
286
- if (t.length === 0) {
287
- return false;
288
- } else {
289
- const first = t[0];
290
- if (first !== "|" && first !== ">") {
291
- return false;
292
- } else {
293
- let valid = true;
294
- let seenIndent = false;
295
- let seenChomp = false;
296
- let idx = 1;
297
- while (idx < t.length && valid) {
298
- const matchValue = t[idx];
299
- let matchResult;
300
- if (c = matchValue, c >= "1" && c <= "9") {
301
- matchResult = 0;
302
- } else {
303
- switch (matchValue) {
304
- case "+":
305
- case "-": {
306
- matchResult = 1;
307
- break;
308
- }
309
- default:
310
- matchResult = 2;
311
- }
312
- }
313
- switch (matchResult) {
314
- case 0: {
315
- if (seenIndent) {
316
- valid = false;
317
- } else {
318
- seenIndent = true;
319
- }
320
- break;
321
- }
322
- case 1: {
323
- if (seenChomp) {
324
- valid = false;
325
- } else {
326
- seenChomp = true;
327
- }
328
- break;
329
- }
330
- case 2: {
331
- valid = false;
332
- break;
333
- }
334
- }
335
- idx = idx + 1 | 0;
336
- }
337
- return valid;
338
- }
339
- }
340
- }
341
- }
342
- function tryDetectBlockScalarHeaderIndent(line) {
343
- let loop, idx_3;
344
- const trimmed = trimStart(line);
345
- const afterDash = trimmed.startsWith("- ") ? trimStart(substring(trimmed, 2)) : trimmed;
346
- const token = tryHead(split((loop = (current_mut) => {
347
- loop:
348
- while (true) {
349
- const current = current_mut;
350
- const c = trimStart(current);
351
- if (c.startsWith("&")) {
352
- const idx = c.indexOf(" ") | 0;
353
- if (idx < 0) {
354
- return "";
355
- } else {
356
- current_mut = substring(c, idx + 1);
357
- continue loop;
358
- }
359
- } else if (c.startsWith("!<")) {
360
- const idx_1 = c.indexOf(">") | 0;
361
- if (idx_1 < 0) {
362
- return c;
363
- } else {
364
- current_mut = substring(c, idx_1 + 1);
365
- continue loop;
366
- }
367
- } else if (c.startsWith("!") && !c.startsWith("|") && !c.startsWith(">")) {
368
- const idx_2 = c.indexOf(" ") | 0;
369
- if (idx_2 < 0) {
370
- return "";
371
- } else {
372
- current_mut = substring(c, idx_2 + 1);
373
- continue loop;
374
- }
375
- } else {
376
- return c;
377
- }
378
- break;
379
- }
380
- }, loop((idx_3 = afterDash.indexOf(":") | 0, idx_3 >= 0 ? trimStart(substring(afterDash, idx_3 + 1)) : afterDash))), [" ", " "], void 0, 1));
381
- let matchResult, t_1;
382
- if (token != null) {
383
- if (parseBlockScalarHeaderToken(value(token))) {
384
- matchResult = 0;
385
- t_1 = value(token);
386
- } else {
387
- matchResult = 1;
388
- }
389
- } else {
390
- matchResult = 1;
391
- }
392
- switch (matchResult) {
393
- case 0:
394
- return countLeadingSpaces(line);
395
- default:
396
- return void 0;
397
- }
398
- }
399
274
  function detectBlockScalarContentLines(yamlString) {
400
- const lines = split(replace(replace(yamlString, "\r\n", "\n"), "\r", "\n"), ["\n"], void 0, 0);
275
+ const lines = split(Line_normalizeNewlines(yamlString), ["\n"], void 0, 0);
401
276
  const protectedLines = [];
402
277
  let i = 0;
403
278
  let openBlockIndent = void 0;
404
279
  while (i < lines.length) {
405
280
  if (openBlockIndent == null) {
406
- const matchValue = tryDetectBlockScalarHeaderIndent(item(i, lines));
281
+ const matchValue = BlockScalar_tryDetectHeaderIndent(item(i, lines));
407
282
  if (matchValue == null) {
408
283
  i = i + 1 | 0;
409
284
  } else {
@@ -414,7 +289,7 @@ function detectBlockScalarContentLines(yamlString) {
414
289
  } else {
415
290
  const headerIndent = value(openBlockIndent) | 0;
416
291
  const line = item(i, lines);
417
- if (line.trim() === "" ? true : countLeadingSpaces(line) > headerIndent) {
292
+ if (line.trim() === "" ? true : Line_countLeadingSpaces(line) > headerIndent) {
418
293
  const value = void protectedLines.push(i);
419
294
  i = i + 1 | 0;
420
295
  } else {
@@ -474,34 +349,11 @@ function parseTagDirective(line) {
474
349
  return void 0;
475
350
  }
476
351
  }
477
- function isDocumentMarker(marker, line) {
478
- const trimmed = trimStart(line);
479
- if (!trimmed.startsWith(marker)) {
480
- return false;
481
- } else if (trimmed.length === marker.length) {
482
- return true;
483
- } else {
484
- return isWhiteSpace(trimmed[marker.length]);
485
- }
486
- }
487
- function tryInlineContentAfterStartMarker(line) {
488
- const trimmed = trimStart(line);
489
- if (!trimmed.startsWith("---")) {
490
- return void 0;
491
- } else {
492
- const rest = trimStart(substring(trimmed, 3));
493
- if (isNullOrWhiteSpace(rest) ? true : rest.startsWith("#")) {
494
- return void 0;
495
- } else {
496
- return rest;
497
- }
498
- }
499
- }
500
352
  function pipeline(yamlString) {
501
353
  let matchValue_2;
502
354
  const stringMap = /* @__PURE__ */ new Map([]);
503
355
  const commentMap = /* @__PURE__ */ new Map([]);
504
- const normalizedContent = encodingCleanUp(yamlString);
356
+ const normalizedContent = Line_normalizeNewlines(yamlString);
505
357
  const protectedBlockScalarLines = detectBlockScalarContentLines(normalizedContent);
506
358
  const lines = cut(commentCleanUp(commentMap, stringCleanUpWithProtected(stringMap, protectedBlockScalarLines, singleQuotedStringCleanUpWithProtected(stringMap, protectedBlockScalarLines, normalizedContent))));
507
359
  let directivePreludeLength;
@@ -513,7 +365,7 @@ function pipeline(yamlString) {
513
365
  return false;
514
366
  }
515
367
  }, lines)), false)) {
516
- const array_2 = takeWhile$1((l_1) => {
368
+ const array_2 = takeWhile((l_1) => {
517
369
  const t_1 = trimStart(l_1);
518
370
  if (t_1.startsWith("%") ? true : t_1.startsWith("#")) {
519
371
  return true;
@@ -552,11 +404,11 @@ function pipeline(yamlString) {
552
404
  }
553
405
  return {
554
406
  CommentMap: commentMap,
555
- Lines: contentLines.length > 0 && isDocumentMarker("---", item(0, contentLines)) ? (matchValue_2 = tryInlineContentAfterStartMarker(item(0, contentLines)), matchValue_2 == null ? contentLines.slice(1, contentLines.length) : append([value(matchValue_2)], contentLines.slice(1, contentLines.length))) : contentLines,
407
+ Lines: contentLines.length > 0 && Document_isStart(item(0, contentLines)) ? (matchValue_2 = Document_tryInlineContentAfterStartMarker(item(0, contentLines)), matchValue_2 == null ? contentLines.slice(1, contentLines.length) : append([value(matchValue_2)], contentLines.slice(1, contentLines.length))) : contentLines,
556
408
  StringMap: stringMap,
557
409
  TagHandles: tagHandles,
558
410
  YAMLVersion: unwrap(yamlVersion)
559
411
  };
560
412
  }
561
413
 
562
- export { commentCleanUp, cut, encodingCleanUp, parseTagDirective, parseYAMLDirective, pipeline, singleQuotedStringCleanUp, stringCleanUp };
414
+ export { commentCleanUp, cut, parseTagDirective, parseYAMLDirective, pipeline, singleQuotedStringCleanUp, stringCleanUp };
@@ -0,0 +1,319 @@
1
+ import { Placeholder_isCommentOnlyLine, Line_countLeadingSpaces, BlockScalar_isHeaderLine } from './Syntax.fs.js';
2
+ import { tryFind, isEmpty, head, tail, reverse, cons, empty, ofArray, ofSeq } from '../../../node_modules/@fable-org/fable-library-js/List.js';
3
+ import { value } from '../../../node_modules/@fable-org/fable-library-js/Option.js';
4
+ import { Config_init_71136F3F, Config__get_WhitespaceString, Config, PreprocessorElement_Line, PreprocessorElement_Intendation, Preprocessor, PreprocessorElement_Level } from './YAMLiciousTypes.fs.js';
5
+ import { StringBuffer_$ctor, StringBuffer__AppendLine_Z721C83C5 } from './StringBuffer.fs.js';
6
+ import { getEnumerator, disposeSafe } from '../../../node_modules/@fable-org/fable-library-js/Util.js';
7
+ import { toString } from '../../../node_modules/@fable-org/fable-library-js/Types.js';
8
+ import { pipeline } from './Persil.fs.js';
9
+ import { substring, trimStart, trimEnd } from '../../../node_modules/@fable-org/fable-library-js/String.js';
10
+
11
+ function isPresentationOnlyLine(line) {
12
+ if (line.trim() === "") {
13
+ return true;
14
+ } else {
15
+ return Placeholder_isCommentOnlyLine(line);
16
+ }
17
+ }
18
+ function tryFindContentLine(lines) {
19
+ return tryFind((arg) => !isPresentationOnlyLine(arg), lines);
20
+ }
21
+ function shouldStayInNestedBlock(currentIntendation, inBlockScalar, line, rest) {
22
+ let nextLine_1;
23
+ if (line.trim() === "") {
24
+ if (inBlockScalar) {
25
+ const matchValue = tryFind((l) => l.trim() !== "", rest);
26
+ if (matchValue == null) {
27
+ return true;
28
+ } else {
29
+ return Line_countLeadingSpaces(value(matchValue)) > currentIntendation;
30
+ }
31
+ } else {
32
+ const matchValue_1 = tryFind((l_1) => l_1.trim() !== "", rest);
33
+ if (matchValue_1 == null) {
34
+ return true;
35
+ } else if (nextLine_1 = value(matchValue_1), Placeholder_isCommentOnlyLine(nextLine_1) && Line_countLeadingSpaces(nextLine_1) <= currentIntendation) {
36
+ const nextLine_2 = value(matchValue_1);
37
+ const matchValue_2 = tryFindContentLine(rest);
38
+ if (matchValue_2 == null) {
39
+ return true;
40
+ } else {
41
+ return Line_countLeadingSpaces(value(matchValue_2)) > currentIntendation;
42
+ }
43
+ } else {
44
+ const nextLine_3 = value(matchValue_1);
45
+ return Line_countLeadingSpaces(nextLine_3) > currentIntendation;
46
+ }
47
+ }
48
+ } else if (Placeholder_isCommentOnlyLine(line)) {
49
+ if (inBlockScalar) {
50
+ return Line_countLeadingSpaces(line) > currentIntendation;
51
+ } else if (Line_countLeadingSpaces(line) > currentIntendation) {
52
+ return true;
53
+ } else {
54
+ const matchValue_3 = tryFindContentLine(rest);
55
+ if (matchValue_3 == null) {
56
+ return true;
57
+ } else {
58
+ return Line_countLeadingSpaces(value(matchValue_3)) > currentIntendation;
59
+ }
60
+ }
61
+ } else {
62
+ return Line_countLeadingSpaces(line) > currentIntendation;
63
+ }
64
+ }
65
+ function splitNestedBlock(currentIntendation, inBlockScalar, lines) {
66
+ const loop = (acc_mut, remaining_mut) => {
67
+ loop:
68
+ while (true) {
69
+ const acc = acc_mut, remaining = remaining_mut;
70
+ let matchResult, line_1, rest_1;
71
+ if (!isEmpty(remaining)) {
72
+ if (shouldStayInNestedBlock(currentIntendation, inBlockScalar, head(remaining), tail(remaining))) {
73
+ matchResult = 0;
74
+ line_1 = head(remaining);
75
+ rest_1 = tail(remaining);
76
+ } else {
77
+ matchResult = 1;
78
+ }
79
+ } else {
80
+ matchResult = 1;
81
+ }
82
+ switch (matchResult) {
83
+ case 0: {
84
+ acc_mut = cons(line_1, acc);
85
+ remaining_mut = rest_1;
86
+ continue loop;
87
+ }
88
+ default:
89
+ return [reverse(acc), remaining];
90
+ }
91
+ break;
92
+ }
93
+ };
94
+ return loop(empty(), lines);
95
+ }
96
+ function write(rootElement, fconfig) {
97
+ let config_1;
98
+ const config = Config_init_71136F3F();
99
+ config_1 = fconfig != null ? value(fconfig)(config) : config;
100
+ const sb = StringBuffer_$ctor();
101
+ const loop = (current, sb_1, config_2) => {
102
+ switch (current.tag) {
103
+ case /* Intendation */
104
+ 1: {
105
+ const nextConfig = new Config(config_2.Whitespace, config_2.Level + 1);
106
+ const enumerator = getEnumerator(current.fields[0]);
107
+ try {
108
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
109
+ loop(enumerator["System.Collections.Generic.IEnumerator`1.get_Current"](), sb_1, nextConfig);
110
+ }
111
+ } finally {
112
+ disposeSafe(enumerator);
113
+ }
114
+ break;
115
+ }
116
+ case /* Level */
117
+ 0: {
118
+ const enumerator_1 = getEnumerator(current.fields[0]);
119
+ try {
120
+ while (enumerator_1["System.Collections.IEnumerator.MoveNext"]()) {
121
+ loop(enumerator_1["System.Collections.Generic.IEnumerator`1.get_Current"](), sb_1, config_2);
122
+ }
123
+ } finally {
124
+ disposeSafe(enumerator_1);
125
+ }
126
+ break;
127
+ }
128
+ case /* Nil */
129
+ 3: {
130
+ break;
131
+ }
132
+ default: {
133
+ const line = current.fields[0];
134
+ StringBuffer__AppendLine_Z721C83C5(sb_1, Config__get_WhitespaceString(config_2) + line);
135
+ }
136
+ }
137
+ };
138
+ loop(rootElement, sb, config_1);
139
+ return toString(sb);
140
+ }
141
+ function read(yamlStr) {
142
+ const content = pipeline(yamlStr);
143
+ const stripIndent = (indent, line) => {
144
+ if (indent <= 0) {
145
+ return line;
146
+ } else if (Line_countLeadingSpaces(line) >= indent) {
147
+ return substring(line, indent);
148
+ } else {
149
+ return trimStart(line);
150
+ }
151
+ };
152
+ const loop = (lines_mut, currentIntendation_mut, inBlockScalar_mut, acc_mut) => {
153
+ loop:
154
+ while (true) {
155
+ const lines = lines_mut, currentIntendation = currentIntendation_mut, inBlockScalar = inBlockScalar_mut, acc = acc_mut;
156
+ const previousContentLine = () => tryFind((_arg) => {
157
+ if (_arg.tag === /* Line */
158
+ 2) {
159
+ const line_1 = _arg.fields[0];
160
+ return line_1.trim() !== "";
161
+ } else {
162
+ return true;
163
+ }
164
+ }, acc);
165
+ const canStartNestedBlockAfterPresentation = () => {
166
+ const _arg_1 = previousContentLine();
167
+ let matchResult, line_2;
168
+ if (_arg_1 != null) {
169
+ if (value(_arg_1).tag === /* Line */
170
+ 2) {
171
+ matchResult = 0;
172
+ line_2 = value(_arg_1).fields[0];
173
+ } else {
174
+ matchResult = 1;
175
+ }
176
+ } else {
177
+ matchResult = 1;
178
+ }
179
+ switch (matchResult) {
180
+ case 0: {
181
+ const trimmed = trimEnd(line_2);
182
+ if ((trimmed.endsWith(":") ? true : trimmed.endsWith("[")) ? true : trimmed.endsWith("{")) {
183
+ return true;
184
+ } else {
185
+ return BlockScalar_isHeaderLine(trimmed);
186
+ }
187
+ }
188
+ default:
189
+ return false;
190
+ }
191
+ };
192
+ const nestedBlockScalarAfterPresentation = () => {
193
+ const matchValue = previousContentLine();
194
+ let matchResult_1, line_3;
195
+ if (matchValue != null) {
196
+ if (value(matchValue).tag === /* Line */
197
+ 2) {
198
+ matchResult_1 = 0;
199
+ line_3 = value(matchValue).fields[0];
200
+ } else {
201
+ matchResult_1 = 1;
202
+ }
203
+ } else {
204
+ matchResult_1 = 1;
205
+ }
206
+ switch (matchResult_1) {
207
+ case 0:
208
+ return BlockScalar_isHeaderLine(trimEnd(line_3));
209
+ default:
210
+ return false;
211
+ }
212
+ };
213
+ if (!isEmpty(lines)) {
214
+ const rest = tail(lines);
215
+ const line_4 = head(lines);
216
+ const isEmptyLine = line_4.trim() === "";
217
+ const isCommentLine = Placeholder_isCommentOnlyLine(line_4);
218
+ if (isEmptyLine) {
219
+ const nextIndentedLine = tryFind((l) => l.trim() !== "", rest);
220
+ let matchResult_2, nextLine_1;
221
+ if (nextIndentedLine != null) {
222
+ if (Line_countLeadingSpaces(value(nextIndentedLine)) > currentIntendation && ((isEmpty(acc) ? true : inBlockScalar) ? true : canStartNestedBlockAfterPresentation())) {
223
+ matchResult_2 = 0;
224
+ nextLine_1 = value(nextIndentedLine);
225
+ } else {
226
+ matchResult_2 = 1;
227
+ }
228
+ } else {
229
+ matchResult_2 = 1;
230
+ }
231
+ switch (matchResult_2) {
232
+ case 0: {
233
+ const nextIntendation = Line_countLeadingSpaces(nextLine_1) | 0;
234
+ const childInBlockScalar = inBlockScalar ? true : nestedBlockScalarAfterPresentation();
235
+ const patternInput = splitNestedBlock(currentIntendation, childInBlockScalar, cons(line_4, rest));
236
+ lines_mut = patternInput[1];
237
+ currentIntendation_mut = currentIntendation;
238
+ inBlockScalar_mut = inBlockScalar;
239
+ acc_mut = cons(PreprocessorElement_Intendation(reverse(loop(patternInput[0], nextIntendation, childInBlockScalar, empty()))), acc);
240
+ continue loop;
241
+ }
242
+ default: {
243
+ lines_mut = rest;
244
+ currentIntendation_mut = currentIntendation;
245
+ inBlockScalar_mut = inBlockScalar;
246
+ acc_mut = cons(PreprocessorElement_Line(""), acc);
247
+ continue loop;
248
+ }
249
+ }
250
+ } else if (isCommentLine) {
251
+ const nextIndentedLine_1 = tryFindContentLine(rest);
252
+ let matchResult_3, nextLine_3;
253
+ if (nextIndentedLine_1 != null) {
254
+ if (Line_countLeadingSpaces(value(nextIndentedLine_1)) > currentIntendation && canStartNestedBlockAfterPresentation()) {
255
+ matchResult_3 = 0;
256
+ nextLine_3 = value(nextIndentedLine_1);
257
+ } else {
258
+ matchResult_3 = 1;
259
+ }
260
+ } else {
261
+ matchResult_3 = 1;
262
+ }
263
+ switch (matchResult_3) {
264
+ case 0: {
265
+ const nextIntendation_1 = Line_countLeadingSpaces(nextLine_3) | 0;
266
+ const childInBlockScalar_1 = inBlockScalar ? true : nestedBlockScalarAfterPresentation();
267
+ const patternInput_1 = splitNestedBlock(currentIntendation, childInBlockScalar_1, cons(line_4, rest));
268
+ lines_mut = patternInput_1[1];
269
+ currentIntendation_mut = currentIntendation;
270
+ inBlockScalar_mut = inBlockScalar;
271
+ acc_mut = cons(PreprocessorElement_Intendation(reverse(loop(patternInput_1[0], nextIntendation_1, childInBlockScalar_1, empty()))), acc);
272
+ continue loop;
273
+ }
274
+ default: {
275
+ lines_mut = rest;
276
+ currentIntendation_mut = currentIntendation;
277
+ inBlockScalar_mut = inBlockScalar;
278
+ acc_mut = cons(PreprocessorElement_Line(stripIndent(currentIntendation, line_4)), acc);
279
+ continue loop;
280
+ }
281
+ }
282
+ } else {
283
+ const nextIntendation_2 = Line_countLeadingSpaces(line_4) | 0;
284
+ if (nextIntendation_2 === currentIntendation) {
285
+ lines_mut = rest;
286
+ currentIntendation_mut = currentIntendation;
287
+ inBlockScalar_mut = inBlockScalar;
288
+ acc_mut = cons(PreprocessorElement_Line(stripIndent(currentIntendation, line_4)), acc);
289
+ continue loop;
290
+ } else {
291
+ const lineText_2 = stripIndent(nextIntendation_2, line_4);
292
+ const childInBlockScalar_2 = inBlockScalar ? true : nestedBlockScalarAfterPresentation();
293
+ const patternInput_2 = splitNestedBlock(currentIntendation, childInBlockScalar_2, rest);
294
+ lines_mut = patternInput_2[1];
295
+ currentIntendation_mut = currentIntendation;
296
+ inBlockScalar_mut = inBlockScalar;
297
+ acc_mut = cons(PreprocessorElement_Intendation(cons(PreprocessorElement_Line(lineText_2), reverse(loop(patternInput_2[0], nextIntendation_2, childInBlockScalar_2, empty())))), acc);
298
+ continue loop;
299
+ }
300
+ }
301
+ } else {
302
+ return acc;
303
+ }
304
+ break;
305
+ }
306
+ };
307
+ return new Preprocessor(PreprocessorElement_Level(reverse(loop(ofArray(content.Lines), 0, false, empty()))), content.StringMap, content.CommentMap, content.YAMLVersion, content.TagHandles);
308
+ }
309
+ function mkLine(line) {
310
+ return PreprocessorElement_Line(line);
311
+ }
312
+ function mklLevel(children) {
313
+ return PreprocessorElement_Level(ofSeq(children));
314
+ }
315
+ function mkIntendation(children) {
316
+ return PreprocessorElement_Intendation(ofSeq(children));
317
+ }
318
+
319
+ export { mkIntendation, mkLine, mklLevel, read, write };