@glutinum/cli 0.14.0 → 0.14.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 (144) hide show
  1. package/dist/fable_modules/Fable.Promise.3.2.1/AsyncIterable.fs +89 -0
  2. package/dist/fable_modules/Fable.Promise.3.2.1/AsyncIterable.fs.js +105 -0
  3. package/dist/fable_modules/Fable.Promise.3.2.1/Fable.Promise.fableproj +25 -0
  4. package/dist/fable_modules/Fable.Promise.3.2.1/Promise.fs +842 -0
  5. package/dist/fable_modules/Fable.Promise.3.2.1/Promise.fs.js +232 -0
  6. package/dist/fable_modules/Fable.Promise.3.2.1/PromiseImpl.fs +31 -0
  7. package/dist/fable_modules/Fable.Promise.3.2.1/PromiseImpl.fs.js +20 -0
  8. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Array.fs +235 -0
  9. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Array.fs.js +384 -0
  10. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AssemblyInfo.fs +19 -0
  11. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Async.fs +287 -0
  12. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Async.fs.js +128 -0
  13. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncOption.fs +127 -0
  14. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncOptionCE.fs +174 -0
  15. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncOptionCE.fs.js +37 -0
  16. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncOptionOp.fs +24 -0
  17. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResult.fs +483 -0
  18. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultCE.fs +201 -0
  19. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultCE.fs.js +18 -0
  20. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultOp.fs +24 -0
  21. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultOption.fs +87 -0
  22. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultOption.fs.js +26 -0
  23. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultOptionCE.fs +236 -0
  24. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultOptionCE.fs.js +18 -0
  25. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultOptionOp.fs +24 -0
  26. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncValidation.fs +185 -0
  27. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncValidationCE.fs +186 -0
  28. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncValidationCE.fs.js +18 -0
  29. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncValidationOp.fs +35 -0
  30. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/FsToolkit.ErrorHandling.fableproj +69 -0
  31. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/List.fs +276 -0
  32. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/List.fs.js +364 -0
  33. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Nullness.fs +81 -0
  34. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Option.fs +462 -0
  35. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionCE.fs +139 -0
  36. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionCE.fs.js +48 -0
  37. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionOp.fs +21 -0
  38. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResult.fs +88 -0
  39. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResult.fs.js +30 -0
  40. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResultCE.fs +200 -0
  41. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResultCE.fs.js +18 -0
  42. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidation.fs +34 -0
  43. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidationCE.fs +244 -0
  44. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidationCE.fs.js +18 -0
  45. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Result.fs +731 -0
  46. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Result.fs.js +45 -0
  47. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ResultCE.fs +140 -0
  48. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ResultCE.fs.js +23 -0
  49. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ResultOp.fs +45 -0
  50. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ResultOption.fs +201 -0
  51. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ResultOption.fs.js +65 -0
  52. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ResultOptionCE.fs +135 -0
  53. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ResultOptionCE.fs.js +18 -0
  54. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ResultOptionOp.fs +57 -0
  55. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Seq.fs +503 -0
  56. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Seq.fs.js +295 -0
  57. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Validation.fs +167 -0
  58. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValidationCE.fs +142 -0
  59. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValidationCE.fs.js +18 -0
  60. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValidationOp.fs +35 -0
  61. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueOption.fs +148 -0
  62. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOption.fs +102 -0
  63. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOptionCE.fs +587 -0
  64. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOptionOp.fs +10 -0
  65. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +3 -0
  66. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Debug/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +20 -0
  67. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.fs +3 -0
  68. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/net9.0/FsToolkit.ErrorHandling.AssemblyInfo.fs +20 -0
  69. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +3 -0
  70. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/netstandard2.0/FsToolkit.ErrorHandling.AssemblyInfo.fs +20 -0
  71. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +3 -0
  72. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +20 -0
  73. package/dist/fable_modules/fable-library-js.5.17.2/Array.js +1348 -0
  74. package/dist/fable_modules/fable-library-js.5.17.2/Async.js +163 -0
  75. package/dist/fable_modules/fable-library-js.5.17.2/AsyncBuilder.js +204 -0
  76. package/dist/fable_modules/fable-library-js.5.17.2/BigInt.js +307 -0
  77. package/dist/fable_modules/fable-library-js.5.17.2/BitConverter.js +138 -0
  78. package/dist/fable_modules/fable-library-js.5.17.2/Boolean.js +22 -0
  79. package/dist/fable_modules/fable-library-js.5.17.2/CHANGELOG.md +348 -0
  80. package/dist/fable_modules/fable-library-js.5.17.2/Char.js +202 -0
  81. package/dist/fable_modules/fable-library-js.5.17.2/Choice.js +184 -0
  82. package/dist/fable_modules/fable-library-js.5.17.2/CollectionUtil.js +182 -0
  83. package/dist/fable_modules/fable-library-js.5.17.2/ConditionalWeakTable.js +21 -0
  84. package/dist/fable_modules/fable-library-js.5.17.2/Date.js +834 -0
  85. package/dist/fable_modules/fable-library-js.5.17.2/DateOffset.js +252 -0
  86. package/dist/fable_modules/fable-library-js.5.17.2/DateOnly.js +124 -0
  87. package/dist/fable_modules/fable-library-js.5.17.2/DateOnlyTemporal.js +146 -0
  88. package/dist/fable_modules/fable-library-js.5.17.2/DateTimeFormat.js +523 -0
  89. package/dist/fable_modules/fable-library-js.5.17.2/DateTimeOffsetTemporal.js +283 -0
  90. package/dist/fable_modules/fable-library-js.5.17.2/DateTimeTemporal.js +243 -0
  91. package/dist/fable_modules/fable-library-js.5.17.2/Decimal.js +238 -0
  92. package/dist/fable_modules/fable-library-js.5.17.2/Directory.js +11 -0
  93. package/dist/fable_modules/fable-library-js.5.17.2/Double.js +53 -0
  94. package/dist/fable_modules/fable-library-js.5.17.2/Encoding.js +185 -0
  95. package/dist/fable_modules/fable-library-js.5.17.2/Environment.js +3 -0
  96. package/dist/fable_modules/fable-library-js.5.17.2/Event.js +102 -0
  97. package/dist/fable_modules/fable-library-js.5.17.2/FSharp.Collections.js +45 -0
  98. package/dist/fable_modules/fable-library-js.5.17.2/FSharp.Core.CompilerServices.js +27 -0
  99. package/dist/fable_modules/fable-library-js.5.17.2/FSharp.Core.js +156 -0
  100. package/dist/fable_modules/fable-library-js.5.17.2/File.js +27 -0
  101. package/dist/fable_modules/fable-library-js.5.17.2/Global.js +29 -0
  102. package/dist/fable_modules/fable-library-js.5.17.2/Guid.js +163 -0
  103. package/dist/fable_modules/fable-library-js.5.17.2/Int32.js +135 -0
  104. package/dist/fable_modules/fable-library-js.5.17.2/List.js +1337 -0
  105. package/dist/fable_modules/fable-library-js.5.17.2/Long.js +38 -0
  106. package/dist/fable_modules/fable-library-js.5.17.2/MailboxProcessor.js +100 -0
  107. package/dist/fable_modules/fable-library-js.5.17.2/Map.js +1400 -0
  108. package/dist/fable_modules/fable-library-js.5.17.2/MapUtil.js +130 -0
  109. package/dist/fable_modules/fable-library-js.5.17.2/MutableMap.js +339 -0
  110. package/dist/fable_modules/fable-library-js.5.17.2/MutableSet.js +233 -0
  111. package/dist/fable_modules/fable-library-js.5.17.2/Native.js +14 -0
  112. package/dist/fable_modules/fable-library-js.5.17.2/Numeric.js +112 -0
  113. package/dist/fable_modules/fable-library-js.5.17.2/Observable.js +115 -0
  114. package/dist/fable_modules/fable-library-js.5.17.2/Option.js +87 -0
  115. package/dist/fable_modules/fable-library-js.5.17.2/Path.js +31 -0
  116. package/dist/fable_modules/fable-library-js.5.17.2/README.md +3 -0
  117. package/dist/fable_modules/fable-library-js.5.17.2/Random.js +172 -0
  118. package/dist/fable_modules/fable-library-js.5.17.2/Range.js +45 -0
  119. package/dist/fable_modules/fable-library-js.5.17.2/Reflection.js +489 -0
  120. package/dist/fable_modules/fable-library-js.5.17.2/RegExp.js +170 -0
  121. package/dist/fable_modules/fable-library-js.5.17.2/Result.js +165 -0
  122. package/dist/fable_modules/fable-library-js.5.17.2/Seq.js +1504 -0
  123. package/dist/fable_modules/fable-library-js.5.17.2/Seq2.js +111 -0
  124. package/dist/fable_modules/fable-library-js.5.17.2/Set.js +1829 -0
  125. package/dist/fable_modules/fable-library-js.5.17.2/String.js +731 -0
  126. package/dist/fable_modules/fable-library-js.5.17.2/System.Collections.Generic.js +333 -0
  127. package/dist/fable_modules/fable-library-js.5.17.2/System.Text.js +200 -0
  128. package/dist/fable_modules/fable-library-js.5.17.2/System.js +289 -0
  129. package/dist/fable_modules/fable-library-js.5.17.2/Task.js +27 -0
  130. package/dist/fable_modules/fable-library-js.5.17.2/TaskBuilder.js +72 -0
  131. package/dist/fable_modules/fable-library-js.5.17.2/TimeOnly.js +122 -0
  132. package/dist/fable_modules/fable-library-js.5.17.2/TimeOnlyTemporal.js +142 -0
  133. package/dist/fable_modules/fable-library-js.5.17.2/TimeSpan.js +180 -0
  134. package/dist/fable_modules/fable-library-js.5.17.2/TimeSpanTemporal.js +259 -0
  135. package/dist/fable_modules/fable-library-js.5.17.2/Timer.js +67 -0
  136. package/dist/fable_modules/fable-library-js.5.17.2/Types.js +198 -0
  137. package/dist/fable_modules/fable-library-js.5.17.2/Unicode.13.0.0.js +4 -0
  138. package/dist/fable_modules/fable-library-js.5.17.2/Uri.js +165 -0
  139. package/dist/fable_modules/fable-library-js.5.17.2/Util.js +807 -0
  140. package/dist/fable_modules/fable-library-js.5.17.2/big.d.ts +338 -0
  141. package/dist/fable_modules/fable-library-js.5.17.2/lib/big.js +829 -0
  142. package/dist/fable_modules/fable-library-js.5.17.2/package.json +24 -0
  143. package/dist/fable_modules/fable-library-js.5.17.2/quotation.js +682 -0
  144. package/package.json +1 -1
@@ -0,0 +1,202 @@
1
+ import * as Unicode from "./Unicode.13.0.0.js";
2
+ import { Exception } from "./Util.js";
3
+ function getCategoryFunc() {
4
+ // unpack Unicode codepoint ranges (delta encoded) and general categories
5
+ const offset = 35; // offsets unprintable characters
6
+ const a1 = [...Unicode.rangeDeltas].map((ch) => (ch.codePointAt(0) ?? 0) - offset);
7
+ const a2 = [...Unicode.categories].map((ch) => (ch.codePointAt(0) ?? 0) - offset);
8
+ const codepoints = new Uint32Array(a1);
9
+ const categories = new Uint8Array(a2);
10
+ for (let i = 1; i < codepoints.length; ++i) {
11
+ codepoints[i] += codepoints[i - 1];
12
+ }
13
+ // binary search in unicode ranges
14
+ return (cp) => {
15
+ let hi = codepoints.length;
16
+ let lo = 0;
17
+ while (hi - lo > 1) {
18
+ const mid = Math.floor((hi + lo) / 2);
19
+ const test = codepoints[mid];
20
+ if (cp < test) {
21
+ hi = mid;
22
+ }
23
+ else if (cp === test) {
24
+ hi = lo = mid;
25
+ break;
26
+ }
27
+ else if (test < cp) {
28
+ lo = mid;
29
+ }
30
+ }
31
+ return categories[lo];
32
+ };
33
+ }
34
+ export const UnicodeCategory = {
35
+ UppercaseLetter: 0,
36
+ LowercaseLetter: 1,
37
+ TitlecaseLetter: 2,
38
+ ModifierLetter: 3,
39
+ OtherLetter: 4,
40
+ NonSpacingMark: 5,
41
+ SpacingCombiningMark: 6,
42
+ EnclosingMark: 7,
43
+ DecimalDigitNumber: 8,
44
+ LetterNumber: 9,
45
+ OtherNumber: 10,
46
+ SpaceSeparator: 11,
47
+ LineSeparator: 12,
48
+ ParagraphSeparator: 13,
49
+ Control: 14,
50
+ Format: 15,
51
+ Surrogate: 16,
52
+ PrivateUse: 17,
53
+ ConnectorPunctuation: 18,
54
+ DashPunctuation: 19,
55
+ OpenPunctuation: 20,
56
+ ClosePunctuation: 21,
57
+ InitialQuotePunctuation: 22,
58
+ FinalQuotePunctuation: 23,
59
+ OtherPunctuation: 24,
60
+ MathSymbol: 25,
61
+ CurrencySymbol: 26,
62
+ ModifierSymbol: 27,
63
+ OtherSymbol: 28,
64
+ OtherNotAssigned: 29,
65
+ };
66
+ const isControlMask = 1 << UnicodeCategory.Control;
67
+ const isDigitMask = 1 << UnicodeCategory.DecimalDigitNumber;
68
+ const isLetterMask = 0
69
+ | 1 << UnicodeCategory.UppercaseLetter
70
+ | 1 << UnicodeCategory.LowercaseLetter
71
+ | 1 << UnicodeCategory.TitlecaseLetter
72
+ | 1 << UnicodeCategory.ModifierLetter
73
+ | 1 << UnicodeCategory.OtherLetter;
74
+ const isLetterOrDigitMask = isLetterMask | isDigitMask;
75
+ const isUpperMask = 1 << UnicodeCategory.UppercaseLetter;
76
+ const isLowerMask = 1 << UnicodeCategory.LowercaseLetter;
77
+ const isNumberMask = 0
78
+ | 1 << UnicodeCategory.DecimalDigitNumber
79
+ | 1 << UnicodeCategory.LetterNumber
80
+ | 1 << UnicodeCategory.OtherNumber;
81
+ const isPunctuationMask = 0
82
+ | 1 << UnicodeCategory.ConnectorPunctuation
83
+ | 1 << UnicodeCategory.DashPunctuation
84
+ | 1 << UnicodeCategory.OpenPunctuation
85
+ | 1 << UnicodeCategory.ClosePunctuation
86
+ | 1 << UnicodeCategory.InitialQuotePunctuation
87
+ | 1 << UnicodeCategory.FinalQuotePunctuation
88
+ | 1 << UnicodeCategory.OtherPunctuation;
89
+ const isSeparatorMask = 0
90
+ | 1 << UnicodeCategory.SpaceSeparator
91
+ | 1 << UnicodeCategory.LineSeparator
92
+ | 1 << UnicodeCategory.ParagraphSeparator;
93
+ const isSymbolMask = 0
94
+ | 1 << UnicodeCategory.MathSymbol
95
+ | 1 << UnicodeCategory.CurrencySymbol
96
+ | 1 << UnicodeCategory.ModifierSymbol
97
+ | 1 << UnicodeCategory.OtherSymbol;
98
+ const isWhiteSpaceMask = 0
99
+ | 1 << UnicodeCategory.SpaceSeparator
100
+ | 1 << UnicodeCategory.LineSeparator
101
+ | 1 << UnicodeCategory.ParagraphSeparator;
102
+ const unicodeCategoryFunc = getCategoryFunc();
103
+ function charCodeAt(s, index) {
104
+ if (index >= 0 && index < s.length) {
105
+ return s.charCodeAt(index);
106
+ }
107
+ else {
108
+ throw new Exception("Index out of range.");
109
+ }
110
+ }
111
+ export const getUnicodeCategory = (s) => getUnicodeCategory2(s, 0);
112
+ export const isControl = (s) => isControl2(s, 0);
113
+ export const isDigit = (s) => isDigit2(s, 0);
114
+ export const isLetter = (s) => isLetter2(s, 0);
115
+ export const isLetterOrDigit = (s) => isLetterOrDigit2(s, 0);
116
+ export const isUpper = (s) => isUpper2(s, 0);
117
+ export const isLower = (s) => isLower2(s, 0);
118
+ export const isNumber = (s) => isNumber2(s, 0);
119
+ export const isPunctuation = (s) => isPunctuation2(s, 0);
120
+ export const isSeparator = (s) => isSeparator2(s, 0);
121
+ export const isSymbol = (s) => isSymbol2(s, 0);
122
+ export const isWhiteSpace = (s) => isWhiteSpace2(s, 0);
123
+ export const isHighSurrogate = (s) => isHighSurrogate2(s, 0);
124
+ export const isLowSurrogate = (s) => isLowSurrogate2(s, 0);
125
+ export const isSurrogate = (s) => isSurrogate2(s, 0);
126
+ export function getUnicodeCategory2(s, index) {
127
+ const cp = charCodeAt(s, index);
128
+ return unicodeCategoryFunc(cp);
129
+ }
130
+ export function isControl2(s, index) {
131
+ const test = 1 << getUnicodeCategory2(s, index);
132
+ return (test & isControlMask) !== 0;
133
+ }
134
+ export function isDigit2(s, index) {
135
+ const test = 1 << getUnicodeCategory2(s, index);
136
+ return (test & isDigitMask) !== 0;
137
+ }
138
+ export function isLetter2(s, index) {
139
+ const test = 1 << getUnicodeCategory2(s, index);
140
+ return (test & isLetterMask) !== 0;
141
+ }
142
+ export function isLetterOrDigit2(s, index) {
143
+ const test = 1 << getUnicodeCategory2(s, index);
144
+ return (test & isLetterOrDigitMask) !== 0;
145
+ }
146
+ export function isUpper2(s, index) {
147
+ const test = 1 << getUnicodeCategory2(s, index);
148
+ return (test & isUpperMask) !== 0;
149
+ }
150
+ export function isLower2(s, index) {
151
+ const test = 1 << getUnicodeCategory2(s, index);
152
+ return (test & isLowerMask) !== 0;
153
+ }
154
+ export function isNumber2(s, index) {
155
+ const test = 1 << getUnicodeCategory2(s, index);
156
+ return (test & isNumberMask) !== 0;
157
+ }
158
+ export function isPunctuation2(s, index) {
159
+ const test = 1 << getUnicodeCategory2(s, index);
160
+ return (test & isPunctuationMask) !== 0;
161
+ }
162
+ export function isSeparator2(s, index) {
163
+ const test = 1 << getUnicodeCategory2(s, index);
164
+ return (test & isSeparatorMask) !== 0;
165
+ }
166
+ export function isSymbol2(s, index) {
167
+ const test = 1 << getUnicodeCategory2(s, index);
168
+ return (test & isSymbolMask) !== 0;
169
+ }
170
+ export function isWhiteSpace2(s, index) {
171
+ const test = 1 << getUnicodeCategory2(s, index);
172
+ if ((test & isWhiteSpaceMask) !== 0) {
173
+ return true;
174
+ }
175
+ const cp = charCodeAt(s, index);
176
+ return (0x09 <= cp && cp <= 0x0D) || cp === 0x85 || cp === 0xA0;
177
+ }
178
+ export function isHighSurrogate2(s, index) {
179
+ const cp = charCodeAt(s, index);
180
+ return (0xD800 <= cp && cp <= 0xDBFF);
181
+ }
182
+ export function isLowSurrogate2(s, index) {
183
+ const cp = charCodeAt(s, index);
184
+ return (0xDC00 <= cp && cp <= 0xDFFF);
185
+ }
186
+ export function isSurrogate2(s, index) {
187
+ const cp = charCodeAt(s, index);
188
+ return (0xD800 <= cp && cp <= 0xDFFF);
189
+ }
190
+ export function isSurrogatePair(s, index) {
191
+ return typeof index === "number"
192
+ ? isHighSurrogate2(s, index) && isLowSurrogate2(s, index + 1)
193
+ : isHighSurrogate(s) && isLowSurrogate(index);
194
+ }
195
+ export function parse(input) {
196
+ if (input.length === 1) {
197
+ return input[0];
198
+ }
199
+ else {
200
+ throw new Exception("String must be exactly one character long.");
201
+ }
202
+ }
@@ -0,0 +1,184 @@
1
+ import { Union } from "./Types.js";
2
+ import { union_type } from "./Reflection.js";
3
+ import { some } from "./Option.js";
4
+ export function FSharpChoice$2_Choice1Of2(Item) {
5
+ return new FSharpChoice$2(0, [Item]);
6
+ }
7
+ export function FSharpChoice$2_Choice2Of2(Item) {
8
+ return new FSharpChoice$2(1, [Item]);
9
+ }
10
+ export class FSharpChoice$2 extends Union {
11
+ constructor(tag, fields) {
12
+ super();
13
+ this.tag = tag;
14
+ this.fields = fields;
15
+ }
16
+ cases() {
17
+ return ["Choice1Of2", "Choice2Of2"];
18
+ }
19
+ }
20
+ export function FSharpChoice$2_$reflection(gen0, gen1) {
21
+ return union_type("FSharp.Core.FSharpChoice`2", [gen0, gen1], FSharpChoice$2, () => [[["Item", gen0]], [["Item", gen1]]]);
22
+ }
23
+ export function FSharpChoice$3_Choice1Of3(Item) {
24
+ return new FSharpChoice$3(0, [Item]);
25
+ }
26
+ export function FSharpChoice$3_Choice2Of3(Item) {
27
+ return new FSharpChoice$3(1, [Item]);
28
+ }
29
+ export function FSharpChoice$3_Choice3Of3(Item) {
30
+ return new FSharpChoice$3(2, [Item]);
31
+ }
32
+ export class FSharpChoice$3 extends Union {
33
+ constructor(tag, fields) {
34
+ super();
35
+ this.tag = tag;
36
+ this.fields = fields;
37
+ }
38
+ cases() {
39
+ return ["Choice1Of3", "Choice2Of3", "Choice3Of3"];
40
+ }
41
+ }
42
+ export function FSharpChoice$3_$reflection(gen0, gen1, gen2) {
43
+ return union_type("FSharp.Core.FSharpChoice`3", [gen0, gen1, gen2], FSharpChoice$3, () => [[["Item", gen0]], [["Item", gen1]], [["Item", gen2]]]);
44
+ }
45
+ export function FSharpChoice$4_Choice1Of4(Item) {
46
+ return new FSharpChoice$4(0, [Item]);
47
+ }
48
+ export function FSharpChoice$4_Choice2Of4(Item) {
49
+ return new FSharpChoice$4(1, [Item]);
50
+ }
51
+ export function FSharpChoice$4_Choice3Of4(Item) {
52
+ return new FSharpChoice$4(2, [Item]);
53
+ }
54
+ export function FSharpChoice$4_Choice4Of4(Item) {
55
+ return new FSharpChoice$4(3, [Item]);
56
+ }
57
+ export class FSharpChoice$4 extends Union {
58
+ constructor(tag, fields) {
59
+ super();
60
+ this.tag = tag;
61
+ this.fields = fields;
62
+ }
63
+ cases() {
64
+ return ["Choice1Of4", "Choice2Of4", "Choice3Of4", "Choice4Of4"];
65
+ }
66
+ }
67
+ export function FSharpChoice$4_$reflection(gen0, gen1, gen2, gen3) {
68
+ return union_type("FSharp.Core.FSharpChoice`4", [gen0, gen1, gen2, gen3], FSharpChoice$4, () => [[["Item", gen0]], [["Item", gen1]], [["Item", gen2]], [["Item", gen3]]]);
69
+ }
70
+ export function FSharpChoice$5_Choice1Of5(Item) {
71
+ return new FSharpChoice$5(0, [Item]);
72
+ }
73
+ export function FSharpChoice$5_Choice2Of5(Item) {
74
+ return new FSharpChoice$5(1, [Item]);
75
+ }
76
+ export function FSharpChoice$5_Choice3Of5(Item) {
77
+ return new FSharpChoice$5(2, [Item]);
78
+ }
79
+ export function FSharpChoice$5_Choice4Of5(Item) {
80
+ return new FSharpChoice$5(3, [Item]);
81
+ }
82
+ export function FSharpChoice$5_Choice5Of5(Item) {
83
+ return new FSharpChoice$5(4, [Item]);
84
+ }
85
+ export class FSharpChoice$5 extends Union {
86
+ constructor(tag, fields) {
87
+ super();
88
+ this.tag = tag;
89
+ this.fields = fields;
90
+ }
91
+ cases() {
92
+ return ["Choice1Of5", "Choice2Of5", "Choice3Of5", "Choice4Of5", "Choice5Of5"];
93
+ }
94
+ }
95
+ export function FSharpChoice$5_$reflection(gen0, gen1, gen2, gen3, gen4) {
96
+ return union_type("FSharp.Core.FSharpChoice`5", [gen0, gen1, gen2, gen3, gen4], FSharpChoice$5, () => [[["Item", gen0]], [["Item", gen1]], [["Item", gen2]], [["Item", gen3]], [["Item", gen4]]]);
97
+ }
98
+ export function FSharpChoice$6_Choice1Of6(Item) {
99
+ return new FSharpChoice$6(0, [Item]);
100
+ }
101
+ export function FSharpChoice$6_Choice2Of6(Item) {
102
+ return new FSharpChoice$6(1, [Item]);
103
+ }
104
+ export function FSharpChoice$6_Choice3Of6(Item) {
105
+ return new FSharpChoice$6(2, [Item]);
106
+ }
107
+ export function FSharpChoice$6_Choice4Of6(Item) {
108
+ return new FSharpChoice$6(3, [Item]);
109
+ }
110
+ export function FSharpChoice$6_Choice5Of6(Item) {
111
+ return new FSharpChoice$6(4, [Item]);
112
+ }
113
+ export function FSharpChoice$6_Choice6Of6(Item) {
114
+ return new FSharpChoice$6(5, [Item]);
115
+ }
116
+ export class FSharpChoice$6 extends Union {
117
+ constructor(tag, fields) {
118
+ super();
119
+ this.tag = tag;
120
+ this.fields = fields;
121
+ }
122
+ cases() {
123
+ return ["Choice1Of6", "Choice2Of6", "Choice3Of6", "Choice4Of6", "Choice5Of6", "Choice6Of6"];
124
+ }
125
+ }
126
+ export function FSharpChoice$6_$reflection(gen0, gen1, gen2, gen3, gen4, gen5) {
127
+ return union_type("FSharp.Core.FSharpChoice`6", [gen0, gen1, gen2, gen3, gen4, gen5], FSharpChoice$6, () => [[["Item", gen0]], [["Item", gen1]], [["Item", gen2]], [["Item", gen3]], [["Item", gen4]], [["Item", gen5]]]);
128
+ }
129
+ export function FSharpChoice$7_Choice1Of7(Item) {
130
+ return new FSharpChoice$7(0, [Item]);
131
+ }
132
+ export function FSharpChoice$7_Choice2Of7(Item) {
133
+ return new FSharpChoice$7(1, [Item]);
134
+ }
135
+ export function FSharpChoice$7_Choice3Of7(Item) {
136
+ return new FSharpChoice$7(2, [Item]);
137
+ }
138
+ export function FSharpChoice$7_Choice4Of7(Item) {
139
+ return new FSharpChoice$7(3, [Item]);
140
+ }
141
+ export function FSharpChoice$7_Choice5Of7(Item) {
142
+ return new FSharpChoice$7(4, [Item]);
143
+ }
144
+ export function FSharpChoice$7_Choice6Of7(Item) {
145
+ return new FSharpChoice$7(5, [Item]);
146
+ }
147
+ export function FSharpChoice$7_Choice7Of7(Item) {
148
+ return new FSharpChoice$7(6, [Item]);
149
+ }
150
+ export class FSharpChoice$7 extends Union {
151
+ constructor(tag, fields) {
152
+ super();
153
+ this.tag = tag;
154
+ this.fields = fields;
155
+ }
156
+ cases() {
157
+ return ["Choice1Of7", "Choice2Of7", "Choice3Of7", "Choice4Of7", "Choice5Of7", "Choice6Of7", "Choice7Of7"];
158
+ }
159
+ }
160
+ export function FSharpChoice$7_$reflection(gen0, gen1, gen2, gen3, gen4, gen5, gen6) {
161
+ return union_type("FSharp.Core.FSharpChoice`7", [gen0, gen1, gen2, gen3, gen4, gen5, gen6], FSharpChoice$7, () => [[["Item", gen0]], [["Item", gen1]], [["Item", gen2]], [["Item", gen3]], [["Item", gen4]], [["Item", gen5]], [["Item", gen6]]]);
162
+ }
163
+ export function Choice_makeChoice1Of2(x) {
164
+ return FSharpChoice$2_Choice1Of2(x);
165
+ }
166
+ export function Choice_makeChoice2Of2(x) {
167
+ return FSharpChoice$2_Choice2Of2(x);
168
+ }
169
+ export function Choice_tryValueIfChoice1Of2(x) {
170
+ if (x.tag === /* Choice1Of2 */ 0) {
171
+ return some(x.fields[0]);
172
+ }
173
+ else {
174
+ return undefined;
175
+ }
176
+ }
177
+ export function Choice_tryValueIfChoice2Of2(x) {
178
+ if (x.tag === /* Choice2Of2 */ 1) {
179
+ return some(x.fields[0]);
180
+ }
181
+ else {
182
+ return undefined;
183
+ }
184
+ }
@@ -0,0 +1,182 @@
1
+ import { Exception, equals, isArrayLike } from "./Util.js";
2
+ export function count(col) {
3
+ if (typeof col["System.Collections.Generic.ICollection`1.get_Count"] === "function") {
4
+ return col["System.Collections.Generic.ICollection`1.get_Count"](); // collection
5
+ }
6
+ else {
7
+ if (typeof col["System.Collections.Generic.IReadOnlyCollection`1.get_Count"] === "function") {
8
+ return col["System.Collections.Generic.IReadOnlyCollection`1.get_Count"](); // collection
9
+ }
10
+ else {
11
+ if (isArrayLike(col)) {
12
+ return col.length; // array, resize array
13
+ }
14
+ else {
15
+ if (typeof col.size === "number") {
16
+ return col.size; // map, set
17
+ }
18
+ else {
19
+ let count = 0;
20
+ for (const _ of col) {
21
+ count++;
22
+ }
23
+ return count; // other collections
24
+ }
25
+ }
26
+ }
27
+ }
28
+ }
29
+ export function isReadOnly(col) {
30
+ if (typeof col["System.Collections.Generic.ICollection`1.get_IsReadOnly"] === "function") {
31
+ return col["System.Collections.Generic.ICollection`1.get_IsReadOnly"](); // collection
32
+ }
33
+ else {
34
+ if (isArrayLike(col)) {
35
+ return false; // array, resize array
36
+ }
37
+ else {
38
+ if (typeof col.size === "number") {
39
+ return false; // map, set
40
+ }
41
+ else {
42
+ return true; // other collections
43
+ }
44
+ }
45
+ }
46
+ }
47
+ export function copyTo(col, array, arrayIndex) {
48
+ if (typeof col["System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"] === "function") {
49
+ col["System.Collections.Generic.ICollection`1.CopyToZ3B4C077E"](array, arrayIndex); // collection
50
+ }
51
+ else {
52
+ let i = arrayIndex;
53
+ for (const v of col) {
54
+ array[i] = v;
55
+ i++;
56
+ }
57
+ }
58
+ }
59
+ export function contains(col, item) {
60
+ if (typeof col["System.Collections.Generic.ICollection`1.Contains2B595"] === "function") {
61
+ return col["System.Collections.Generic.ICollection`1.Contains2B595"](item); // collection
62
+ }
63
+ else {
64
+ if (isArrayLike(col)) {
65
+ let i = col.findIndex(x => equals(x, item)); // array, resize array
66
+ return i >= 0;
67
+ }
68
+ else {
69
+ if (typeof col.has === "function") {
70
+ if (typeof col.set === "function" && isArrayLike(item)) {
71
+ return col.has(item[0]) && equals(col.get(item[0]), item[1]); // map
72
+ }
73
+ else {
74
+ return col.has(item); // set
75
+ }
76
+ }
77
+ else {
78
+ return false; // other collections
79
+ }
80
+ }
81
+ }
82
+ }
83
+ export function add(col, item) {
84
+ if (typeof col["System.Collections.Generic.ICollection`1.Add2B595"] === "function") {
85
+ return col["System.Collections.Generic.ICollection`1.Add2B595"](item); // collection
86
+ }
87
+ else {
88
+ if (isArrayLike(col)) {
89
+ if (ArrayBuffer.isView(col)) {
90
+ // TODO: throw for typed arrays?
91
+ }
92
+ else {
93
+ col.push(item); // array, resize array
94
+ }
95
+ }
96
+ else {
97
+ if (typeof col.add === "function") {
98
+ return col.add(item); // set
99
+ }
100
+ else {
101
+ if (typeof col.has === "function"
102
+ && typeof col.set === "function"
103
+ && isArrayLike(item)) {
104
+ if (col.has(item[0]) === false) {
105
+ col.set(item[0], item[1]); // map
106
+ }
107
+ else {
108
+ throw new Exception("An item with the same key has already been added. Key: " + item[0]);
109
+ }
110
+ }
111
+ else {
112
+ // TODO: throw for other collections?
113
+ }
114
+ }
115
+ }
116
+ }
117
+ }
118
+ export function remove(col, item) {
119
+ if (typeof col["System.Collections.Generic.ICollection`1.Remove2B595"] === "function") {
120
+ return col["System.Collections.Generic.ICollection`1.Remove2B595"](item); // collection
121
+ }
122
+ else {
123
+ if (isArrayLike(col)) {
124
+ if (ArrayBuffer.isView(col)) {
125
+ // TODO: throw for typed arrays
126
+ return false;
127
+ }
128
+ else {
129
+ let i = col.findIndex(x => equals(x, item));
130
+ if (i >= 0) {
131
+ col.splice(i, 1); // array, resize array
132
+ return true;
133
+ }
134
+ else {
135
+ return false;
136
+ }
137
+ }
138
+ }
139
+ else {
140
+ if (typeof col.delete === "function") {
141
+ if (typeof col.set === "function" && isArrayLike(item)) {
142
+ if (col.has(item[0]) && equals(col.get(item[0]), item[1])) {
143
+ return col.delete(item[0]); // map
144
+ }
145
+ else {
146
+ return false;
147
+ }
148
+ }
149
+ else {
150
+ return col.delete(item); // set
151
+ }
152
+ }
153
+ else {
154
+ // TODO: throw for other collections?
155
+ return false; // other collections
156
+ }
157
+ }
158
+ }
159
+ }
160
+ export function clear(col) {
161
+ if (typeof col["System.Collections.Generic.ICollection`1.Clear"] === "function") {
162
+ return col["System.Collections.Generic.ICollection`1.Clear"](); // collection
163
+ }
164
+ else {
165
+ if (isArrayLike(col)) {
166
+ if (ArrayBuffer.isView(col)) {
167
+ // TODO: throw for typed arrays?
168
+ }
169
+ else {
170
+ col.splice(0); // array, resize array
171
+ }
172
+ }
173
+ else {
174
+ if (typeof col.clear === "function") {
175
+ col.clear(); // map, set
176
+ }
177
+ else {
178
+ // TODO: throw for other collections?
179
+ }
180
+ }
181
+ }
182
+ }
@@ -0,0 +1,21 @@
1
+ export class ConditionalWeakTable {
2
+ constructor() {
3
+ this.weakMap = new WeakMap();
4
+ }
5
+ delete(key) {
6
+ return this.weakMap.delete(key);
7
+ }
8
+ get(key) {
9
+ return this.weakMap.get(key);
10
+ }
11
+ has(key) {
12
+ return this.weakMap.has(key);
13
+ }
14
+ set(key, value) {
15
+ return this.weakMap.set(key, value);
16
+ }
17
+ clear() {
18
+ this.weakMap = new WeakMap();
19
+ }
20
+ }
21
+ export default ConditionalWeakTable;