@glutinum/cli 0.13.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 (319) hide show
  1. package/README.md +19 -1
  2. package/dist/Glutinum.Converter/Abbreviations.js +246 -0
  3. package/dist/Glutinum.Converter/FsharpAST.js +87 -28
  4. package/dist/Glutinum.Converter/Generate.js +55 -8
  5. package/dist/Glutinum.Converter/GlueAST.js +333 -34
  6. package/dist/Glutinum.Converter/Log.js +7 -8
  7. package/dist/Glutinum.Converter/Merge.js +683 -31
  8. package/dist/Glutinum.Converter/Packages.js +308 -0
  9. package/dist/Glutinum.Converter/Printer.js +323 -186
  10. package/dist/Glutinum.Converter/Read.js +279 -6
  11. package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +13 -7
  12. package/dist/Glutinum.Converter/Reader/Declaration.js +102 -17
  13. package/dist/Glutinum.Converter/Reader/Documentation.js +168 -73
  14. package/dist/Glutinum.Converter/Reader/EnumDeclaration.js +7 -51
  15. package/dist/Glutinum.Converter/Reader/ExportAssignment.js +64 -15
  16. package/dist/Glutinum.Converter/Reader/ExportDeclaration.js +165 -0
  17. package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +30 -5
  18. package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +122 -4
  19. package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +83 -7
  20. package/dist/Glutinum.Converter/Reader/MappedTypeNode.js +8 -8
  21. package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js +11 -9
  22. package/dist/Glutinum.Converter/Reader/NamedTupleMember.js +3 -2
  23. package/dist/Glutinum.Converter/Reader/Node.js +24 -10
  24. package/dist/Glutinum.Converter/Reader/Parameters.js +110 -7
  25. package/dist/Glutinum.Converter/Reader/Report.js +31 -12
  26. package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js +4 -3
  27. package/dist/Glutinum.Converter/Reader/TypeNode.js +1524 -253
  28. package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +75 -20
  29. package/dist/Glutinum.Converter/Reader/TypeParameters.js +8 -5
  30. package/dist/Glutinum.Converter/Reader/TypeQueryNode.js +184 -50
  31. package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +32 -13
  32. package/dist/Glutinum.Converter/Reader/Types.js +180 -0
  33. package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +99 -43
  34. package/dist/Glutinum.Converter/Reader/Utils.js +1143 -55
  35. package/dist/Glutinum.Converter/Reader/VariableStatement.js +59 -14
  36. package/dist/Glutinum.Converter/Transform.js +8292 -1119
  37. package/dist/Glutinum.Converter/TypeScript.Extensions.js +3 -3
  38. package/dist/Glutinum.Converter/TypeScript.js +3 -3
  39. package/dist/Glutinum.Converter/Utils/Keywords.js +6 -6
  40. package/dist/Glutinum.Converter/Utils/List.js +3 -3
  41. package/dist/Glutinum.Converter/Utils/Naming.js +61 -12
  42. package/dist/Glutinum.Converter/Utils/String.js +7 -3
  43. package/dist/Program.js +230 -72
  44. package/dist/fable_modules/Fable.Promise.3.2.1/AsyncIterable.fs +89 -0
  45. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/AsyncIterable.fs.js +29 -29
  46. package/dist/fable_modules/Fable.Promise.3.2.1/Fable.Promise.fableproj +25 -0
  47. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/Promise.fs +842 -766
  48. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/Promise.fs.js +26 -12
  49. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/PromiseImpl.fs +31 -31
  50. package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/PromiseImpl.fs.js +5 -5
  51. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Array.fs +235 -0
  52. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Array.fs.js +384 -0
  53. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AssemblyInfo.fs +4 -4
  54. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Async.fs +89 -9
  55. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Async.fs.js +13 -12
  56. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOption.fs +50 -4
  57. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionCE.fs +30 -39
  58. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionCE.fs.js +10 -10
  59. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResult.fs +52 -8
  60. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultCE.fs +26 -42
  61. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultCE.fs.js +3 -3
  62. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOption.fs +17 -5
  63. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultOption.fs.js +26 -0
  64. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionCE.fs +31 -33
  65. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionCE.fs.js +3 -3
  66. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidation.fs +1 -6
  67. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationCE.fs +10 -18
  68. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationCE.fs.js +3 -3
  69. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/FsToolkit.ErrorHandling.fableproj +69 -0
  70. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/List.fs +68 -10
  71. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/List.fs.js +47 -41
  72. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Nullness.fs +81 -0
  73. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Option.fs +133 -2
  74. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionCE.fs +139 -0
  75. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionCE.fs.js +48 -0
  76. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/OptionOp.fs +3 -3
  77. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResult.fs +88 -0
  78. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResult.fs.js +30 -0
  79. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResultCE.fs +200 -0
  80. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResultCE.fs.js +18 -0
  81. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidation.fs +34 -0
  82. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidationCE.fs +244 -0
  83. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidationCE.fs.js +18 -0
  84. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Result.fs +87 -0
  85. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Result.fs.js +8 -8
  86. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultCE.fs +8 -23
  87. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultCE.fs.js +5 -5
  88. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOption.fs +1 -1
  89. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOption.fs.js +10 -10
  90. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionCE.fs +7 -18
  91. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionCE.fs.js +3 -3
  92. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Seq.fs +503 -0
  93. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Seq.fs.js +295 -0
  94. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Validation.fs +0 -5
  95. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationCE.fs +7 -13
  96. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationCE.fs.js +3 -3
  97. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValueOption.fs +1 -4
  98. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOption.fs +102 -0
  99. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOptionCE.fs +587 -0
  100. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOptionOp.fs +10 -0
  101. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Debug/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +3 -3
  102. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.fs +3 -0
  103. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1 → FsToolkit.ErrorHandling.5.2.0/obj/Release/net9.0}/FsToolkit.ErrorHandling.AssemblyInfo.fs +4 -4
  104. package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Release/netstandard2.0/FsToolkit.ErrorHandling.AssemblyInfo.fs +4 -4
  105. package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +20 -0
  106. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Array.js +192 -86
  107. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Async.js +58 -53
  108. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/AsyncBuilder.js +29 -8
  109. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/BigInt.js +71 -46
  110. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/BitConverter.js +2 -2
  111. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Boolean.js +4 -3
  112. package/dist/fable_modules/fable-library-js.5.17.2/CHANGELOG.md +348 -0
  113. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Char.js +64 -31
  114. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Choice.js +2 -2
  115. package/dist/fable_modules/fable-library-js.5.17.2/CollectionUtil.js +182 -0
  116. package/dist/fable_modules/fable-library-js.5.17.2/ConditionalWeakTable.js +21 -0
  117. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Date.js +197 -112
  118. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/DateOffset.js +46 -62
  119. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/DateOnly.js +6 -6
  120. package/dist/fable_modules/fable-library-js.5.17.2/DateOnlyTemporal.js +146 -0
  121. package/dist/fable_modules/fable-library-js.5.17.2/DateTimeFormat.js +523 -0
  122. package/dist/fable_modules/fable-library-js.5.17.2/DateTimeOffsetTemporal.js +283 -0
  123. package/dist/fable_modules/fable-library-js.5.17.2/DateTimeTemporal.js +243 -0
  124. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Decimal.js +39 -13
  125. package/dist/fable_modules/fable-library-js.5.17.2/Directory.js +11 -0
  126. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Double.js +10 -3
  127. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Encoding.js +20 -8
  128. package/dist/fable_modules/fable-library-js.5.17.2/Environment.js +3 -0
  129. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Event.js +10 -1
  130. package/dist/fable_modules/fable-library-js.5.17.2/FSharp.Collections.js +45 -0
  131. package/dist/fable_modules/fable-library-js.5.17.2/FSharp.Core.js +156 -0
  132. package/dist/fable_modules/fable-library-js.5.17.2/File.js +27 -0
  133. package/dist/fable_modules/fable-library-js.5.17.2/Global.js +29 -0
  134. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Guid.js +33 -12
  135. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Int32.js +17 -17
  136. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/List.js +170 -106
  137. package/dist/fable_modules/fable-library-js.5.17.2/Long.js +38 -0
  138. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MailboxProcessor.js +13 -6
  139. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Map.js +65 -61
  140. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MapUtil.js +22 -4
  141. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MutableMap.js +28 -16
  142. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MutableSet.js +7 -7
  143. package/dist/fable_modules/fable-library-js.5.17.2/Native.js +14 -0
  144. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Numeric.js +44 -3
  145. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Observable.js +5 -3
  146. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Option.js +11 -20
  147. package/dist/fable_modules/fable-library-js.5.17.2/Path.js +31 -0
  148. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Random.js +22 -20
  149. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Range.js +12 -12
  150. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Reflection.js +50 -22
  151. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/RegExp.js +68 -30
  152. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Result.js +6 -6
  153. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Seq.js +229 -104
  154. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Seq2.js +1 -1
  155. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Set.js +153 -113
  156. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/String.js +238 -50
  157. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/System.Collections.Generic.js +30 -14
  158. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/System.Text.js +69 -31
  159. package/dist/fable_modules/fable-library-js.5.17.2/System.js +289 -0
  160. package/dist/fable_modules/fable-library-js.5.17.2/Task.js +27 -0
  161. package/dist/fable_modules/fable-library-js.5.17.2/TaskBuilder.js +72 -0
  162. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/TimeOnly.js +6 -6
  163. package/dist/fable_modules/fable-library-js.5.17.2/TimeOnlyTemporal.js +142 -0
  164. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/TimeSpan.js +18 -15
  165. package/dist/fable_modules/fable-library-js.5.17.2/TimeSpanTemporal.js +259 -0
  166. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Types.js +14 -24
  167. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Uri.js +44 -21
  168. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Util.js +49 -12
  169. package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/lib/big.js +14 -11
  170. package/dist/fable_modules/fable-library-js.5.17.2/package.json +24 -0
  171. package/dist/fable_modules/fable-library-js.5.17.2/quotation.js +682 -0
  172. package/package.json +4 -4
  173. package/src/Glutinum.Converter/js/bootstrap.js +109 -2
  174. package/src/Glutinum.Converter/js/host.js +144 -0
  175. package/src/Glutinum.Converter/js/npm.js +137 -0
  176. package/src/Glutinum.Converter/js/resolve.js +402 -0
  177. package/dist/Glutinum.Converter/FsharpAST.js.map +0 -1
  178. package/dist/Glutinum.Converter/Generate.js.map +0 -1
  179. package/dist/Glutinum.Converter/GlueAST.js.map +0 -1
  180. package/dist/Glutinum.Converter/Log.js.map +0 -1
  181. package/dist/Glutinum.Converter/Merge.js.map +0 -1
  182. package/dist/Glutinum.Converter/Printer.js.map +0 -1
  183. package/dist/Glutinum.Converter/Read.js.map +0 -1
  184. package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +0 -1
  185. package/dist/Glutinum.Converter/Reader/Declaration.js.map +0 -1
  186. package/dist/Glutinum.Converter/Reader/Documentation.js.map +0 -1
  187. package/dist/Glutinum.Converter/Reader/EnumDeclaration.js.map +0 -1
  188. package/dist/Glutinum.Converter/Reader/ExportAssignment.js.map +0 -1
  189. package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js.map +0 -1
  190. package/dist/Glutinum.Converter/Reader/IndexedAccessType.js.map +0 -1
  191. package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +0 -1
  192. package/dist/Glutinum.Converter/Reader/MappedTypeNode.js.map +0 -1
  193. package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js.map +0 -1
  194. package/dist/Glutinum.Converter/Reader/NamedTupleMember.js.map +0 -1
  195. package/dist/Glutinum.Converter/Reader/Node.js.map +0 -1
  196. package/dist/Glutinum.Converter/Reader/Parameters.js.map +0 -1
  197. package/dist/Glutinum.Converter/Reader/Report.js.map +0 -1
  198. package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js.map +0 -1
  199. package/dist/Glutinum.Converter/Reader/TypeNode.js.map +0 -1
  200. package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js.map +0 -1
  201. package/dist/Glutinum.Converter/Reader/TypeParameters.js.map +0 -1
  202. package/dist/Glutinum.Converter/Reader/TypeQueryNode.js.map +0 -1
  203. package/dist/Glutinum.Converter/Reader/TypeScriptReader.js.map +0 -1
  204. package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +0 -1
  205. package/dist/Glutinum.Converter/Reader/Utils.js.map +0 -1
  206. package/dist/Glutinum.Converter/Reader/VariableStatement.js.map +0 -1
  207. package/dist/Glutinum.Converter/Transform.js.map +0 -1
  208. package/dist/Glutinum.Converter/TypeScript.Extensions.js.map +0 -1
  209. package/dist/Glutinum.Converter/TypeScript.js.map +0 -1
  210. package/dist/Glutinum.Converter/Utils/Keywords.js.map +0 -1
  211. package/dist/Glutinum.Converter/Utils/List.js.map +0 -1
  212. package/dist/Glutinum.Converter/Utils/Naming.js.map +0 -1
  213. package/dist/Glutinum.Converter/Utils/String.js.map +0 -1
  214. package/dist/Program.js.map +0 -1
  215. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +0 -57
  216. package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js.map +0 -1
  217. package/dist/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +0 -20
  218. package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js.map +0 -1
  219. package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +0 -1
  220. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js.map +0 -1
  221. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js.map +0 -1
  222. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js.map +0 -1
  223. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js +0 -26
  224. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js.map +0 -1
  225. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js.map +0 -1
  226. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js.map +0 -1
  227. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/FsToolkit.ErrorHandling.fableproj +0 -51
  228. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js.map +0 -1
  229. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs +0 -186
  230. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js +0 -18
  231. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js.map +0 -1
  232. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js.map +0 -1
  233. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js.map +0 -1
  234. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js.map +0 -1
  235. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js.map +0 -1
  236. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs +0 -19
  237. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js +0 -31
  238. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js.map +0 -1
  239. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs +0 -22
  240. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js +0 -18
  241. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js.map +0 -1
  242. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js.map +0 -1
  243. package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOptionCE.fs +0 -165
  244. package/dist/fable_modules/fable-library-js.4.14.0/Array.d.ts +0 -123
  245. package/dist/fable_modules/fable-library-js.4.14.0/Async.d.ts +0 -32
  246. package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.d.ts +0 -59
  247. package/dist/fable_modules/fable-library-js.4.14.0/BigInt.d.ts +0 -115
  248. package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.d.ts +0 -27
  249. package/dist/fable_modules/fable-library-js.4.14.0/Boolean.d.ts +0 -3
  250. package/dist/fable_modules/fable-library-js.4.14.0/CHANGELOG.md +0 -37
  251. package/dist/fable_modules/fable-library-js.4.14.0/Char.d.ts +0 -65
  252. package/dist/fable_modules/fable-library-js.4.14.0/Choice.d.ts +0 -121
  253. package/dist/fable_modules/fable-library-js.4.14.0/Date.d.ts +0 -70
  254. package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.d.ts +0 -63
  255. package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.d.ts +0 -18
  256. package/dist/fable_modules/fable-library-js.4.14.0/Decimal.d.ts +0 -45
  257. package/dist/fable_modules/fable-library-js.4.14.0/Double.d.ts +0 -11
  258. package/dist/fable_modules/fable-library-js.4.14.0/Encoding.d.ts +0 -12
  259. package/dist/fable_modules/fable-library-js.4.14.0/Event.d.ts +0 -31
  260. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.d.ts +0 -7
  261. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.js +0 -27
  262. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.d.ts +0 -12
  263. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.d.ts +0 -17
  264. package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.js +0 -69
  265. package/dist/fable_modules/fable-library-js.4.14.0/Global.d.ts +0 -24
  266. package/dist/fable_modules/fable-library-js.4.14.0/Global.js +0 -8
  267. package/dist/fable_modules/fable-library-js.4.14.0/Guid.d.ts +0 -10
  268. package/dist/fable_modules/fable-library-js.4.14.0/Int32.d.ts +0 -28
  269. package/dist/fable_modules/fable-library-js.4.14.0/List.d.ts +0 -143
  270. package/dist/fable_modules/fable-library-js.4.14.0/Long.d.ts +0 -3
  271. package/dist/fable_modules/fable-library-js.4.14.0/Long.js +0 -46
  272. package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.d.ts +0 -25
  273. package/dist/fable_modules/fable-library-js.4.14.0/Map.d.ts +0 -178
  274. package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.d.ts +0 -10
  275. package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.d.ts +0 -52
  276. package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.d.ts +0 -39
  277. package/dist/fable_modules/fable-library-js.4.14.0/Native.d.ts +0 -2
  278. package/dist/fable_modules/fable-library-js.4.14.0/Native.js +0 -8
  279. package/dist/fable_modules/fable-library-js.4.14.0/Numeric.d.ts +0 -19
  280. package/dist/fable_modules/fable-library-js.4.14.0/Observable.d.ts +0 -32
  281. package/dist/fable_modules/fable-library-js.4.14.0/Option.d.ts +0 -28
  282. package/dist/fable_modules/fable-library-js.4.14.0/Random.d.ts +0 -37
  283. package/dist/fable_modules/fable-library-js.4.14.0/Range.d.ts +0 -12
  284. package/dist/fable_modules/fable-library-js.4.14.0/Reflection.d.ts +0 -119
  285. package/dist/fable_modules/fable-library-js.4.14.0/RegExp.d.ts +0 -10
  286. package/dist/fable_modules/fable-library-js.4.14.0/Result.d.ts +0 -37
  287. package/dist/fable_modules/fable-library-js.4.14.0/Seq.d.ts +0 -165
  288. package/dist/fable_modules/fable-library-js.4.14.0/Seq2.d.ts +0 -18
  289. package/dist/fable_modules/fable-library-js.4.14.0/Set.d.ts +0 -190
  290. package/dist/fable_modules/fable-library-js.4.14.0/String.d.ts +0 -50
  291. package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.d.ts +0 -79
  292. package/dist/fable_modules/fable-library-js.4.14.0/System.Text.d.ts +0 -38
  293. package/dist/fable_modules/fable-library-js.4.14.0/SystemException.d.ts +0 -5
  294. package/dist/fable_modules/fable-library-js.4.14.0/SystemException.js +0 -5
  295. package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.d.ts +0 -15
  296. package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.d.ts +0 -34
  297. package/dist/fable_modules/fable-library-js.4.14.0/Timer.d.ts +0 -19
  298. package/dist/fable_modules/fable-library-js.4.14.0/Types.d.ts +0 -58
  299. package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.d.ts +0 -2
  300. package/dist/fable_modules/fable-library-js.4.14.0/Uri.d.ts +0 -29
  301. package/dist/fable_modules/fable-library-js.4.14.0/Util.d.ts +0 -207
  302. package/dist/fable_modules/fable-library-js.4.14.0/lib/big.d.ts +0 -5
  303. package/dist/fable_modules/fable-library-js.4.14.0/package.json +0 -24
  304. package/dist/fable_modules/project_cracked.json +0 -1
  305. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionOp.fs +0 -0
  306. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOp.fs +0 -0
  307. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionOp.fs +0 -0
  308. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationOp.fs +0 -0
  309. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOp.fs +0 -0
  310. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionOp.fs +0 -0
  311. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationOp.fs +0 -0
  312. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -0
  313. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -0
  314. /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Release/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -0
  315. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/FSharp.Core.CompilerServices.js +0 -0
  316. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/README.md +0 -0
  317. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Timer.js +0 -0
  318. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Unicode.13.0.0.js +0 -0
  319. /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/big.d.ts +0 -0
@@ -1,10 +1,12 @@
1
1
  import { disposeSafe, defaultOf, equals, toIterator, getEnumerator } from "./Util.js";
2
2
  import { iterate, map, delay, toArray, iterateIndexed, concat } from "./Seq.js";
3
3
  import { value as value_1 } from "./Option.js";
4
- import { setItem } from "./Array.js";
4
+ import { item as item_1, setItem } from "./Array.js";
5
5
  import { FSharpRef } from "./Types.js";
6
6
  import { class_type } from "./Reflection.js";
7
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";
8
10
  import { format } from "./String.js";
9
11
  export class Dictionary {
10
12
  constructor(pairs, comparer) {
@@ -53,11 +55,11 @@ export class Dictionary {
53
55
  "System.Collections.Generic.ICollection`1.Contains2B595"(item) {
54
56
  const this$ = this;
55
57
  const matchValue = Dictionary__TryFind_2B595(this$, item[0]);
56
- let matchResult, p_1;
58
+ let matchResult = undefined, pair_1 = undefined;
57
59
  if (matchValue != null) {
58
60
  if (equals(value_1(matchValue)[1], item[1])) {
59
61
  matchResult = 0;
60
- p_1 = value_1(matchValue);
62
+ pair_1 = value_1(matchValue);
61
63
  }
62
64
  else {
63
65
  matchResult = 1;
@@ -89,14 +91,24 @@ export class Dictionary {
89
91
  "System.Collections.Generic.ICollection`1.Remove2B595"(item) {
90
92
  const this$ = this;
91
93
  const matchValue = Dictionary__TryFind_2B595(this$, item[0]);
94
+ let matchResult = undefined, pair_1 = undefined;
92
95
  if (matchValue != null) {
93
96
  if (equals(value_1(matchValue)[1], item[1])) {
94
- Dictionary__Remove_2B595(this$, item[0]);
97
+ matchResult = 0;
98
+ pair_1 = value_1(matchValue);
99
+ }
100
+ else {
101
+ matchResult = 1;
95
102
  }
96
- return true;
97
103
  }
98
104
  else {
99
- return false;
105
+ matchResult = 1;
106
+ }
107
+ switch (matchResult) {
108
+ case 0:
109
+ return Dictionary__Remove_2B595(this$, item[0]);
110
+ default:
111
+ return false;
100
112
  }
101
113
  }
102
114
  "System.Collections.Generic.IDictionary`2.Add5BDDA1"(key, value) {
@@ -205,7 +217,7 @@ function Dictionary__TryFindIndex_2B595(this$, k) {
205
217
  }
206
218
  export function Dictionary__TryFind_2B595(this$, k) {
207
219
  const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
208
- let matchResult;
220
+ let matchResult = undefined;
209
221
  if (matchValue[0]) {
210
222
  if (matchValue[2] > -1) {
211
223
  matchResult = 0;
@@ -219,9 +231,9 @@ export function Dictionary__TryFind_2B595(this$, k) {
219
231
  }
220
232
  switch (matchResult) {
221
233
  case 0:
222
- return getItemFromDict(this$.hashMap, matchValue[1])[matchValue[2]];
234
+ return item_1(matchValue[2], getItemFromDict(this$.hashMap, matchValue[1]));
223
235
  default:
224
- return void 0;
236
+ return undefined;
225
237
  }
226
238
  }
227
239
  export function Dictionary__get_Comparer(this$) {
@@ -250,17 +262,17 @@ export function Dictionary__get_Item_2B595(this$, k) {
250
262
  return value_1(matchValue)[1];
251
263
  }
252
264
  else {
253
- throw new Error("The item was not found in collection");
265
+ throw KeyNotFoundException_$ctor_Z721C83C5("The item was not found in collection");
254
266
  }
255
267
  }
256
268
  export function Dictionary__set_Item_5BDDA1(this$, k, v) {
257
269
  const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
258
270
  if (matchValue[0]) {
259
271
  if (matchValue[2] > -1) {
260
- getItemFromDict(this$.hashMap, matchValue[1])[matchValue[2]] = [k, v];
272
+ setItem(getItemFromDict(this$.hashMap, matchValue[1]), matchValue[2], [k, v]);
261
273
  }
262
274
  else {
263
- const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));
275
+ void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));
264
276
  }
265
277
  }
266
278
  else {
@@ -271,10 +283,10 @@ export function Dictionary__Add_5BDDA1(this$, k, v) {
271
283
  const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
272
284
  if (matchValue[0]) {
273
285
  if (matchValue[2] > -1) {
274
- throw new Error(format("An item with the same key has already been added. Key: {0}", k));
286
+ throw ArgumentException_$ctor_Z721C83C5(format("An item with the same key has already been added. Key: {0}", k));
275
287
  }
276
288
  else {
277
- const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));
289
+ void (getItemFromDict(this$.hashMap, matchValue[1]).push([k, v]));
278
290
  }
279
291
  }
280
292
  else {
@@ -283,7 +295,7 @@ export function Dictionary__Add_5BDDA1(this$, k, v) {
283
295
  }
284
296
  export function Dictionary__ContainsKey_2B595(this$, k) {
285
297
  const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
286
- let matchResult;
298
+ let matchResult = undefined;
287
299
  if (matchValue[0]) {
288
300
  if (matchValue[2] > -1) {
289
301
  matchResult = 0;
@@ -304,7 +316,7 @@ export function Dictionary__ContainsKey_2B595(this$, k) {
304
316
  }
305
317
  export function Dictionary__Remove_2B595(this$, k) {
306
318
  const matchValue = Dictionary__TryFindIndex_2B595(this$, k);
307
- let matchResult;
319
+ let matchResult = undefined;
308
320
  if (matchValue[0]) {
309
321
  if (matchValue[2] > -1) {
310
322
  matchResult = 0;
@@ -1,6 +1,6 @@
1
1
  import { disposeSafe, defaultOf, toIterator, getEnumerator } from "./Util.js";
2
2
  import { iterate, map, iterateIndexed, concat } from "./Seq.js";
3
- import { setItem } from "./Array.js";
3
+ import { item as item_1, setItem } from "./Array.js";
4
4
  import { some } from "./Option.js";
5
5
  import { FSharpRef } from "./Types.js";
6
6
  import { class_type } from "./Reflection.js";
@@ -132,7 +132,7 @@ function HashSet__TryFindIndex_2B595(this$, k) {
132
132
  }
133
133
  function HashSet__TryFind_2B595(this$, k) {
134
134
  const matchValue = HashSet__TryFindIndex_2B595(this$, k);
135
- let matchResult;
135
+ let matchResult = undefined;
136
136
  if (matchValue[0]) {
137
137
  if (matchValue[2] > -1) {
138
138
  matchResult = 0;
@@ -146,9 +146,9 @@ function HashSet__TryFind_2B595(this$, k) {
146
146
  }
147
147
  switch (matchResult) {
148
148
  case 0:
149
- return some(getItemFromDict(this$.hashMap, matchValue[1])[matchValue[2]]);
149
+ return some(item_1(matchValue[2], getItemFromDict(this$.hashMap, matchValue[1])));
150
150
  default:
151
- return void 0;
151
+ return undefined;
152
152
  }
153
153
  }
154
154
  export function HashSet__get_Comparer(this$) {
@@ -178,7 +178,7 @@ export function HashSet__Add_2B595(this$, k) {
178
178
  return false;
179
179
  }
180
180
  else {
181
- const value = void (getItemFromDict(this$.hashMap, matchValue[1]).push(k));
181
+ void (getItemFromDict(this$.hashMap, matchValue[1]).push(k));
182
182
  return true;
183
183
  }
184
184
  }
@@ -189,7 +189,7 @@ export function HashSet__Add_2B595(this$, k) {
189
189
  }
190
190
  export function HashSet__Contains_2B595(this$, k) {
191
191
  const matchValue = HashSet__TryFindIndex_2B595(this$, k);
192
- let matchResult;
192
+ let matchResult = undefined;
193
193
  if (matchValue[0]) {
194
194
  if (matchValue[2] > -1) {
195
195
  matchResult = 0;
@@ -210,7 +210,7 @@ export function HashSet__Contains_2B595(this$, k) {
210
210
  }
211
211
  export function HashSet__Remove_2B595(this$, k) {
212
212
  const matchValue = HashSet__TryFindIndex_2B595(this$, k);
213
- let matchResult;
213
+ let matchResult = undefined;
214
214
  if (matchValue[0]) {
215
215
  if (matchValue[2] > -1) {
216
216
  matchResult = 0;
@@ -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
+ }
@@ -2,6 +2,10 @@ export const symbol = Symbol("numeric");
2
2
  export function isNumeric(x) {
3
3
  return typeof x === "number" || typeof x === "bigint" || x?.[symbol];
4
4
  }
5
+ export function isIntegral(x) {
6
+ // Not perfect, because in JS we can't distinguish between 1.0 and 1
7
+ return typeof x === "number" && Number.isInteger(x) || typeof x === "bigint";
8
+ }
5
9
  export function compare(x, y) {
6
10
  if (typeof x === "number") {
7
11
  return x < y ? -1 : (x > y ? 1 : 0);
@@ -24,12 +28,24 @@ export function multiply(x, y) {
24
28
  return x[symbol]().multiply(y);
25
29
  }
26
30
  }
31
+ export function divide(x, y) {
32
+ if (typeof x === "number") {
33
+ return x / y;
34
+ }
35
+ else if (typeof x === "bigint") {
36
+ // Keep the fractional part so the caller can round it like .NET does
37
+ return Number(x) / y;
38
+ }
39
+ else {
40
+ return x[symbol]().multiply(1 / y);
41
+ }
42
+ }
27
43
  export function toFixed(x, dp) {
28
44
  if (typeof x === "number") {
29
45
  return x.toFixed(dp);
30
46
  }
31
47
  else if (typeof x === "bigint") {
32
- return x;
48
+ return x.toString();
33
49
  }
34
50
  else {
35
51
  return x[symbol]().toFixed(dp);
@@ -40,18 +56,43 @@ export function toPrecision(x, sd) {
40
56
  return x.toPrecision(sd);
41
57
  }
42
58
  else if (typeof x === "bigint") {
43
- return x;
59
+ return x.toString();
44
60
  }
45
61
  else {
46
62
  return x[symbol]().toPrecision(sd);
47
63
  }
48
64
  }
65
+ // A bigint can hold more significant digits than a double, so the mantissa is rounded on the
66
+ // decimal digits themselves instead of going through Number
67
+ function bigintToExponential(x, dp) {
68
+ const sign = x < 0n ? "-" : "";
69
+ let digits = (x < 0n ? -x : x).toString();
70
+ if (x === 0n) {
71
+ return sign + (dp ? "0." + "0".repeat(dp) : "0") + "e+0";
72
+ }
73
+ dp = dp ?? digits.length - 1;
74
+ let exponent = digits.length - 1;
75
+ if (digits.length > dp + 1) {
76
+ // .NET rounds the discarded digits away from zero
77
+ const roundUp = digits.charCodeAt(dp + 1) >= 53;
78
+ digits = (BigInt(digits.slice(0, dp + 1)) + (roundUp ? 1n : 0n)).toString();
79
+ if (digits.length > dp + 1) {
80
+ digits = digits.slice(0, dp + 1);
81
+ exponent += 1;
82
+ }
83
+ }
84
+ else {
85
+ digits = digits.padEnd(dp + 1, "0");
86
+ }
87
+ const mantissa = dp > 0 ? digits[0] + "." + digits.slice(1) : digits[0];
88
+ return sign + mantissa + "e+" + exponent;
89
+ }
49
90
  export function toExponential(x, dp) {
50
91
  if (typeof x === "number") {
51
92
  return x.toExponential(dp);
52
93
  }
53
94
  else if (typeof x === "bigint") {
54
- return x;
95
+ return bigintToExponential(x, dp);
55
96
  }
56
97
  else {
57
98
  return x[symbol]().toExponential(dp);
@@ -1,5 +1,5 @@
1
1
  import { Choice_tryValueIfChoice1Of2, Choice_tryValueIfChoice2Of2 } from "./Choice.js";
2
- import { value } from "./Option.js";
2
+ import { some, value } from "./Option.js";
3
3
  export class Observer {
4
4
  constructor(onNext, onError, onCompleted) {
5
5
  this.OnNext = onNext;
@@ -29,7 +29,7 @@ export function choose(chooser, source) {
29
29
  } }, observer.OnError), observer.OnError, observer.OnCompleted)));
30
30
  }
31
31
  export function filter(predicate, source) {
32
- return choose((x) => predicate(x) ? x : void 0, source);
32
+ return choose((x) => predicate(x) ? some(x) : undefined, source);
33
33
  }
34
34
  export function map(mapping, source) {
35
35
  return new Observable((observer) => source.Subscribe(new Observer((t) => {
@@ -84,11 +84,13 @@ export function merge(source1, source2) {
84
84
  export function pairwise(source) {
85
85
  return new Observable((observer) => {
86
86
  let last;
87
+ let haveLast = false;
87
88
  return source.Subscribe(new Observer((next) => {
88
- if (last != null) {
89
+ if (haveLast) {
89
90
  observer.OnNext([last, next]);
90
91
  }
91
92
  last = next;
93
+ haveLast = true;
92
94
  }, observer.OnError, observer.OnCompleted));
93
95
  });
94
96
  }
@@ -1,4 +1,4 @@
1
- import { structuralHash, equals, compare } from "./Util.js";
1
+ import { Exception, structuralHash, equals, compare } from "./Util.js";
2
2
  // Using a class here for better compatibility with TS files importing Some
3
3
  export class Some {
4
4
  constructor(value) {
@@ -31,9 +31,17 @@ export class Some {
31
31
  }
32
32
  }
33
33
  }
34
+ export function nonNullValue(x) {
35
+ if (x == null) {
36
+ throw new Exception("Nullable has no value");
37
+ }
38
+ else {
39
+ return x;
40
+ }
41
+ }
34
42
  export function value(x) {
35
43
  if (x == null) {
36
- throw new Error("Option has no value");
44
+ throw new Exception("Option has no value");
37
45
  }
38
46
  else {
39
47
  return x instanceof Some ? x.value : x;
@@ -62,30 +70,13 @@ export function toArray(opt) {
62
70
  export function defaultArg(opt, defaultValue) {
63
71
  return (opt != null) ? value(opt) : defaultValue;
64
72
  }
65
- export function defaultArgWith(opt, defThunk) {
66
- return (opt != null) ? value(opt) : defThunk();
67
- }
68
73
  export function orElse(opt, ifNone) {
69
74
  return opt == null ? ifNone : opt;
70
75
  }
71
- export function orElseWith(opt, ifNoneThunk) {
72
- return opt == null ? ifNoneThunk() : opt;
73
- }
74
- export function filter(predicate, opt) {
75
- return (opt != null) ? (predicate(value(opt)) ? opt : undefined) : opt;
76
- }
76
+ // Only used by Replacements.Util.fs's curry/uncurry helpers, not by `Option.map` itself.
77
77
  export function map(mapping, opt) {
78
78
  return (opt != null) ? some(mapping(value(opt))) : undefined;
79
79
  }
80
- export function map2(mapping, opt1, opt2) {
81
- return (opt1 != null && opt2 != null) ? mapping(value(opt1), value(opt2)) : undefined;
82
- }
83
- export function map3(mapping, opt1, opt2, opt3) {
84
- return (opt1 != null && opt2 != null && opt3 != null) ? mapping(value(opt1), value(opt2), value(opt3)) : undefined;
85
- }
86
- export function bind(binder, opt) {
87
- return opt != null ? binder(value(opt)) : undefined;
88
- }
89
80
  export function tryOp(op, arg) {
90
81
  try {
91
82
  return some(op(arg));
@@ -0,0 +1,31 @@
1
+ // This library doesn't depend on @types/node (to stay browser-compatible),
2
+ // so these Node.js built-in imports can't be type-checked; the exported
3
+ // functions below still declare their own types for callers to rely on.
4
+ // @ts-ignore
5
+ import { basename, extname, join } from "node:path";
6
+ // @ts-ignore
7
+ import { tmpdir } from "node:os";
8
+ // @ts-ignore
9
+ import { writeFileSync } from "node:fs";
10
+ // Mirrors the format of .NET's Path.GetRandomFileName(): 8 random hex chars,
11
+ // a dot, then 3 more random hex chars.
12
+ export function getRandomFileName() {
13
+ const nameBytes = new Uint8Array(4);
14
+ crypto.getRandomValues(nameBytes);
15
+ const name = Array.from(nameBytes, (b) => b.toString(16).padStart(2, "0")).join("");
16
+ const extBytes = new Uint8Array(2);
17
+ crypto.getRandomValues(extBytes);
18
+ const ext = Array.from(extBytes, (b) => b.toString(16).padStart(2, "0")).join("").slice(0, 3);
19
+ return `${name}.${ext}`;
20
+ }
21
+ export function getFileNameWithoutExtension(path) {
22
+ return basename(path, extname(path));
23
+ }
24
+ export function hasExtension(path) {
25
+ return extname(path) !== "";
26
+ }
27
+ export function getTempFileName() {
28
+ const path = join(tmpdir(), getRandomFileName());
29
+ writeFileSync(path, "");
30
+ return path;
31
+ }
@@ -1,18 +1,20 @@
1
+ import { ArgumentNullException_$ctor_Z721C83C5, ArgumentOutOfRangeException_$ctor_Z721C83C5 } from "./System.js";
2
+ import { Operators_IsNull } from "./FSharp.Core.js";
1
3
  import { class_type } from "./Reflection.js";
2
- import { fromFloat64, op_Addition, toInt32, toFloat64, compare, fromInt32, toInt64 } from "./BigInt.js";
3
- import { item, fill, setItem } from "./Array.js";
4
+ import { fromFloat64, op_Addition, toInt32_unchecked, toFloat64, compare, fromInt32, toInt64_unchecked } from "./BigInt.js";
5
+ import { item, setItem } from "./Array.js";
4
6
  function Native_random() {
5
7
  return Math.random();
6
8
  }
7
- function Native_randomNext(min, max) {
8
- if (max < min) {
9
- throw new Error("minValue must be less than maxValue");
9
+ function Native_randomNext(minValue, maxValue) {
10
+ if (maxValue < minValue) {
11
+ throw ArgumentOutOfRangeException_$ctor_Z721C83C5("minValue must be less than maxValue");
10
12
  }
11
- return Math.floor(Math.random() * (max - min)) + min;
13
+ return Math.floor(Math.random() * (maxValue - minValue)) + minValue;
12
14
  }
13
15
  function Native_randomBytes(buffer) {
14
- if (buffer == null) {
15
- throw new Error("Buffer cannot be null");
16
+ if (Operators_IsNull(buffer)) {
17
+ throw ArgumentNullException_$ctor_Z721C83C5("buffer");
16
18
  }
17
19
  for (let i = 0; i < buffer.length; i += 6) {
18
20
  // Pick random 48-bit number. Fill buffer in 2 24-bit chunks to avoid bitwise truncation.
@@ -32,13 +34,13 @@ export class NonSeeded {
32
34
  constructor() {
33
35
  }
34
36
  Next0() {
35
- return Native_randomNext(0, 2147483647);
37
+ return Native_randomNext(0, 2147483647) | 0;
36
38
  }
37
39
  Next1(maxValue) {
38
- return Native_randomNext(0, maxValue);
40
+ return Native_randomNext(0, maxValue) | 0;
39
41
  }
40
42
  Next2(minValue, maxValue) {
41
- return Native_randomNext(minValue, maxValue);
43
+ return Native_randomNext(minValue, maxValue) | 0;
42
44
  }
43
45
  NextDouble() {
44
46
  return Native_random();
@@ -48,7 +50,7 @@ export class NonSeeded {
48
50
  }
49
51
  }
50
52
  export function NonSeeded_$reflection() {
51
- return class_type("Random.NonSeeded", void 0, NonSeeded);
53
+ return class_type("Random.NonSeeded", undefined, NonSeeded);
52
54
  }
53
55
  export function NonSeeded_$ctor() {
54
56
  return new NonSeeded();
@@ -58,7 +60,7 @@ export class Seeded {
58
60
  this.MBIG = 2147483647;
59
61
  this.inext = 0;
60
62
  this.inextp = 0;
61
- this.seedArray = fill(new Array(56), 0, 56, 0);
63
+ this.seedArray = (new Int32Array(56));
62
64
  let ii = 0;
63
65
  let mj = 0;
64
66
  let mk = 0;
@@ -93,17 +95,17 @@ export class Seeded {
93
95
  Next1(maxValue) {
94
96
  const this$ = this;
95
97
  if (maxValue < 0) {
96
- throw new Error("maxValue must be positive");
98
+ throw ArgumentOutOfRangeException_$ctor_Z721C83C5("maxValue must be positive");
97
99
  }
98
100
  return ~~(Seeded__Sample(this$) * maxValue) | 0;
99
101
  }
100
102
  Next2(minValue, maxValue) {
101
103
  const this$ = this;
102
104
  if (minValue > maxValue) {
103
- throw new Error("minValue must be less than maxValue");
105
+ throw ArgumentOutOfRangeException_$ctor_Z721C83C5("minValue must be less than maxValue");
104
106
  }
105
- const range = toInt64(fromInt32(maxValue - minValue));
106
- return ((compare(range, toInt64(fromInt32(2147483647))) <= 0) ? (~~(Seeded__Sample(this$) * toFloat64(range)) + minValue) : ~~toInt32(toInt64(op_Addition(toInt64(fromFloat64(Seeded__GetSampleForLargeRange(this$) * toFloat64(range))), toInt64(fromInt32(minValue)))))) | 0;
107
+ const range = toInt64_unchecked(fromInt32(maxValue - minValue));
108
+ return ((compare(range, toInt64_unchecked(fromInt32(2147483647))) <= 0) ? (~~(Seeded__Sample(this$) * toFloat64(range)) + minValue) : ~~toInt32_unchecked(toInt64_unchecked(op_Addition(toInt64_unchecked(fromFloat64(Seeded__GetSampleForLargeRange(this$) * toFloat64(range))), toInt64_unchecked(fromInt32(minValue)))))) | 0;
107
109
  }
108
110
  NextDouble() {
109
111
  const this$ = this;
@@ -111,8 +113,8 @@ export class Seeded {
111
113
  }
112
114
  NextBytes(buffer) {
113
115
  const this$ = this;
114
- if (buffer == null) {
115
- throw new Error("buffer");
116
+ if (Operators_IsNull(buffer)) {
117
+ throw ArgumentNullException_$ctor_Z721C83C5("buffer");
116
118
  }
117
119
  for (let i = 0; i <= (buffer.length - 1); i++) {
118
120
  setItem(buffer, i, (Seeded__InternalSample(this$) % (~~255 + 1)) & 0xFF);
@@ -120,7 +122,7 @@ export class Seeded {
120
122
  }
121
123
  }
122
124
  export function Seeded_$reflection() {
123
- return class_type("Random.Seeded", void 0, Seeded);
125
+ return class_type("Random.Seeded", undefined, Seeded);
124
126
  }
125
127
  export function Seeded_$ctor_Z524259A4(seed) {
126
128
  return new Seeded(seed);
@@ -1,16 +1,16 @@
1
- import { compare } from "./Util.js";
1
+ import { Exception, compare } from "./Util.js";
2
2
  import { unfold, delay } from "./Seq.js";
3
- import { toUInt64, toInt64, op_Addition, fromZero } from "./BigInt.js";
3
+ import { toUInt64_unchecked, toInt64_unchecked, op_Addition, fromZero } from "./BigInt.js";
4
4
  import { op_Addition as op_Addition_1, fromParts } from "./Decimal.js";
5
5
  export function makeRangeStepFunction(step, stop, zero, add) {
6
6
  const stepComparedWithZero = compare(step, zero) | 0;
7
7
  if (stepComparedWithZero === 0) {
8
- throw new Error("The step of a range cannot be zero");
8
+ throw new Exception("The step of a range cannot be zero");
9
9
  }
10
10
  const stepGreaterThanZero = stepComparedWithZero > 0;
11
11
  return (x) => {
12
12
  const comparedWithLast = compare(x, stop) | 0;
13
- return ((stepGreaterThanZero && (comparedWithLast <= 0)) ? true : (!stepGreaterThanZero && (comparedWithLast >= 0))) ? [x, add(x, step)] : void 0;
13
+ return ((stepGreaterThanZero && (comparedWithLast <= 0)) ? true : (!stepGreaterThanZero && (comparedWithLast >= 0))) ? [x, add(x, step)] : undefined;
14
14
  };
15
15
  }
16
16
  export function integralRangeStep(start, step, stop, zero, add) {
@@ -27,19 +27,19 @@ export function rangeDouble(start, step, stop) {
27
27
  return integralRangeStep(start, step, stop, 0, (x, y) => (x + y));
28
28
  }
29
29
  export function rangeInt64(start, step, stop) {
30
- return integralRangeStep(start, step, stop, 0n, (x, y) => toInt64(op_Addition(x, y)));
30
+ return integralRangeStep(start, step, stop, 0n, (x, y) => toInt64_unchecked(op_Addition(x, y)));
31
31
  }
32
32
  export function rangeUInt64(start, step, stop) {
33
- return integralRangeStep(start, step, stop, 0n, (x, y) => toUInt64(op_Addition(x, y)));
33
+ return integralRangeStep(start, step, stop, 0n, (x, y) => toUInt64_unchecked(op_Addition(x, y)));
34
34
  }
35
35
  export function rangeChar(start, stop) {
36
- const intStop = stop.charCodeAt(0) | 0;
37
- return delay(() => unfold((c) => {
38
- if (c <= intStop) {
39
- return [String.fromCharCode(c), c + 1];
36
+ const intStop = ~~stop.charCodeAt(0) | 0;
37
+ return delay(() => unfold((i) => {
38
+ if (i <= intStop) {
39
+ return [String.fromCharCode(i & 0xFFFF), i + 1];
40
40
  }
41
41
  else {
42
- return void 0;
42
+ return undefined;
43
43
  }
44
- }, start.charCodeAt(0)));
44
+ }, ~~start.charCodeAt(0)));
45
45
  }