@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,23 +1,43 @@
1
1
  import { toString as dateToString } from "./Date.js";
2
- import { compare as numericCompare, isNumeric, multiply, toExponential, toFixed, toHex, toPrecision } from "./Numeric.js";
2
+ import { compare as numericCompare, divide, isNumeric, isIntegral, multiply, toExponential, toFixed, toHex, toPrecision } from "./Numeric.js";
3
3
  import { escape } from "./RegExp.js";
4
4
  import { toString } from "./Types.js";
5
+ import { Exception } from "./Util.js";
6
+ // Temporal date/time values (only present under --test:js-temporal) are not JS Dates. To avoid
7
+ // importing the side-effecting Temporal runtime modules into this core file — which would pull
8
+ // them into every bundle — they advertise a .NET-style formatter through this well-known symbol,
9
+ // attached to their prototype when (and only when) those modules are loaded.
10
+ const dateTimeFormattableSymbol = Symbol.for("Fable.DateTimeFormattable");
11
+ function isNetDateFormattable(rep) {
12
+ return rep != null && typeof rep[dateTimeFormattableSymbol] === "function";
13
+ }
14
+ function formatDateLike(rep, format) {
15
+ return rep instanceof Date ? dateToString(rep, format) : rep[dateTimeFormattableSymbol](format);
16
+ }
5
17
  const fsFormatRegExp = /(^|[^%])%([0+\- ]*)(\*|\d+)?(?:\.(\d+))?(\w)/g;
6
18
  const interpolateRegExp = /(?:(^|[^%])%([0+\- ]*)(\d+)?(?:\.(\d+))?(\w))?%P\(\)/g;
7
19
  const formatRegExp = /\{(\d+)(,-?\d+)?(?:\:([a-zA-Z])(\d{0,2})|\:(.+?))?\}/g;
8
20
  function isLessThan(x, y) {
9
21
  return numericCompare(x, y) < 0;
10
22
  }
23
+ export const StringComparison = {
24
+ CurrentCulture: 0,
25
+ CurrentCultureIgnoreCase: 1,
26
+ InvariantCulture: 2,
27
+ InvariantCultureIgnoreCase: 3,
28
+ Ordinal: 4,
29
+ OrdinalIgnoreCase: 5,
30
+ };
11
31
  function cmp(x, y, ic) {
12
32
  function isIgnoreCase(i) {
13
33
  return i === true ||
14
- i === 1 /* StringComparison.CurrentCultureIgnoreCase */ ||
15
- i === 3 /* StringComparison.InvariantCultureIgnoreCase */ ||
16
- i === 5 /* StringComparison.OrdinalIgnoreCase */;
34
+ i === StringComparison.CurrentCultureIgnoreCase ||
35
+ i === StringComparison.InvariantCultureIgnoreCase ||
36
+ i === StringComparison.OrdinalIgnoreCase;
17
37
  }
18
38
  function isOrdinal(i) {
19
- return i === 4 /* StringComparison.Ordinal */ ||
20
- i === 5 /* StringComparison.OrdinalIgnoreCase */;
39
+ return i === StringComparison.Ordinal ||
40
+ i === StringComparison.OrdinalIgnoreCase;
21
41
  }
22
42
  if (x == null) {
23
43
  return y == null ? 0 : -1;
@@ -45,38 +65,86 @@ export function compare(...args) {
45
65
  case 2: return cmp(args[0], args[1], false);
46
66
  case 3: return cmp(args[0], args[1], args[2]);
47
67
  case 4: return cmp(args[0], args[1], args[2] === true);
48
- case 5: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), false);
49
- case 6: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), args[5]);
50
- case 7: return cmp(args[0].substr(args[1], args[4]), args[2].substr(args[3], args[4]), args[5] === true);
51
- default: throw new Error("String.compare: Unsupported number of parameters");
68
+ case 5: return cmp(args[0].slice(args[1], args[1] + args[4]), args[2].slice(args[3], args[3] + args[4]), false);
69
+ case 6: return cmp(args[0].slice(args[1], args[1] + args[4]), args[2].slice(args[3], args[3] + args[4]), args[5]);
70
+ case 7: return cmp(args[0].slice(args[1], args[1] + args[4]), args[2].slice(args[3], args[3] + args[4]), args[5] === true);
71
+ default: throw new Exception("String.compare: Unsupported number of parameters");
52
72
  }
53
73
  }
54
74
  export function compareOrdinal(x, y) {
55
- return cmp(x, y, 4 /* StringComparison.Ordinal */);
75
+ return cmp(x, y, StringComparison.Ordinal);
56
76
  }
57
77
  export function compareTo(x, y) {
58
- return cmp(x, y, 0 /* StringComparison.CurrentCulture */);
78
+ return cmp(x, y, StringComparison.CurrentCulture);
59
79
  }
60
80
  export function startsWith(str, pattern, ic) {
81
+ if (ic === StringComparison.Ordinal) { // to avoid substring allocation
82
+ return str.startsWith(pattern);
83
+ }
84
+ if (str.length >= pattern.length) {
85
+ return cmp(str.slice(0, pattern.length), pattern, ic) === 0;
86
+ }
87
+ return false;
88
+ }
89
+ export function endsWith(str, pattern, ic) {
90
+ if (ic === StringComparison.Ordinal) { // to avoid substring allocation
91
+ return str.endsWith(pattern);
92
+ }
61
93
  if (str.length >= pattern.length) {
62
- return cmp(str.substr(0, pattern.length), pattern, ic) === 0;
94
+ return cmp(str.slice(str.length - pattern.length), pattern, ic) === 0;
95
+ }
96
+ return false;
97
+ }
98
+ export function contains(str, pattern, ic) {
99
+ if (ic === StringComparison.Ordinal) { // fast path
100
+ return str.includes(pattern);
101
+ }
102
+ const len = pattern.length;
103
+ for (let i = 0; i <= str.length - len; i++) {
104
+ if (cmp(str.slice(i, i + len), pattern, ic) === 0) {
105
+ return true;
106
+ }
63
107
  }
64
108
  return false;
65
109
  }
110
+ export function indexOf(str, searchValue, comparison, startIndex = 0) {
111
+ if (comparison === StringComparison.Ordinal) { // fast path
112
+ return str.indexOf(searchValue, startIndex);
113
+ }
114
+ const len = searchValue.length;
115
+ for (let i = Math.max(startIndex, 0); i <= str.length - len; i++) {
116
+ if (cmp(str.slice(i, i + len), searchValue, comparison) === 0) {
117
+ return i;
118
+ }
119
+ }
120
+ return -1;
121
+ }
122
+ export function lastIndexOf(str, searchValue, comparison, startIndex = str.length - 1) {
123
+ if (comparison === StringComparison.Ordinal) { // fast path
124
+ return str.lastIndexOf(searchValue, startIndex);
125
+ }
126
+ const len = searchValue.length;
127
+ for (let i = Math.min(startIndex, str.length - len); i >= 0; i--) {
128
+ if (cmp(str.slice(i, i + len), searchValue, comparison) === 0) {
129
+ return i;
130
+ }
131
+ }
132
+ return -1;
133
+ }
66
134
  export function indexOfAny(str, anyOf, ...args) {
67
135
  if (str == null || str === "") {
68
136
  return -1;
69
137
  }
70
138
  const startIndex = (args.length > 0) ? args[0] : 0;
71
139
  if (startIndex < 0) {
72
- throw new Error("Start index cannot be negative");
140
+ throw new Exception("Start index cannot be negative");
73
141
  }
74
142
  const length = (args.length > 1) ? args[1] : str.length - startIndex;
75
143
  if (length < 0) {
76
- throw new Error("Length cannot be negative");
144
+ throw new Exception("Length cannot be negative");
77
145
  }
78
146
  if (startIndex + length > str.length) {
79
- throw new Error("Invalid startIndex and length");
147
+ throw new Exception("Invalid startIndex and length");
80
148
  }
81
149
  const endIndex = startIndex + length;
82
150
  const anyOfAsStr = "".concat.apply("", anyOf);
@@ -131,7 +199,7 @@ export function toText(arg) {
131
199
  }
132
200
  export function toFail(arg) {
133
201
  return continuePrint((x) => {
134
- throw new Error(x);
202
+ throw new Exception(x);
135
203
  }, arg);
136
204
  }
137
205
  function formatReplacement(rep, flags, padLength, precision, format) {
@@ -179,8 +247,11 @@ function formatReplacement(rep, flags, padLength, precision, format) {
179
247
  break;
180
248
  }
181
249
  }
182
- else if (rep instanceof Date) {
183
- rep = dateToString(rep);
250
+ else if (rep instanceof Date || isNetDateFormattable(rep)) {
251
+ rep = formatDateLike(rep, undefined);
252
+ }
253
+ else if (format === "A" && typeof rep === "string") {
254
+ rep = "\"" + rep + "\"";
184
255
  }
185
256
  else {
186
257
  rep = toString(rep);
@@ -218,7 +289,7 @@ function createPrinter(cont, _strParts, _matches, _result = "", padArg = -1) {
218
289
  }
219
290
  else if (padLength === "*") {
220
291
  if (arg < 0) {
221
- throw new Error("Non-negative number required");
292
+ throw new Exception("Non-negative number required");
222
293
  }
223
294
  padArg = arg;
224
295
  continue;
@@ -264,6 +335,17 @@ export function fsFormat(str) {
264
335
  }
265
336
  };
266
337
  }
338
+ function splitIntAndDecimalPart(value) {
339
+ let [repInt, repDecimal] = value.split(".");
340
+ repDecimal === undefined && (repDecimal = "");
341
+ return {
342
+ integral: repInt,
343
+ decimal: repDecimal
344
+ };
345
+ }
346
+ function thousandSeparate(value) {
347
+ return value.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
348
+ }
267
349
  export function format(str, ...args) {
268
350
  let str2;
269
351
  if (typeof str === "object") {
@@ -276,45 +358,152 @@ export function format(str, ...args) {
276
358
  }
277
359
  return str2.replace(formatRegExp, (_, idx, padLength, format, precision, pattern) => {
278
360
  if (idx < 0 || idx >= args.length) {
279
- throw new Error("Index must be greater or equal to zero and less than the arguments' length.");
361
+ throw new Exception("Index must be greater or equal to zero and less than the arguments' length.");
280
362
  }
281
363
  let rep = args[idx];
364
+ let parts;
282
365
  if (isNumeric(rep)) {
283
- precision = precision == null ? null : parseInt(precision, 10);
366
+ precision = precision == "" ? null : parseInt(precision, 10);
284
367
  switch (format) {
368
+ case "b":
369
+ case "B":
370
+ if (!isIntegral(rep)) {
371
+ throw new Exception("Format specifier was invalid.");
372
+ }
373
+ rep = (rep >>> 0).toString(2).replace(/^0+/, "").padStart(precision || 1, "0");
374
+ break;
375
+ case "c":
376
+ case "C":
377
+ const isNegative = isLessThan(rep, 0);
378
+ if (isLessThan(rep, 0)) {
379
+ rep = multiply(rep, -1);
380
+ }
381
+ precision = precision == null ? 2 : precision;
382
+ rep = toFixed(rep, precision);
383
+ parts = splitIntAndDecimalPart(rep);
384
+ if (precision > 0) {
385
+ rep = "¤" + thousandSeparate(parts.integral) + "." + padRight(parts.decimal, precision, "0");
386
+ }
387
+ else {
388
+ rep = "¤" + thousandSeparate(parts.integral);
389
+ }
390
+ if (isNegative) {
391
+ rep = "(" + rep + ")";
392
+ }
393
+ break;
394
+ case "d":
395
+ case "D":
396
+ if (!isIntegral(rep)) {
397
+ throw new Exception("Format specifier was invalid.");
398
+ }
399
+ rep = String(rep);
400
+ if (precision != null) {
401
+ if (rep.startsWith("-")) {
402
+ rep = "-" + padLeft(rep.substring(1), precision, "0");
403
+ }
404
+ else {
405
+ rep = padLeft(rep, precision, "0");
406
+ }
407
+ }
408
+ break;
409
+ case "e":
410
+ case "E": {
411
+ precision = precision != null ? precision : 6;
412
+ rep = String(toExponential(rep, precision));
413
+ // .NET always signs the exponent and pads it to at least three digits
414
+ const eIdx = rep.indexOf("e");
415
+ rep = rep.slice(0, eIdx) + format + rep[eIdx + 1] + padLeft(rep.slice(eIdx + 2), 3, "0");
416
+ break;
417
+ }
285
418
  case "f":
286
419
  case "F":
287
420
  precision = precision != null ? precision : 2;
288
421
  rep = toFixed(rep, precision);
422
+ if (precision > 0) {
423
+ parts = splitIntAndDecimalPart(rep);
424
+ rep = parts.integral + "." + padRight(parts.decimal, precision, "0");
425
+ }
289
426
  break;
290
427
  case "g":
291
- case "G":
428
+ case "G": {
292
429
  rep = precision != null ? toPrecision(rep, precision) : toPrecision(rep);
430
+ // Handle exponential notation: only trim trailing zeros from mantissa, not from exponent.
431
+ // .NET G format guarantees an exponent of at least 2 digits with an explicit sign (e.g. "E-07").
432
+ const eIdx = rep.indexOf("e");
433
+ if (eIdx >= 0) {
434
+ const mantissa = trimEnd(trimEnd(rep.slice(0, eIdx), "0"), ".");
435
+ const expSign = rep[eIdx + 1]; // toPrecision always emits "+" or "-"
436
+ const expDigits = rep.slice(eIdx + 2);
437
+ const paddedExpDigits = expDigits.length < 2 ? "0" + expDigits : expDigits;
438
+ const eChar = format === "G" ? "E" : "e";
439
+ rep = mantissa + eChar + expSign + paddedExpDigits;
440
+ }
441
+ else if (rep.indexOf(".") >= 0) {
442
+ rep = trimEnd(trimEnd(rep, "0"), ".");
443
+ }
293
444
  break;
294
- case "e":
295
- case "E":
296
- rep = precision != null ? toExponential(rep, precision) : toExponential(rep);
445
+ }
446
+ case "n":
447
+ case "N":
448
+ precision = precision != null ? precision : 2;
449
+ rep = toFixed(rep, precision);
450
+ parts = splitIntAndDecimalPart(rep);
451
+ if (precision > 0) {
452
+ rep = thousandSeparate(parts.integral) + "." + padRight(parts.decimal, precision, "0");
453
+ }
454
+ else {
455
+ rep = thousandSeparate(parts.integral);
456
+ }
297
457
  break;
298
458
  case "p":
299
459
  case "P":
300
460
  precision = precision != null ? precision : 2;
301
- rep = toFixed(multiply(rep, 100), precision) + " %";
302
- break;
303
- case "d":
304
- case "D":
305
- rep = precision != null ? padLeft(String(rep), precision, "0") : String(rep);
461
+ rep = toFixed(multiply(rep, 100), precision);
462
+ parts = splitIntAndDecimalPart(rep);
463
+ if (precision > 0) {
464
+ rep = thousandSeparate(parts.integral) + "." + padRight(parts.decimal, precision, "0") + " %";
465
+ }
466
+ else {
467
+ rep = thousandSeparate(parts.integral) + " %";
468
+ }
306
469
  break;
470
+ case "r":
471
+ case "R":
472
+ throw new Exception("The round-trip format is not supported by Fable");
307
473
  case "x":
308
474
  case "X":
309
- rep = precision != null ? padLeft(toHex(rep), precision, "0") : toHex(rep);
475
+ if (!isIntegral(rep)) {
476
+ throw new Exception("Format specifier was invalid.");
477
+ }
478
+ precision = precision != null ? precision : 1;
479
+ rep = padLeft(toHex(rep), precision, "0");
310
480
  if (format === "X") {
311
481
  rep = rep.toUpperCase();
312
482
  }
313
483
  break;
314
484
  default:
485
+ // If we have format and were not able to handle it throw
486
+ // See: https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings#standard-format-specifiers
487
+ if (format) {
488
+ throw new Exception("Format specifier was invalid.");
489
+ }
315
490
  if (pattern) {
316
491
  let sign = "";
317
- rep = pattern.replace(/([0#,]+)(\.[0#]+)?/, (_, intPart, decimalPart) => {
492
+ const patternStr = pattern;
493
+ // Each `%` scales the value by 100 and is kept as a literal in the output
494
+ const percents = (patternStr.match(/%/g) ?? []).length;
495
+ if (percents > 0) {
496
+ rep = multiply(rep, Math.pow(100, percents));
497
+ }
498
+ // .NET ignores commas placed after the decimal placeholders, hence the trailing group
499
+ rep = patternStr.replace(/([0#,]+)(\.[0#]+)?(,*)/, (_, intPart, decimalPart) => {
500
+ // Commas between the last integer placeholder and the decimal point scale the
501
+ // value down by 1000 each; commas anywhere else only turn on digit grouping
502
+ const scaleCommas = /,*$/.exec(intPart)[0].length;
503
+ if (scaleCommas > 0) {
504
+ intPart = intPart.substring(0, intPart.length - scaleCommas);
505
+ rep = divide(rep, Math.pow(1000, scaleCommas));
506
+ }
318
507
  if (isLessThan(rep, 0)) {
319
508
  rep = multiply(rep, -1);
320
509
  sign = "-";
@@ -348,8 +537,8 @@ export function format(str, ...args) {
348
537
  }
349
538
  }
350
539
  }
351
- else if (rep instanceof Date) {
352
- rep = dateToString(rep, pattern || format);
540
+ else if (rep instanceof Date || isNetDateFormattable(rep)) {
541
+ rep = formatDateLike(rep, pattern || format);
353
542
  }
354
543
  else {
355
544
  rep = toString(rep);
@@ -361,13 +550,9 @@ export function format(str, ...args) {
361
550
  return rep;
362
551
  });
363
552
  }
364
- export function endsWith(str, search) {
365
- const idx = str.lastIndexOf(search);
366
- return idx >= 0 && idx === str.length - search.length;
367
- }
368
553
  export function initialize(n, f) {
369
554
  if (n < 0) {
370
- throw new Error("String length must be non-negative");
555
+ throw new Exception("String length must be non-negative");
371
556
  }
372
557
  const xs = new Array(n);
373
558
  for (let i = 0; i < n; i++) {
@@ -377,7 +562,7 @@ export function initialize(n, f) {
377
562
  }
378
563
  export function insert(str, startIndex, value) {
379
564
  if (startIndex < 0 || startIndex > str.length) {
380
- throw new Error("startIndex is negative or greater than the length of this instance.");
565
+ throw new Exception("startIndex is negative or greater than the length of this instance.");
381
566
  }
382
567
  return str.substring(0, startIndex) + value + str.substring(startIndex);
383
568
  }
@@ -401,12 +586,12 @@ export function join(delimiter, xs) {
401
586
  export function joinWithIndices(delimiter, xs, startIndex, count) {
402
587
  const endIndexPlusOne = startIndex + count;
403
588
  if (endIndexPlusOne > xs.length) {
404
- throw new Error("Index and count must refer to a location within the buffer.");
589
+ throw new Exception("Index and count must refer to a location within the buffer.");
405
590
  }
406
591
  return xs.slice(startIndex, endIndexPlusOne).join(delimiter);
407
592
  }
408
593
  function notSupported(name) {
409
- throw new Error("The environment doesn't support '" + name + "', please use a polyfill.");
594
+ throw new Exception("The environment doesn't support '" + name + "', please use a polyfill.");
410
595
  }
411
596
  export function toBase64String(inArray) {
412
597
  let str = "";
@@ -439,10 +624,10 @@ export function padRight(str, len, ch) {
439
624
  }
440
625
  export function remove(str, startIndex, count) {
441
626
  if (startIndex >= str.length) {
442
- throw new Error("startIndex must be less than length of string");
627
+ throw new Exception("startIndex must be less than length of string");
443
628
  }
444
629
  if (typeof count === "number" && (startIndex + count) > str.length) {
445
- throw new Error("Index and count must refer to a location within the string.");
630
+ throw new Exception("Index and count must refer to a location within the string.");
446
631
  }
447
632
  return str.slice(0, startIndex) + (typeof count === "number" ? str.substr(startIndex + count) : "");
448
633
  }
@@ -454,7 +639,7 @@ export function replicate(n, x) {
454
639
  }
455
640
  export function getCharAtIndex(input, index) {
456
641
  if (index < 0 || index >= input.length) {
457
- throw new Error("Index was outside the bounds of the array.");
642
+ throw new Exception("Index was outside the bounds of the array.");
458
643
  }
459
644
  return input[index];
460
645
  }
@@ -462,7 +647,7 @@ export function split(str, splitters, count, options) {
462
647
  count = typeof count === "number" ? count : undefined;
463
648
  options = typeof options === "number" ? options : 0;
464
649
  if (count && count < 0) {
465
- throw new Error("Count cannot be less than zero");
650
+ throw new Exception("Count cannot be less than zero");
466
651
  }
467
652
  if (count === 0) {
468
653
  return [];
@@ -523,7 +708,7 @@ export function filter(pred, x) {
523
708
  }
524
709
  export function substring(str, startIndex, length) {
525
710
  if ((startIndex + (length || 0) > str.length)) {
526
- throw new Error("Invalid startIndex and/or length");
711
+ throw new Exception("Invalid startIndex and/or length");
527
712
  }
528
713
  return length != null ? str.substr(startIndex, length) : str.substr(startIndex);
529
714
  }
@@ -537,7 +722,10 @@ export function fmtWith(fmts) {
537
722
  return (strs, ...args) => ({ strs, args, fmts });
538
723
  }
539
724
  export function getFormat(s) {
725
+ const strs = s.strs.map((value) => value.replace(/{/g, '{{').replace(/}/g, '}}'));
540
726
  return s.fmts
541
- ? s.strs.reduce((acc, newPart, index) => acc + `{${String(index - 1) + s.fmts[index - 1]}}` + newPart)
542
- : s.strs.reduce((acc, newPart, index) => acc + `{${index - 1}}` + newPart);
727
+ ? strs
728
+ .reduce((acc, newPart, index) => acc + `{${String(index - 1) + s.fmts[index - 1]}}` + newPart)
729
+ : strs
730
+ .reduce((acc, newPart, index) => acc + `{${index - 1}}` + newPart);
543
731
  }
@@ -1,15 +1,31 @@
1
- import { disposeSafe, defaultOf, toIterator, getEnumerator, structuralHash, equals as equals_1, compare } from "./Util.js";
1
+ import { disposeSafe, defaultOf, toIterator, getEnumerator, structuralHash, equals as equals_1, compare, Exception } from "./Util.js";
2
2
  import { class_type } from "./Reflection.js";
3
+ import { SR_Arg_KeyNotFound } from "./Global.js";
3
4
  import { toArray, empty, singleton, append, enumerateWhile, delay } from "./Seq.js";
4
5
  import { setItem, initialize, copyTo, fill, item as item_1 } from "./Array.js";
5
6
  import { max } from "./Double.js";
7
+ import { ArgumentOutOfRangeException_$ctor_Z721C83C5 } from "./System.js";
8
+ export class KeyNotFoundException extends Exception {
9
+ constructor(message) {
10
+ super(message);
11
+ }
12
+ }
13
+ export function KeyNotFoundException_$reflection() {
14
+ return class_type("System.Collections.Generic.KeyNotFoundException", undefined, KeyNotFoundException, class_type("System.Exception"));
15
+ }
16
+ export function KeyNotFoundException_$ctor_Z721C83C5(message) {
17
+ return new KeyNotFoundException(message);
18
+ }
19
+ export function KeyNotFoundException_$ctor() {
20
+ return KeyNotFoundException_$ctor_Z721C83C5(SR_Arg_KeyNotFound);
21
+ }
6
22
  export class Comparer$1 {
7
23
  constructor(comparison) {
8
24
  this.comparison = comparison;
9
25
  }
10
26
  Compare(x, y) {
11
27
  const _ = this;
12
- return _.comparison(x, y) | 0;
28
+ return ((x == null) ? ((y == null) ? 0 : -1) : ((y == null) ? 1 : _.comparison(x, y))) | 0;
13
29
  }
14
30
  }
15
31
  export function Comparer$1_$reflection(gen0) {
@@ -19,13 +35,13 @@ export function Comparer$1_$ctor_47C913C(comparison) {
19
35
  return new Comparer$1(comparison);
20
36
  }
21
37
  export function Comparer$1_get_Default() {
22
- return Comparer$1_$ctor_47C913C(compare);
38
+ return Comparer$1_$ctor_47C913C((e, e_1) => (compare(e, e_1) | 0));
23
39
  }
24
40
  export function Comparer$1_Create_47C913C(comparison) {
25
41
  return Comparer$1_$ctor_47C913C(comparison);
26
42
  }
27
43
  export function Comparer$1__Compare_5BDDA0(_, x, y) {
28
- return _.comparison(x, y);
44
+ return _.comparison(x, y) | 0;
29
45
  }
30
46
  export class EqualityComparer$1 {
31
47
  constructor(equals, getHashCode) {
@@ -34,7 +50,7 @@ export class EqualityComparer$1 {
34
50
  }
35
51
  Equals(x, y) {
36
52
  const _ = this;
37
- return _.equals(x, y);
53
+ return (x == null) ? (y == null) : ((y == null) ? false : _.equals(x, y));
38
54
  }
39
55
  GetHashCode(x) {
40
56
  const _ = this;
@@ -48,7 +64,7 @@ export function EqualityComparer$1_$ctor_Z6EE254AB(equals, getHashCode) {
48
64
  return new EqualityComparer$1(equals, getHashCode);
49
65
  }
50
66
  export function EqualityComparer$1_get_Default() {
51
- return EqualityComparer$1_$ctor_Z6EE254AB(equals_1, structuralHash);
67
+ return EqualityComparer$1_$ctor_Z6EE254AB(equals_1, (obj) => (structuralHash(obj) | 0));
52
68
  }
53
69
  export function EqualityComparer$1_Create_Z6EE254AB(equals, getHashCode) {
54
70
  return EqualityComparer$1_$ctor_Z6EE254AB(equals, getHashCode);
@@ -57,7 +73,7 @@ export function EqualityComparer$1__Equals_5BDDA0(_, x, y) {
57
73
  return _.equals(x, y);
58
74
  }
59
75
  export function EqualityComparer$1__GetHashCode_2B595(_, x) {
60
- return _.getHashCode(x);
76
+ return _.getHashCode(x) | 0;
61
77
  }
62
78
  export class Stack$1 {
63
79
  constructor(initialContents, initialCount) {
@@ -107,7 +123,7 @@ export function Stack$1__Ensure_Z524259A4(_, newSize) {
107
123
  }
108
124
  }
109
125
  export function Stack$1__get_Count(_) {
110
- return _.count;
126
+ return _.count | 0;
111
127
  }
112
128
  export function Stack$1__Pop(_) {
113
129
  _.count = ((_.count - 1) | 0);
@@ -191,7 +207,7 @@ function Queue$1_$ctor_Z3B4C077E(initialContents, initialCount) {
191
207
  }
192
208
  export function Queue$1_$ctor_Z524259A4(initialCapacity) {
193
209
  if (initialCapacity < 0) {
194
- throw new Error("capacity is less than 0");
210
+ throw ArgumentOutOfRangeException_$ctor_Z721C83C5("capacity is less than 0");
195
211
  }
196
212
  return Queue$1_$ctor_Z3B4C077E(fill(new Array(initialCapacity), 0, initialCapacity, null), 0);
197
213
  }
@@ -203,7 +219,7 @@ export function Queue$1_$ctor_BB573A(xs) {
203
219
  return Queue$1_$ctor_Z3B4C077E(arr, arr.length);
204
220
  }
205
221
  export function Queue$1__get_Count(_) {
206
- return _.count;
222
+ return _.count | 0;
207
223
  }
208
224
  export function Queue$1__Enqueue_2B595(_, value) {
209
225
  if (_.count === Queue$1__size(_)) {
@@ -215,7 +231,7 @@ export function Queue$1__Enqueue_2B595(_, value) {
215
231
  }
216
232
  export function Queue$1__Dequeue(_) {
217
233
  if (_.count === 0) {
218
- throw new Error("Queue is empty");
234
+ throw new Exception("Queue is empty");
219
235
  }
220
236
  const value = item_1(_.head, _.contents);
221
237
  _.head = (((_.head + 1) % Queue$1__size(_)) | 0);
@@ -224,7 +240,7 @@ export function Queue$1__Dequeue(_) {
224
240
  }
225
241
  export function Queue$1__Peek(_) {
226
242
  if (_.count === 0) {
227
- throw new Error("Queue is empty");
243
+ throw new Exception("Queue is empty");
228
244
  }
229
245
  return item_1(_.head, _.contents);
230
246
  }
@@ -288,10 +304,10 @@ export function Queue$1__CopyTo_Z3B4C077E(_, target, start) {
288
304
  }
289
305
  }
290
306
  export function Queue$1__size(this$) {
291
- return this$.contents.length;
307
+ return this$.contents.length | 0;
292
308
  }
293
309
  export function Queue$1__toIndex_Z524259A4(this$, i) {
294
- return (this$.head + i) % Queue$1__size(this$);
310
+ return ((this$.head + i) % Queue$1__size(this$)) | 0;
295
311
  }
296
312
  export function Queue$1__ensure_Z524259A4(this$, requiredSize) {
297
313
  const newBuffer = fill(new Array(requiredSize), 0, requiredSize, null);