starlight-fsharp-oracle 0.1.0 → 0.1.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.
Files changed (167) hide show
  1. package/dist/Extensions/StringBuilder.js +2 -5
  2. package/dist/Extensions/TextNode.js +29 -54
  3. package/dist/FSharp.Oracle.Schema/Schema.js +113 -218
  4. package/dist/Generate.js +33 -63
  5. package/dist/Helpers.js +1 -2
  6. package/dist/Plugin.js +17 -31
  7. package/dist/Render/Documentation.js +1 -2
  8. package/dist/Render/Entries.js +29 -34
  9. package/dist/Render/Pages.js +10 -19
  10. package/dist/Render/Primitives.js +19 -32
  11. package/dist/Themes.js +3 -5
  12. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +57 -0
  13. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js +105 -0
  14. package/dist/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +20 -0
  15. package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs +766 -0
  16. package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +232 -0
  17. package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs +31 -0
  18. package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +20 -0
  19. package/dist/fable_modules/Thoth.Json.Core.0.9.0/Decode.fs +1592 -0
  20. package/dist/fable_modules/Thoth.Json.Core.0.9.0/Decode.fs.js +1417 -0
  21. package/dist/fable_modules/Thoth.Json.Core.0.9.0/DecoderCE.fs +106 -0
  22. package/dist/fable_modules/Thoth.Json.Core.0.9.0/DecoderCE.fs.js +63 -0
  23. package/dist/fable_modules/Thoth.Json.Core.0.9.0/Encode.fs +380 -0
  24. package/dist/fable_modules/Thoth.Json.Core.0.9.0/Encode.fs.js +289 -0
  25. package/dist/fable_modules/Thoth.Json.Core.0.9.0/Thoth.Json.Core.fableproj +37 -0
  26. package/dist/fable_modules/Thoth.Json.Core.0.9.0/Types.fs +76 -0
  27. package/dist/fable_modules/Thoth.Json.Core.0.9.0/Types.fs.js +37 -0
  28. package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Casing.fs +113 -0
  29. package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Casing.fs.js +173 -0
  30. package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Decode.fs +1153 -0
  31. package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Decode.fs.js +622 -0
  32. package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Domain.fs +91 -0
  33. package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Domain.fs.js +103 -0
  34. package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Encode.fs +893 -0
  35. package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Encode.fs.js +836 -0
  36. package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Prelude.fs +435 -0
  37. package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Prelude.fs.js +389 -0
  38. package/dist/fable_modules/Thoth.Json.Core.Auto.0.1.0/Thoth.Json.Core.Auto.fableproj +43 -0
  39. package/dist/fable_modules/Thoth.Json.JavaScript.0.5.0/Decode.fs +88 -0
  40. package/dist/fable_modules/Thoth.Json.JavaScript.0.5.0/Decode.fs.js +102 -0
  41. package/dist/fable_modules/Thoth.Json.JavaScript.0.5.0/Encode.fs +40 -0
  42. package/dist/fable_modules/Thoth.Json.JavaScript.0.5.0/Encode.fs.js +59 -0
  43. package/dist/fable_modules/Thoth.Json.JavaScript.0.5.0/Thoth.Json.JavaScript.fableproj +31 -0
  44. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Array.js +1347 -0
  45. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Async.js +134 -0
  46. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/AsyncBuilder.js +183 -0
  47. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/BigInt.js +306 -0
  48. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/BitConverter.js +138 -0
  49. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Boolean.js +22 -0
  50. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/CHANGELOG.md +191 -0
  51. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Char.js +202 -0
  52. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Choice.js +184 -0
  53. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/CollectionUtil.js +182 -0
  54. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/ConditionalWeakTable.js +21 -0
  55. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Date.js +755 -0
  56. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/DateOffset.js +261 -0
  57. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/DateOnly.js +124 -0
  58. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Decimal.js +236 -0
  59. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Double.js +47 -0
  60. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Encoding.js +185 -0
  61. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Event.js +93 -0
  62. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/FSharp.Collections.js +45 -0
  63. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/FSharp.Core.CompilerServices.js +27 -0
  64. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/FSharp.Core.js +156 -0
  65. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Global.js +29 -0
  66. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Guid.js +161 -0
  67. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Int32.js +135 -0
  68. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/List.js +1323 -0
  69. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Long.js +47 -0
  70. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/MailboxProcessor.js +94 -0
  71. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Map.js +1396 -0
  72. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/MapUtil.js +130 -0
  73. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/MutableMap.js +339 -0
  74. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/MutableSet.js +233 -0
  75. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Native.js +14 -0
  76. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Numeric.js +75 -0
  77. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Observable.js +113 -0
  78. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Option.js +104 -0
  79. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/README.md +3 -0
  80. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Random.js +172 -0
  81. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Range.js +45 -0
  82. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Reflection.js +460 -0
  83. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/RegExp.js +141 -0
  84. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Result.js +165 -0
  85. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Seq.js +1409 -0
  86. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Seq2.js +111 -0
  87. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Set.js +1788 -0
  88. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/String.js +649 -0
  89. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/System.Collections.Generic.js +333 -0
  90. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/System.Text.js +168 -0
  91. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/System.js +283 -0
  92. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/TimeOnly.js +122 -0
  93. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/TimeSpan.js +180 -0
  94. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Timer.js +67 -0
  95. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Types.js +198 -0
  96. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Unicode.13.0.0.js +4 -0
  97. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Uri.js +165 -0
  98. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/Util.js +792 -0
  99. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/big.d.ts +338 -0
  100. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/lib/big.js +825 -0
  101. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/package.json +24 -0
  102. package/dist/fable_modules/fable-library-js.5.0.0-rc.7/quotation.js +618 -0
  103. package/package.json +4 -5
  104. package/packages/FSharp.Oracle/XmlDoc.fs +12 -1
  105. package/packages/FSharp.Oracle/obj/Debug/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.fs +3 -0
  106. package/packages/FSharp.Oracle/obj/Debug/net10.0/FSharp.Oracle.AssemblyInfo.fs +17 -0
  107. package/packages/FSharp.Oracle/obj/Release/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.fs +3 -0
  108. package/packages/FSharp.Oracle/obj/Release/net10.0/FSharp.Oracle.AssemblyInfo.fs +17 -0
  109. package/packages/FSharp.Oracle.Schema/obj/Debug/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.fs +3 -0
  110. package/packages/FSharp.Oracle.Schema/obj/Debug/net10.0/FSharp.Oracle.Schema.AssemblyInfo.fs +17 -0
  111. package/packages/FSharp.Oracle.Schema/obj/Release/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.fs +3 -0
  112. package/packages/FSharp.Oracle.Schema/obj/Release/net10.0/FSharp.Oracle.Schema.AssemblyInfo.fs +17 -0
  113. package/oracle-bin/FSharp.Compiler.Service.dll +0 -0
  114. package/oracle-bin/FSharp.Core.dll +0 -0
  115. package/oracle-bin/FSharp.DependencyManager.Nuget.dll +0 -0
  116. package/oracle-bin/FSharp.Oracle.Schema.dll +0 -0
  117. package/oracle-bin/FSharp.Oracle.Schema.pdb +0 -0
  118. package/oracle-bin/FSharp.Oracle.Schema.xml +0 -219
  119. package/oracle-bin/Fable.Core.dll +0 -0
  120. package/oracle-bin/Oracle +0 -0
  121. package/oracle-bin/Oracle.deps.json +0 -280
  122. package/oracle-bin/Oracle.dll +0 -0
  123. package/oracle-bin/Oracle.pdb +0 -0
  124. package/oracle-bin/Oracle.runtimeconfig.json +0 -13
  125. package/oracle-bin/Oracle.xml +0 -111
  126. package/oracle-bin/Thoth.Json.Core.Auto.dll +0 -0
  127. package/oracle-bin/Thoth.Json.Core.dll +0 -0
  128. package/oracle-bin/Thoth.Json.System.Text.Json.dll +0 -0
  129. package/oracle-bin/cs/FSharp.Compiler.Service.resources.dll +0 -0
  130. package/oracle-bin/cs/FSharp.Core.resources.dll +0 -0
  131. package/oracle-bin/cs/FSharp.DependencyManager.Nuget.resources.dll +0 -0
  132. package/oracle-bin/de/FSharp.Compiler.Service.resources.dll +0 -0
  133. package/oracle-bin/de/FSharp.Core.resources.dll +0 -0
  134. package/oracle-bin/de/FSharp.DependencyManager.Nuget.resources.dll +0 -0
  135. package/oracle-bin/es/FSharp.Compiler.Service.resources.dll +0 -0
  136. package/oracle-bin/es/FSharp.Core.resources.dll +0 -0
  137. package/oracle-bin/es/FSharp.DependencyManager.Nuget.resources.dll +0 -0
  138. package/oracle-bin/fr/FSharp.Compiler.Service.resources.dll +0 -0
  139. package/oracle-bin/fr/FSharp.Core.resources.dll +0 -0
  140. package/oracle-bin/fr/FSharp.DependencyManager.Nuget.resources.dll +0 -0
  141. package/oracle-bin/it/FSharp.Compiler.Service.resources.dll +0 -0
  142. package/oracle-bin/it/FSharp.Core.resources.dll +0 -0
  143. package/oracle-bin/it/FSharp.DependencyManager.Nuget.resources.dll +0 -0
  144. package/oracle-bin/ja/FSharp.Compiler.Service.resources.dll +0 -0
  145. package/oracle-bin/ja/FSharp.Core.resources.dll +0 -0
  146. package/oracle-bin/ja/FSharp.DependencyManager.Nuget.resources.dll +0 -0
  147. package/oracle-bin/ko/FSharp.Compiler.Service.resources.dll +0 -0
  148. package/oracle-bin/ko/FSharp.Core.resources.dll +0 -0
  149. package/oracle-bin/ko/FSharp.DependencyManager.Nuget.resources.dll +0 -0
  150. package/oracle-bin/pl/FSharp.Compiler.Service.resources.dll +0 -0
  151. package/oracle-bin/pl/FSharp.Core.resources.dll +0 -0
  152. package/oracle-bin/pl/FSharp.DependencyManager.Nuget.resources.dll +0 -0
  153. package/oracle-bin/pt-BR/FSharp.Compiler.Service.resources.dll +0 -0
  154. package/oracle-bin/pt-BR/FSharp.Core.resources.dll +0 -0
  155. package/oracle-bin/pt-BR/FSharp.DependencyManager.Nuget.resources.dll +0 -0
  156. package/oracle-bin/ru/FSharp.Compiler.Service.resources.dll +0 -0
  157. package/oracle-bin/ru/FSharp.Core.resources.dll +0 -0
  158. package/oracle-bin/ru/FSharp.DependencyManager.Nuget.resources.dll +0 -0
  159. package/oracle-bin/tr/FSharp.Compiler.Service.resources.dll +0 -0
  160. package/oracle-bin/tr/FSharp.Core.resources.dll +0 -0
  161. package/oracle-bin/tr/FSharp.DependencyManager.Nuget.resources.dll +0 -0
  162. package/oracle-bin/zh-Hans/FSharp.Compiler.Service.resources.dll +0 -0
  163. package/oracle-bin/zh-Hans/FSharp.Core.resources.dll +0 -0
  164. package/oracle-bin/zh-Hans/FSharp.DependencyManager.Nuget.resources.dll +0 -0
  165. package/oracle-bin/zh-Hant/FSharp.Compiler.Service.resources.dll +0 -0
  166. package/oracle-bin/zh-Hant/FSharp.Core.resources.dll +0 -0
  167. package/oracle-bin/zh-Hant/FSharp.DependencyManager.Nuget.resources.dll +0 -0
@@ -0,0 +1,130 @@
1
+ import { Exception, equals } from "./Util.js";
2
+ import { Union } from "./Types.js";
3
+ const CaseRules = {
4
+ None: 0,
5
+ LowerFirst: 1,
6
+ SnakeCase: 2,
7
+ SnakeCaseAllCaps: 3,
8
+ KebabCase: 4,
9
+ LowerAll: 5,
10
+ };
11
+ function dashify(str, separator) {
12
+ return str.replace(/[a-z]?[A-Z]/g, (m) => m.length === 1
13
+ ? m.toLowerCase()
14
+ : m.charAt(0) + separator + m.charAt(1).toLowerCase());
15
+ }
16
+ function changeCase(str, caseRule) {
17
+ switch (caseRule) {
18
+ case CaseRules.LowerFirst:
19
+ return str.charAt(0).toLowerCase() + str.slice(1);
20
+ case CaseRules.SnakeCase:
21
+ return dashify(str, "_");
22
+ case CaseRules.SnakeCaseAllCaps:
23
+ return dashify(str, "_").toUpperCase();
24
+ case CaseRules.KebabCase:
25
+ return dashify(str, "-");
26
+ case CaseRules.LowerAll:
27
+ return str.toLowerCase();
28
+ case CaseRules.None:
29
+ default:
30
+ return str;
31
+ }
32
+ }
33
+ export function keyValueList(fields, caseRule = CaseRules.None) {
34
+ const obj = {};
35
+ const definedCaseRule = caseRule;
36
+ function fail(kvPair) {
37
+ throw new Exception("Cannot infer key and value of " + String(kvPair));
38
+ }
39
+ function assign(key, caseRule, value) {
40
+ key = changeCase(key, caseRule);
41
+ obj[key] = value;
42
+ }
43
+ for (let kvPair of fields) {
44
+ let caseRule = CaseRules.None;
45
+ if (kvPair == null) {
46
+ fail(kvPair);
47
+ }
48
+ // Deflate unions and use the defined case rule
49
+ if (kvPair instanceof Union) {
50
+ const name = kvPair.cases()[kvPair.tag];
51
+ kvPair = kvPair.fields.length === 0 ? name : [name].concat(kvPair.fields);
52
+ caseRule = definedCaseRule;
53
+ }
54
+ if (Array.isArray(kvPair)) {
55
+ switch (kvPair.length) {
56
+ case 0:
57
+ fail(kvPair);
58
+ break;
59
+ case 1:
60
+ assign(kvPair[0], caseRule, true);
61
+ break;
62
+ case 2:
63
+ const value = kvPair[1];
64
+ assign(kvPair[0], caseRule, value);
65
+ break;
66
+ default:
67
+ assign(kvPair[0], caseRule, kvPair.slice(1));
68
+ }
69
+ }
70
+ else if (typeof kvPair === "string") {
71
+ assign(kvPair, caseRule, true);
72
+ }
73
+ else {
74
+ fail(kvPair);
75
+ }
76
+ }
77
+ return obj;
78
+ }
79
+ // TODO: Move these methods to Map and Set modules
80
+ export function containsValue(v, map) {
81
+ for (const kv of map) {
82
+ if (equals(v, kv[1])) {
83
+ return true;
84
+ }
85
+ }
86
+ return false;
87
+ }
88
+ export function tryGetValue(map, key, defaultValue) {
89
+ if (map.has(key)) {
90
+ defaultValue.contents = map.get(key);
91
+ return true;
92
+ }
93
+ return false;
94
+ }
95
+ export function addToSet(v, set) {
96
+ if (set.has(v)) {
97
+ return false;
98
+ }
99
+ set.add(v);
100
+ return true;
101
+ }
102
+ export function tryAddToDict(dict, k, v) {
103
+ if (dict.has(k)) {
104
+ return false;
105
+ }
106
+ dict.set(k, v);
107
+ return true;
108
+ }
109
+ export function addToDict(dict, k, v) {
110
+ if (dict.has(k)) {
111
+ throw new Exception("An item with the same key has already been added. Key: " + k);
112
+ }
113
+ dict.set(k, v);
114
+ }
115
+ export function getItemFromDict(map, key) {
116
+ if (map.has(key)) {
117
+ return map.get(key);
118
+ }
119
+ else {
120
+ throw new Exception(`The given key '${key}' was not present in the dictionary.`);
121
+ }
122
+ }
123
+ export function getItemFromDictOrCreate(map, key, createValue) {
124
+ if (map.has(key)) {
125
+ return map.get(key);
126
+ }
127
+ const value = createValue(key);
128
+ map.set(key, value);
129
+ return value;
130
+ }
@@ -0,0 +1,339 @@
1
+ import { disposeSafe, defaultOf, equals, toIterator, getEnumerator } from "./Util.js";
2
+ import { iterate, map, delay, toArray, iterateIndexed, concat } from "./Seq.js";
3
+ import { value as value_1 } from "./Option.js";
4
+ import { item as item_1, setItem } from "./Array.js";
5
+ import { FSharpRef } from "./Types.js";
6
+ import { class_type } from "./Reflection.js";
7
+ import { getItemFromDict, tryGetValue } from "./MapUtil.js";
8
+ import { KeyNotFoundException_$ctor_Z721C83C5 } from "./System.Collections.Generic.js";
9
+ import { ArgumentException_$ctor_Z721C83C5 } from "./System.js";
10
+ import { format } from "./String.js";
11
+ export class Dictionary {
12
+ constructor(pairs, comparer) {
13
+ const this$ = new FSharpRef(defaultOf());
14
+ this.comparer = comparer;
15
+ this$.contents = this;
16
+ this.hashMap = (new Map([]));
17
+ this["init@9"] = 1;
18
+ const enumerator = getEnumerator(pairs);
19
+ try {
20
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
21
+ const pair = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
22
+ Dictionary__Add_5BDDA1(this$.contents, pair[0], pair[1]);
23
+ }
24
+ }
25
+ finally {
26
+ disposeSafe(enumerator);
27
+ }
28
+ }
29
+ get [Symbol.toStringTag]() {
30
+ return "Dictionary";
31
+ }
32
+ toJSON() {
33
+ const this$ = this;
34
+ return Array.from(this$);
35
+ }
36
+ "System.Collections.IEnumerable.GetEnumerator"() {
37
+ const this$ = this;
38
+ return getEnumerator(this$);
39
+ }
40
+ GetEnumerator() {
41
+ const this$ = this;
42
+ return getEnumerator(concat(this$.hashMap.values()));
43
+ }
44
+ [Symbol.iterator]() {
45
+ return toIterator(getEnumerator(this));
46
+ }
47
+ "System.Collections.Generic.ICollection`1.Add2B595"(item) {
48
+ const this$ = this;
49
+ Dictionary__Add_5BDDA1(this$, item[0], item[1]);
50
+ }
51
+ "System.Collections.Generic.ICollection`1.Clear"() {
52
+ const this$ = this;
53
+ Dictionary__Clear(this$);
54
+ }
55
+ "System.Collections.Generic.ICollection`1.Contains2B595"(item) {
56
+ const this$ = this;
57
+ const matchValue = Dictionary__TryFind_2B595(this$, item[0]);
58
+ let matchResult = undefined, pair_1 = undefined;
59
+ if (matchValue != null) {
60
+ if (equals(value_1(matchValue)[1], item[1])) {
61
+ matchResult = 0;
62
+ pair_1 = value_1(matchValue);
63
+ }
64
+ else {
65
+ matchResult = 1;
66
+ }
67
+ }
68
+ else {
69
+ matchResult = 1;
70
+ }
71
+ switch (matchResult) {
72
+ case 0:
73
+ return true;
74
+ default:
75
+ return false;
76
+ }
77
+ }
78
+ "System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(array, arrayIndex) {
79
+ const this$ = this;
80
+ iterateIndexed((i, e) => {
81
+ setItem(array, arrayIndex + i, e);
82
+ }, this$);
83
+ }
84
+ "System.Collections.Generic.ICollection`1.get_Count"() {
85
+ const this$ = this;
86
+ return Dictionary__get_Count(this$) | 0;
87
+ }
88
+ "System.Collections.Generic.ICollection`1.get_IsReadOnly"() {
89
+ return false;
90
+ }
91
+ "System.Collections.Generic.ICollection`1.Remove2B595"(item) {
92
+ const this$ = this;
93
+ const matchValue = Dictionary__TryFind_2B595(this$, item[0]);
94
+ let matchResult = undefined, pair_1 = undefined;
95
+ if (matchValue != null) {
96
+ if (equals(value_1(matchValue)[1], item[1])) {
97
+ matchResult = 0;
98
+ pair_1 = value_1(matchValue);
99
+ }
100
+ else {
101
+ matchResult = 1;
102
+ }
103
+ }
104
+ else {
105
+ matchResult = 1;
106
+ }
107
+ switch (matchResult) {
108
+ case 0:
109
+ return Dictionary__Remove_2B595(this$, item[0]);
110
+ default:
111
+ return false;
112
+ }
113
+ }
114
+ "System.Collections.Generic.IDictionary`2.Add5BDDA1"(key, value) {
115
+ const this$ = this;
116
+ Dictionary__Add_5BDDA1(this$, key, value);
117
+ }
118
+ "System.Collections.Generic.IDictionary`2.ContainsKey2B595"(key) {
119
+ const this$ = this;
120
+ return Dictionary__ContainsKey_2B595(this$, key);
121
+ }
122
+ "System.Collections.Generic.IDictionary`2.get_Item2B595"(key) {
123
+ const this$ = this;
124
+ return Dictionary__get_Item_2B595(this$, key);
125
+ }
126
+ "System.Collections.Generic.IDictionary`2.set_Item5BDDA1"(key, v) {
127
+ const this$ = this;
128
+ Dictionary__set_Item_5BDDA1(this$, key, v);
129
+ }
130
+ "System.Collections.Generic.IDictionary`2.get_Keys"() {
131
+ const this$ = this;
132
+ return toArray(delay(() => map((pair) => pair[0], this$)));
133
+ }
134
+ "System.Collections.Generic.IDictionary`2.Remove2B595"(key) {
135
+ const this$ = this;
136
+ return Dictionary__Remove_2B595(this$, key);
137
+ }
138
+ "System.Collections.Generic.IDictionary`2.TryGetValue6DC89625"(key, value) {
139
+ const this$ = this;
140
+ const matchValue = Dictionary__TryFind_2B595(this$, key);
141
+ if (matchValue != null) {
142
+ const pair = value_1(matchValue);
143
+ value.contents = pair[1];
144
+ return true;
145
+ }
146
+ else {
147
+ return false;
148
+ }
149
+ }
150
+ "System.Collections.Generic.IDictionary`2.get_Values"() {
151
+ const this$ = this;
152
+ return toArray(delay(() => map((pair) => pair[1], this$)));
153
+ }
154
+ get size() {
155
+ const this$ = this;
156
+ return Dictionary__get_Count(this$) | 0;
157
+ }
158
+ clear() {
159
+ const this$ = this;
160
+ Dictionary__Clear(this$);
161
+ }
162
+ delete(k) {
163
+ const this$ = this;
164
+ return Dictionary__Remove_2B595(this$, k);
165
+ }
166
+ entries() {
167
+ const this$ = this;
168
+ return map((p) => [p[0], p[1]], this$);
169
+ }
170
+ get(k) {
171
+ const this$ = this;
172
+ return Dictionary__get_Item_2B595(this$, k);
173
+ }
174
+ has(k) {
175
+ const this$ = this;
176
+ return Dictionary__ContainsKey_2B595(this$, k);
177
+ }
178
+ keys() {
179
+ const this$ = this;
180
+ return map((p) => p[0], this$);
181
+ }
182
+ set(k, v) {
183
+ const this$ = this;
184
+ Dictionary__set_Item_5BDDA1(this$, k, v);
185
+ return this$;
186
+ }
187
+ values() {
188
+ const this$ = this;
189
+ return map((p) => p[1], this$);
190
+ }
191
+ forEach(f, thisArg) {
192
+ const this$ = this;
193
+ iterate((p) => {
194
+ f(p[1], p[0], this$);
195
+ }, this$);
196
+ }
197
+ }
198
+ export function Dictionary_$reflection(gen0, gen1) {
199
+ return class_type("Fable.Collections.Dictionary", [gen0, gen1], Dictionary);
200
+ }
201
+ export function Dictionary_$ctor_6623D9B3(pairs, comparer) {
202
+ return new Dictionary(pairs, comparer);
203
+ }
204
+ function Dictionary__TryFindIndex_2B595(this$, k) {
205
+ const h = this$.comparer.GetHashCode(k) | 0;
206
+ let matchValue;
207
+ let outArg = defaultOf();
208
+ matchValue = [tryGetValue(this$.hashMap, h, new FSharpRef(() => outArg, (v) => {
209
+ outArg = v;
210
+ })), outArg];
211
+ if (matchValue[0]) {
212
+ return [true, h, matchValue[1].findIndex((pair) => this$.comparer.Equals(k, pair[0]))];
213
+ }
214
+ else {
215
+ return [false, h, -1];
216
+ }
217
+ }
218
+ export function Dictionary__TryFind_2B595(this$, k) {
219
+ const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
220
+ let matchResult = undefined;
221
+ if (matchValue[0]) {
222
+ if (matchValue[2] > -1) {
223
+ matchResult = 0;
224
+ }
225
+ else {
226
+ matchResult = 1;
227
+ }
228
+ }
229
+ else {
230
+ matchResult = 1;
231
+ }
232
+ switch (matchResult) {
233
+ case 0:
234
+ return item_1(matchValue[2], getItemFromDict(this$.hashMap, matchValue[1]));
235
+ default:
236
+ return undefined;
237
+ }
238
+ }
239
+ export function Dictionary__get_Comparer(this$) {
240
+ return this$.comparer;
241
+ }
242
+ export function Dictionary__Clear(this$) {
243
+ this$.hashMap.clear();
244
+ }
245
+ export function Dictionary__get_Count(this$) {
246
+ let count = 0;
247
+ let enumerator = getEnumerator(this$.hashMap.values());
248
+ try {
249
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
250
+ const pairs = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
251
+ count = ((count + pairs.length) | 0);
252
+ }
253
+ }
254
+ finally {
255
+ disposeSafe(enumerator);
256
+ }
257
+ return count | 0;
258
+ }
259
+ export function Dictionary__get_Item_2B595(this$, k) {
260
+ const matchValue = Dictionary__TryFind_2B595(this$, k);
261
+ if (matchValue != null) {
262
+ return value_1(matchValue)[1];
263
+ }
264
+ else {
265
+ throw KeyNotFoundException_$ctor_Z721C83C5("The item was not found in collection");
266
+ }
267
+ }
268
+ export function Dictionary__set_Item_5BDDA1(this$, k, v) {
269
+ const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
270
+ if (matchValue[0]) {
271
+ if (matchValue[2] > -1) {
272
+ setItem(getItemFromDict(this$.hashMap, matchValue[1]), matchValue[2], [k, v]);
273
+ }
274
+ else {
275
+ const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));
276
+ }
277
+ }
278
+ else {
279
+ this$.hashMap.set(matchValue[1], [[k, v]]);
280
+ }
281
+ }
282
+ export function Dictionary__Add_5BDDA1(this$, k, v) {
283
+ const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
284
+ if (matchValue[0]) {
285
+ if (matchValue[2] > -1) {
286
+ throw ArgumentException_$ctor_Z721C83C5(format("An item with the same key has already been added. Key: {0}", k));
287
+ }
288
+ else {
289
+ const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));
290
+ }
291
+ }
292
+ else {
293
+ this$.hashMap.set(matchValue[1], [[k, v]]);
294
+ }
295
+ }
296
+ export function Dictionary__ContainsKey_2B595(this$, k) {
297
+ const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
298
+ let matchResult = undefined;
299
+ if (matchValue[0]) {
300
+ if (matchValue[2] > -1) {
301
+ matchResult = 0;
302
+ }
303
+ else {
304
+ matchResult = 1;
305
+ }
306
+ }
307
+ else {
308
+ matchResult = 1;
309
+ }
310
+ switch (matchResult) {
311
+ case 0:
312
+ return true;
313
+ default:
314
+ return false;
315
+ }
316
+ }
317
+ export function Dictionary__Remove_2B595(this$, k) {
318
+ const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
319
+ let matchResult = undefined;
320
+ if (matchValue[0]) {
321
+ if (matchValue[2] > -1) {
322
+ matchResult = 0;
323
+ }
324
+ else {
325
+ matchResult = 1;
326
+ }
327
+ }
328
+ else {
329
+ matchResult = 1;
330
+ }
331
+ switch (matchResult) {
332
+ case 0: {
333
+ getItemFromDict(this$.hashMap, matchValue[1]).splice(matchValue[2], 1);
334
+ return true;
335
+ }
336
+ default:
337
+ return false;
338
+ }
339
+ }
@@ -0,0 +1,233 @@
1
+ import { disposeSafe, defaultOf, toIterator, getEnumerator } from "./Util.js";
2
+ import { iterate, map, iterateIndexed, concat } from "./Seq.js";
3
+ import { item as item_1, setItem } from "./Array.js";
4
+ import { some } from "./Option.js";
5
+ import { FSharpRef } from "./Types.js";
6
+ import { class_type } from "./Reflection.js";
7
+ import { getItemFromDict, tryGetValue } from "./MapUtil.js";
8
+ export class HashSet {
9
+ constructor(items, comparer) {
10
+ const this$ = new FSharpRef(defaultOf());
11
+ this.comparer = comparer;
12
+ this$.contents = this;
13
+ this.hashMap = (new Map([]));
14
+ this["init@9"] = 1;
15
+ const enumerator = getEnumerator(items);
16
+ try {
17
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
18
+ const item = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
19
+ HashSet__Add_2B595(this$.contents, item);
20
+ }
21
+ }
22
+ finally {
23
+ disposeSafe(enumerator);
24
+ }
25
+ }
26
+ get [Symbol.toStringTag]() {
27
+ return "HashSet";
28
+ }
29
+ toJSON() {
30
+ const this$ = this;
31
+ return Array.from(this$);
32
+ }
33
+ "System.Collections.IEnumerable.GetEnumerator"() {
34
+ const this$ = this;
35
+ return getEnumerator(this$);
36
+ }
37
+ GetEnumerator() {
38
+ const this$ = this;
39
+ return getEnumerator(concat(this$.hashMap.values()));
40
+ }
41
+ [Symbol.iterator]() {
42
+ return toIterator(getEnumerator(this));
43
+ }
44
+ "System.Collections.Generic.ICollection`1.Add2B595"(item) {
45
+ const this$ = this;
46
+ HashSet__Add_2B595(this$, item);
47
+ }
48
+ "System.Collections.Generic.ICollection`1.Clear"() {
49
+ const this$ = this;
50
+ HashSet__Clear(this$);
51
+ }
52
+ "System.Collections.Generic.ICollection`1.Contains2B595"(item) {
53
+ const this$ = this;
54
+ return HashSet__Contains_2B595(this$, item);
55
+ }
56
+ "System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"(array, arrayIndex) {
57
+ const this$ = this;
58
+ iterateIndexed((i, e) => {
59
+ setItem(array, arrayIndex + i, e);
60
+ }, this$);
61
+ }
62
+ "System.Collections.Generic.ICollection`1.get_Count"() {
63
+ const this$ = this;
64
+ return HashSet__get_Count(this$) | 0;
65
+ }
66
+ "System.Collections.Generic.ICollection`1.get_IsReadOnly"() {
67
+ return false;
68
+ }
69
+ "System.Collections.Generic.ICollection`1.Remove2B595"(item) {
70
+ const this$ = this;
71
+ return HashSet__Remove_2B595(this$, item);
72
+ }
73
+ get size() {
74
+ const this$ = this;
75
+ return HashSet__get_Count(this$) | 0;
76
+ }
77
+ add(k) {
78
+ const this$ = this;
79
+ HashSet__Add_2B595(this$, k);
80
+ return this$;
81
+ }
82
+ clear() {
83
+ const this$ = this;
84
+ HashSet__Clear(this$);
85
+ }
86
+ delete(k) {
87
+ const this$ = this;
88
+ return HashSet__Remove_2B595(this$, k);
89
+ }
90
+ has(k) {
91
+ const this$ = this;
92
+ return HashSet__Contains_2B595(this$, k);
93
+ }
94
+ keys() {
95
+ const this$ = this;
96
+ return map((x) => x, this$);
97
+ }
98
+ values() {
99
+ const this$ = this;
100
+ return map((x) => x, this$);
101
+ }
102
+ entries() {
103
+ const this$ = this;
104
+ return map((v) => [v, v], this$);
105
+ }
106
+ forEach(f, thisArg) {
107
+ const this$ = this;
108
+ iterate((x) => {
109
+ f(x, x, this$);
110
+ }, this$);
111
+ }
112
+ }
113
+ export function HashSet_$reflection(gen0) {
114
+ return class_type("Fable.Collections.HashSet", [gen0], HashSet);
115
+ }
116
+ export function HashSet_$ctor_Z6150332D(items, comparer) {
117
+ return new HashSet(items, comparer);
118
+ }
119
+ function HashSet__TryFindIndex_2B595(this$, k) {
120
+ const h = this$.comparer.GetHashCode(k) | 0;
121
+ let matchValue;
122
+ let outArg = defaultOf();
123
+ matchValue = [tryGetValue(this$.hashMap, h, new FSharpRef(() => outArg, (v) => {
124
+ outArg = v;
125
+ })), outArg];
126
+ if (matchValue[0]) {
127
+ return [true, h, matchValue[1].findIndex((v_1) => this$.comparer.Equals(k, v_1))];
128
+ }
129
+ else {
130
+ return [false, h, -1];
131
+ }
132
+ }
133
+ function HashSet__TryFind_2B595(this$, k) {
134
+ const matchValue = HashSet__TryFindIndex_2B595(this$, k);
135
+ let matchResult = undefined;
136
+ if (matchValue[0]) {
137
+ if (matchValue[2] > -1) {
138
+ matchResult = 0;
139
+ }
140
+ else {
141
+ matchResult = 1;
142
+ }
143
+ }
144
+ else {
145
+ matchResult = 1;
146
+ }
147
+ switch (matchResult) {
148
+ case 0:
149
+ return some(item_1(matchValue[2], getItemFromDict(this$.hashMap, matchValue[1])));
150
+ default:
151
+ return undefined;
152
+ }
153
+ }
154
+ export function HashSet__get_Comparer(this$) {
155
+ return this$.comparer;
156
+ }
157
+ export function HashSet__Clear(this$) {
158
+ this$.hashMap.clear();
159
+ }
160
+ export function HashSet__get_Count(this$) {
161
+ let count = 0;
162
+ let enumerator = getEnumerator(this$.hashMap.values());
163
+ try {
164
+ while (enumerator["System.Collections.IEnumerator.MoveNext"]()) {
165
+ const items = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
166
+ count = ((count + items.length) | 0);
167
+ }
168
+ }
169
+ finally {
170
+ disposeSafe(enumerator);
171
+ }
172
+ return count | 0;
173
+ }
174
+ export function HashSet__Add_2B595(this$, k) {
175
+ const matchValue = HashSet__TryFindIndex_2B595(this$, k);
176
+ if (matchValue[0]) {
177
+ if (matchValue[2] > -1) {
178
+ return false;
179
+ }
180
+ else {
181
+ const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push(k));
182
+ return true;
183
+ }
184
+ }
185
+ else {
186
+ this$.hashMap.set(matchValue[1], [k]);
187
+ return true;
188
+ }
189
+ }
190
+ export function HashSet__Contains_2B595(this$, k) {
191
+ const matchValue = HashSet__TryFindIndex_2B595(this$, k);
192
+ let matchResult = undefined;
193
+ if (matchValue[0]) {
194
+ if (matchValue[2] > -1) {
195
+ matchResult = 0;
196
+ }
197
+ else {
198
+ matchResult = 1;
199
+ }
200
+ }
201
+ else {
202
+ matchResult = 1;
203
+ }
204
+ switch (matchResult) {
205
+ case 0:
206
+ return true;
207
+ default:
208
+ return false;
209
+ }
210
+ }
211
+ export function HashSet__Remove_2B595(this$, k) {
212
+ const matchValue = HashSet__TryFindIndex_2B595(this$, k);
213
+ let matchResult = undefined;
214
+ if (matchValue[0]) {
215
+ if (matchValue[2] > -1) {
216
+ matchResult = 0;
217
+ }
218
+ else {
219
+ matchResult = 1;
220
+ }
221
+ }
222
+ else {
223
+ matchResult = 1;
224
+ }
225
+ switch (matchResult) {
226
+ case 0: {
227
+ getItemFromDict(this$.hashMap, matchValue[1]).splice(matchValue[2], 1);
228
+ return true;
229
+ }
230
+ default:
231
+ return false;
232
+ }
233
+ }
@@ -0,0 +1,14 @@
1
+ export function Helpers_allocateArrayFromCons(cons, len) {
2
+ if (cons == null) {
3
+ return new Array(len);
4
+ }
5
+ else {
6
+ const cons_1 = cons;
7
+ if ((typeof cons_1) === "function") {
8
+ return new cons_1(len);
9
+ }
10
+ else {
11
+ return new Array(len);
12
+ }
13
+ }
14
+ }