@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
@@ -7,29 +7,27 @@ open System
7
7
  module AsyncOptionCE =
8
8
  type AsyncOptionBuilder() =
9
9
 
10
- member inline _.Return(value: 'value) : Async<'value option> = AsyncOption.retn value
10
+ member inline _.Return(value: 'value) : Async<'value option> = AsyncOption.some value
11
11
 
12
12
  member inline _.ReturnFrom(value: Async<'value option>) : Async<'value option> = value
13
13
 
14
14
  member inline _.Zero() : Async<unit option> =
15
- option.Zero()
15
+ Some()
16
16
  |> async.Return
17
17
 
18
18
  member inline _.Bind
19
- (
20
- input: Async<'input option>,
21
- [<InlineIfLambda>] binder: 'input -> Async<'output option>
22
- ) : Async<'output option> =
19
+ (input: Async<'input option>, [<InlineIfLambda>] binder: 'input -> Async<'output option>) : Async<
20
+ 'output option
21
+ >
22
+ =
23
23
  AsyncOption.bind binder input
24
24
 
25
25
  member inline _.Delay(generator: unit -> Async<'value option>) : Async<'value option> =
26
26
  async.Delay generator
27
27
 
28
28
  member inline this.Combine
29
- (
30
- computation1: Async<_ option>,
31
- computation2: Async<_ option>
32
- ) : Async<_ option> =
29
+ (computation1: Async<_ option>, computation2: Async<_ option>)
30
+ : Async<_ option> =
33
31
  this.Bind(computation1, (fun () -> computation2))
34
32
 
35
33
  member inline _.TryWith
@@ -40,20 +38,13 @@ module AsyncOptionCE =
40
38
  async.TryWith(computation, handler)
41
39
 
42
40
  member inline _.TryFinally
43
- (
44
- computation: Async<'value option>,
45
- [<InlineIfLambda>] compensation: unit -> unit
46
- ) : Async<'value option> =
41
+ (computation: Async<'value option>, [<InlineIfLambda>] compensation: unit -> unit)
42
+ : Async<'value option> =
47
43
  async.TryFinally(computation, compensation)
48
-
49
-
50
- #if NETSTANDARD2_1
51
-
44
+ #if !FABLE_COMPILER
52
45
  member inline _.TryFinallyAsync
53
- (
54
- computation: Async<'value option>,
55
- [<InlineIfLambda>] compensation: unit -> ValueTask
56
- ) : Async<'value option> =
46
+ (computation: Async<'value option>, [<InlineIfLambda>] compensation: unit -> ValueTask)
47
+ : Async<'value option> =
57
48
  let compensation =
58
49
  async {
59
50
  let vTask = compensation ()
@@ -86,10 +77,8 @@ module AsyncOptionCE =
86
77
  #endif
87
78
 
88
79
  member this.While
89
- (
90
- guard: unit -> bool,
91
- computation: Async<unit option>
92
- ) : Async<unit option> =
80
+ (guard: unit -> bool, computation: Async<unit option>)
81
+ : Async<unit option> =
93
82
  if not (guard ()) then
94
83
  this.Zero()
95
84
  else
@@ -103,15 +92,6 @@ module AsyncOptionCE =
103
92
  /// </summary>
104
93
  member inline _.Source(async: Async<'value option>) : Async<'value option> = async
105
94
 
106
- #if !FABLE_COMPILER
107
- /// <summary>
108
- /// Method lets us transform data types into our internal representation.
109
- /// </summary>
110
- member inline _.Source(task: Task<'value option>) : Async<'value option> =
111
- task
112
- |> Async.AwaitTask
113
-
114
- #endif
115
95
 
116
96
  let asyncOption = AsyncOptionBuilder()
117
97
 
@@ -154,10 +134,8 @@ module AsyncOptionCEExtensions =
154
134
  )
155
135
 
156
136
  member inline this.For
157
- (
158
- sequence: #seq<'input>,
159
- binder: 'input -> Async<unit option>
160
- ) : Async<unit option> =
137
+ (sequence: #seq<'input>, binder: 'input -> Async<unit option>)
138
+ : Async<unit option> =
161
139
  this.Using(
162
140
  sequence.GetEnumerator(),
163
141
  fun enum -> this.While(enum.MoveNext, this.Delay(fun () -> binder enum.Current))
@@ -180,4 +158,17 @@ module AsyncOptionCEExtensions =
180
158
  a
181
159
  |> Async.AwaitTask
182
160
  |> Async.map Some
161
+
162
+ [<AutoOpen>]
163
+ module AsyncOptionCEExtensionsHigher =
164
+
165
+ type AsyncOptionBuilder with
166
+
167
+ /// <summary>
168
+ /// Method lets us transform data types into our internal representation.
169
+ /// </summary>
170
+ member inline _.Source(task: Task<'value option>) : Async<'value option> =
171
+ task
172
+ |> Async.AwaitTask
173
+
183
174
  #endif
@@ -1,6 +1,7 @@
1
- import { class_type } from "../fable-library-js.4.14.0/Reflection.js";
2
- import { singleton } from "../fable-library-js.4.14.0/AsyncBuilder.js";
3
- import { value as value_2, some } from "../fable-library-js.4.14.0/Option.js";
1
+
2
+ import { class_type } from "../fable-library-js.5.17.2/Reflection.js";
3
+ import { singleton } from "../fable-library-js.5.17.2/AsyncBuilder.js";
4
+ import { value as value_2, some } from "../fable-library-js.5.17.2/Option.js";
4
5
 
5
6
  export class AsyncOptionCE_AsyncOptionBuilder {
6
7
  constructor() {
@@ -8,7 +9,7 @@ export class AsyncOptionCE_AsyncOptionBuilder {
8
9
  }
9
10
 
10
11
  export function AsyncOptionCE_AsyncOptionBuilder_$reflection() {
11
- return class_type("FsToolkit.ErrorHandling.AsyncOptionCE.AsyncOptionBuilder", void 0, AsyncOptionCE_AsyncOptionBuilder);
12
+ return class_type("FsToolkit.ErrorHandling.AsyncOptionCE.AsyncOptionBuilder", undefined, AsyncOptionCE_AsyncOptionBuilder);
12
13
  }
13
14
 
14
15
  export function AsyncOptionCE_AsyncOptionBuilder_$ctor() {
@@ -17,15 +18,15 @@ export function AsyncOptionCE_AsyncOptionBuilder_$ctor() {
17
18
 
18
19
  export function AsyncOptionCE_AsyncOptionBuilder__While_78DDE493(this$, guard, computation) {
19
20
  if (!guard()) {
20
- return singleton.Return(some(void 0));
21
+ return singleton.Return(some(undefined));
21
22
  }
22
23
  else {
23
- return singleton.Bind(computation, (x_1) => {
24
- if (x_1 == null) {
25
- return singleton.Return(void 0);
24
+ return singleton.Bind(computation, (x) => {
25
+ if (x == null) {
26
+ return singleton.Return(undefined);
26
27
  }
27
28
  else {
28
- const unitVar_2 = value_2(x_1);
29
+ value_2(x);
29
30
  return AsyncOptionCE_AsyncOptionBuilder__While_78DDE493(this$, guard, computation);
30
31
  }
31
32
  });
@@ -34,4 +35,3 @@ export function AsyncOptionCE_AsyncOptionBuilder__While_78DDE493(this$, guard, c
34
35
 
35
36
  export const AsyncOptionCE_asyncOption = AsyncOptionCE_AsyncOptionBuilder_$ctor();
36
37
 
37
- //# sourceMappingURL=AsyncOptionCE.fs.js.map
@@ -1,23 +1,21 @@
1
1
  namespace FsToolkit.ErrorHandling
2
2
 
3
3
  open System.Threading.Tasks
4
+ #if !FABLE_COMPILER
5
+ open System.Runtime.ExceptionServices
6
+ #endif
4
7
 
5
8
  [<RequireQualifiedAccess>]
6
9
  module AsyncResult =
7
10
 
8
-
9
- let inline retn (value: 'ok) : Async<Result<'ok, 'error>> =
11
+ let inline ok (value: 'ok) : Async<Result<'ok, 'error>> =
10
12
  Ok value
11
13
  |> Async.singleton
12
14
 
13
- let inline ok (value: 'ok) : Async<Result<'ok, 'error>> = retn value
14
-
15
- let inline returnError (error: 'error) : Async<Result<'ok, 'error>> =
15
+ let inline error (error: 'error) : Async<Result<'ok, 'error>> =
16
16
  Error error
17
17
  |> Async.singleton
18
18
 
19
- let inline error (error: 'error) : Async<Result<'ok, 'error>> = returnError error
20
-
21
19
  let inline map
22
20
  ([<InlineIfLambda>] mapper: 'input -> 'output)
23
21
  (input: Async<Result<'input, 'error>>)
@@ -34,7 +32,7 @@ module AsyncResult =
34
32
  ([<InlineIfLambda>] binder: 'input -> Async<Result<'output, 'error>>)
35
33
  (input: Async<Result<'input, 'error>>)
36
34
  : Async<Result<'output, 'error>> =
37
- Async.bind (Result.either binder returnError) input
35
+ Async.bind (Result.either binder error) input
38
36
 
39
37
  let inline foldResult
40
38
  ([<InlineIfLambda>] onSuccess: 'input -> 'output)
@@ -160,6 +158,14 @@ module AsyncResult =
160
158
  value
161
159
  |> Async.map (Result.requireSome error)
162
160
 
161
+ // Converts an async-wrapped Option to a Result, using the given error factory if None.
162
+ let inline requireSomeWith
163
+ ([<InlineIfLambda>] errorFactory: unit -> 'error)
164
+ (value: Async<'ok option>)
165
+ : Async<Result<'ok, 'error>> =
166
+ value
167
+ |> Async.map (Result.requireSomeWith errorFactory)
168
+
163
169
  // Converts an async-wrapped Option to a Result, using the given error if Some.
164
170
  let inline requireNone
165
171
  (error: 'error)
@@ -168,6 +174,14 @@ module AsyncResult =
168
174
  value
169
175
  |> Async.map (Result.requireNone error)
170
176
 
177
+ // Converts an async-wrapped Option to a Result, using the given error factory if Some.
178
+ let inline requireNoneWith
179
+ ([<InlineIfLambda>] errorFactory: unit -> 'error)
180
+ (value: Async<'ok option>)
181
+ : Async<Result<unit, 'error>> =
182
+ value
183
+ |> Async.map (Result.requireNoneWith errorFactory)
184
+
171
185
  // Converts an async-wrapped ValueOption to a Result, using the given error if ValueNone.
172
186
  let inline requireValueSome
173
187
  (error: 'error)
@@ -224,6 +238,13 @@ module AsyncResult =
224
238
  values
225
239
  |> Async.map (Result.requireHead error)
226
240
 
241
+
242
+ /// Returns the async-wrapped result if it is Ok and the predicate is true, or if the async wrapped result is Error.
243
+ /// If the predicate is false, returns a new async-wrapped Error result with the error value.
244
+ let inline require predicate error result =
245
+ result
246
+ |> Async.map (Result.require predicate error)
247
+
227
248
  /// Replaces an error value of an async-wrapped result with a custom error
228
249
  /// value.
229
250
  let inline setError
@@ -340,6 +361,20 @@ module AsyncResult =
340
361
  | Choice2Of2 ex -> Error(exnMapper ex)
341
362
  )
342
363
 
364
+ /// Gets the value in the Ok case or re-raises the exception in the Error case
365
+ let inline getOrReraise (input: Async<Result<'ok, exn>>) : Async<'ok> =
366
+ async {
367
+ match! input with
368
+ | Ok a -> return a
369
+ | Error exn ->
370
+ #if FABLE_COMPILER
371
+ return raise exn
372
+ #else
373
+ ExceptionDispatchInfo.Capture(exn).Throw()
374
+ return Unchecked.defaultof<_>
375
+ #endif
376
+ }
377
+
343
378
  /// Lift Async to AsyncResult
344
379
  let inline ofAsync (value: Async<'ok>) : Async<Result<'ok, 'error>> =
345
380
  value
@@ -437,3 +472,12 @@ module AsyncResult =
437
472
  Result.requireHead error
438
473
  >> Async.singleton
439
474
  )
475
+
476
+ /// Returns the async-wrapped result if it is Ok and the checkFunc returns an async-wrapped Ok result or if the async-wrapped result is Error.
477
+ /// If the checkFunc returns an async-wrapped Error result, returns the async-wrapped Error result.
478
+ let inline check ([<InlineIfLambda>] checkFunc) (result) =
479
+ result
480
+ |> bind (fun o ->
481
+ checkFunc o
482
+ |> map (fun _ -> o)
483
+ )
@@ -34,10 +34,8 @@ module AsyncResultCE =
34
34
  async.Delay generator
35
35
 
36
36
  member inline this.Combine
37
- (
38
- computation1: Async<Result<unit, 'error>>,
39
- computation2: Async<Result<'ok, 'error>>
40
- ) : Async<Result<'ok, 'error>> =
37
+ (computation1: Async<Result<unit, 'error>>, computation2: Async<Result<'ok, 'error>>)
38
+ : Async<Result<'ok, 'error>> =
41
39
  this.Bind(computation1, (fun () -> computation2))
42
40
 
43
41
  member inline _.TryWith
@@ -48,14 +46,10 @@ module AsyncResultCE =
48
46
  async.TryWith(computation, handler)
49
47
 
50
48
  member inline _.TryFinally
51
- (
52
- computation: Async<Result<'ok, 'error>>,
53
- [<InlineIfLambda>] compensation: unit -> unit
54
- ) : Async<Result<'ok, 'error>> =
49
+ (computation: Async<Result<'ok, 'error>>, [<InlineIfLambda>] compensation: unit -> unit)
50
+ : Async<Result<'ok, 'error>> =
55
51
  async.TryFinally(computation, compensation)
56
-
57
- #if NETSTANDARD2_1
58
-
52
+ #if !FABLE_COMPILER
59
53
  member inline _.TryFinallyAsync
60
54
  (
61
55
  computation: Async<Result<'ok, 'error>>,
@@ -91,13 +85,9 @@ module AsyncResultCE =
91
85
  )
92
86
  )
93
87
  #endif
94
-
95
-
96
88
  member inline this.While
97
- (
98
- [<InlineIfLambda>] guard: unit -> bool,
99
- computation: Async<Result<unit, 'error>>
100
- ) : Async<Result<unit, 'error>> =
89
+ ([<InlineIfLambda>] guard: unit -> bool, computation: Async<Result<unit, 'error>>)
90
+ : Async<Result<unit, 'error>> =
101
91
  if guard () then
102
92
  let mutable whileAsync = Unchecked.defaultof<_>
103
93
 
@@ -110,20 +100,10 @@ module AsyncResultCE =
110
100
 
111
101
 
112
102
  member inline _.BindReturn
113
- (
114
- x: Async<Result<'okInput, 'error>>,
115
- [<InlineIfLambda>] f: 'okInput -> 'okOutput
116
- ) : Async<Result<'okOutput, 'error>> =
103
+ (x: Async<Result<'okInput, 'error>>, [<InlineIfLambda>] f: 'okInput -> 'okOutput)
104
+ : Async<Result<'okOutput, 'error>> =
117
105
  AsyncResult.map f x
118
106
 
119
- member inline _.MergeSources
120
- (
121
- t1: Async<Result<'leftOk, 'error>>,
122
- t2: Async<Result<'rightOk, 'error>>
123
- ) : Async<Result<'leftOk * 'rightOk, 'error>> =
124
- AsyncResult.zip t1 t2
125
-
126
-
127
107
  /// <summary>
128
108
  /// Method lets us transform data types into our internal representation. This is the identity method to recognize the self type.
129
109
  ///
@@ -132,14 +112,6 @@ module AsyncResultCE =
132
112
  member inline _.Source(result: Async<Result<'ok, 'error>>) : Async<Result<'ok, 'error>> =
133
113
  result
134
114
 
135
- #if !FABLE_COMPILER
136
- /// <summary>
137
- /// Method lets us transform data types into our internal representation.
138
- /// </summary>
139
- member inline _.Source(task: Task<Result<'ok, 'error>>) : Async<Result<'ok, 'error>> =
140
- task
141
- |> Async.AwaitTask
142
- #endif
143
115
 
144
116
  let asyncResult = AsyncResultBuilder()
145
117
 
@@ -177,17 +149,15 @@ module AsyncResultCEExtensions =
177
149
 
178
150
  member inline _.Using
179
151
  (
180
- resource: 'ok :> IDisposable,
152
+ resource: 'ok :> IDisposableNull,
181
153
  [<InlineIfLambda>] binder: 'ok -> Async<Result<'U, 'error>>
182
154
  ) : Async<Result<'U, 'error>> =
183
155
  async.Using(resource, binder)
184
156
 
185
157
 
186
158
  member inline this.For
187
- (
188
- sequence: #seq<'ok>,
189
- [<InlineIfLambda>] binder: 'ok -> Async<Result<unit, 'error>>
190
- ) : Async<Result<unit, 'error>> =
159
+ (sequence: #seq<'ok>, [<InlineIfLambda>] binder: 'ok -> Async<Result<unit, 'error>>)
160
+ : Async<Result<unit, 'error>> =
191
161
  this.Using(
192
162
  sequence.GetEnumerator(),
193
163
  fun enum ->
@@ -215,3 +185,17 @@ module AsyncResultCEExtensions =
215
185
  |> Async.AwaitTask
216
186
  |> Async.map Ok
217
187
  #endif
188
+
189
+ #if !FABLE_COMPILER
190
+ [<AutoOpen>]
191
+ module AsyncResultCEExtensions2 =
192
+
193
+ type AsyncResultBuilder with
194
+
195
+ /// <summary>
196
+ /// Method lets us transform data types into our internal representation.
197
+ /// </summary>
198
+ member inline _.Source(task: Task<Result<'ok, 'error>>) : Async<Result<'ok, 'error>> =
199
+ task
200
+ |> Async.AwaitTask
201
+ #endif
@@ -1,4 +1,5 @@
1
- import { class_type } from "../fable-library-js.4.14.0/Reflection.js";
1
+
2
+ import { class_type } from "../fable-library-js.5.17.2/Reflection.js";
2
3
 
3
4
  export class AsyncResultCE_AsyncResultBuilder {
4
5
  constructor() {
@@ -6,7 +7,7 @@ export class AsyncResultCE_AsyncResultBuilder {
6
7
  }
7
8
 
8
9
  export function AsyncResultCE_AsyncResultBuilder_$reflection() {
9
- return class_type("FsToolkit.ErrorHandling.AsyncResultCE.AsyncResultBuilder", void 0, AsyncResultCE_AsyncResultBuilder);
10
+ return class_type("FsToolkit.ErrorHandling.AsyncResultCE.AsyncResultBuilder", undefined, AsyncResultCE_AsyncResultBuilder);
10
11
  }
11
12
 
12
13
  export function AsyncResultCE_AsyncResultBuilder_$ctor() {
@@ -15,4 +16,3 @@ export function AsyncResultCE_AsyncResultBuilder_$ctor() {
15
16
 
16
17
  export const AsyncResultCE_asyncResult = AsyncResultCE_AsyncResultBuilder_$ctor();
17
18
 
18
- //# sourceMappingURL=AsyncResultCE.fs.js.map
@@ -1,7 +1,7 @@
1
1
  namespace FsToolkit.ErrorHandling
2
2
 
3
3
 
4
- type AsyncResultOption<'ok, 'error> = Async<Result<Option<'ok>, 'error>>
4
+ type AsyncResultOption<'ok, 'error> = Async<Result<'ok option, 'error>>
5
5
 
6
6
  [<RequireQualifiedAccess>]
7
7
  module AsyncResultOption =
@@ -20,10 +20,17 @@ module AsyncResultOption =
20
20
  (fun opt ->
21
21
  match opt with
22
22
  | Some x -> binder x
23
- | None -> AsyncResult.retn None
23
+ | None -> AsyncResult.ok None
24
24
  )
25
25
  input
26
26
 
27
+ let inline ok x =
28
+ Ok(Some x)
29
+ |> Async.singleton
30
+
31
+ let inline error x : Async<Result<'ok option, 'error>> =
32
+ Error x
33
+ |> Async.singleton
27
34
 
28
35
  let inline map2
29
36
  ([<InlineIfLambda>] mapper: 'okInput1 -> 'okInput2 -> 'okOutput)
@@ -40,7 +47,8 @@ module AsyncResultOption =
40
47
  : Async<Result<'okOutput option, 'error>> =
41
48
  AsyncResult.map3 (Option.map3 mapper) input1 input2 input3
42
49
 
43
- let inline retn (value: 'ok) : Async<Result<'ok option, 'error>> = AsyncResult.retn (Some value)
50
+ let inline singleton (value: 'ok) : Async<Result<'ok option, 'error>> =
51
+ AsyncResult.ok (Some value)
44
52
 
45
53
  let apply
46
54
  (applier: Async<Result<('okInput -> 'okOutput) option, 'error>>)
@@ -48,12 +56,16 @@ module AsyncResultOption =
48
56
  : Async<Result<'okOutput option, 'error>> =
49
57
  map2 (fun f x -> f x) applier input
50
58
 
59
+ #if !FABLE_COMPILER_PYTHON
60
+ // https://github.com/fable-compiler/Fable/issues/4125
51
61
  /// Replaces the wrapped value with unit
52
62
  let ignore<'ok, 'error>
53
63
  (value: Async<Result<'ok option, 'error>>)
54
64
  : Async<Result<unit option, 'error>> =
55
65
  value
56
66
  |> map ignore<'ok>
67
+ #endif
68
+
57
69
 
58
70
  let inline ofResult (r: Result<'ok, 'error>) =
59
71
  r
@@ -65,11 +77,11 @@ module AsyncResultOption =
65
77
  r
66
78
  |> AsyncResult.map Some
67
79
 
68
- let inline ofOption (r: Option<'ok>) =
80
+ let inline ofOption (r: 'ok option) =
69
81
  r
70
82
  |> Ok
71
83
  |> Async.singleton
72
84
 
73
- let inline ofAsyncOption (r: Async<Option<'ok>>) =
85
+ let inline ofAsyncOption (r: Async<'ok option>) =
74
86
  r
75
87
  |> Async.map Ok
@@ -0,0 +1,26 @@
1
+
2
+ import { singleton } from "../fable-library-js.5.17.2/AsyncBuilder.js";
3
+ import { FSharpResult$2 } from "../fable-library-js.5.17.2/Result.js";
4
+ import { some, value as value_4 } from "../fable-library-js.5.17.2/Option.js";
5
+
6
+ export function AsyncResultOption_apply(applier, input) {
7
+ return singleton.Bind(applier, (x_3) => singleton.Bind(input, (y_2) => {
8
+ let copyOfStruct, copyOfStruct_1, input1_1, input2_1, x_1, y;
9
+ const value = (copyOfStruct = x_3, (copyOfStruct.tag === 1) ? (new FSharpResult$2(/* Error */ 1, [copyOfStruct.fields[0]])) : ((copyOfStruct_1 = y_2, (copyOfStruct_1.tag === 1) ? (new FSharpResult$2(/* Error */ 1, [copyOfStruct_1.fields[0]])) : (new FSharpResult$2(/* Ok */ 0, [(input1_1 = copyOfStruct.fields[0], (input2_1 = copyOfStruct_1.fields[0], (input1_1 != null) ? ((input2_1 != null) ? ((x_1 = input1_1, (y = value_4(input2_1), some(x_1(y))))) : undefined) : undefined))])))));
10
+ return singleton.Return(value);
11
+ }));
12
+ }
13
+
14
+ /**
15
+ * Replaces the wrapped value with unit
16
+ */
17
+ export function AsyncResultOption_ignore(value) {
18
+ return singleton.Bind(value, (x$0027) => {
19
+ let input_2;
20
+ let value_2;
21
+ const input_4 = x$0027;
22
+ value_2 = ((input_4.tag === 1) ? (new FSharpResult$2(/* Error */ 1, [input_4.fields[0]])) : (new FSharpResult$2(/* Ok */ 0, [(input_2 = input_4.fields[0], (input_2 == null) ? undefined : some(void value_4(input_2)))])));
23
+ return singleton.Return(value_2);
24
+ });
25
+ }
26
+
@@ -8,7 +8,7 @@ module AsyncResultOptionCE =
8
8
 
9
9
  type AsyncResultOptionBuilder() =
10
10
  member inline _.Return(value: 'ok) : AsyncResultOption<'ok, 'error> =
11
- AsyncResultOption.retn value
11
+ AsyncResultOption.singleton value
12
12
 
13
13
  member inline _.ReturnFrom
14
14
  (value: Async<Result<'ok option, 'error>>)
@@ -28,7 +28,7 @@ module AsyncResultOptionCE =
28
28
 
29
29
  member inline _.Delay([<InlineIfLambda>] f: unit -> Async<'a>) : Async<'a> = async.Delay f
30
30
 
31
- member inline _.Zero() = Async.singleton (Ok(option.Zero()))
31
+ member inline _.Zero() = Async.singleton (Ok(Some()))
32
32
 
33
33
  member inline _.TryWith
34
34
  (
@@ -43,10 +43,7 @@ module AsyncResultOptionCE =
43
43
  [<InlineIfLambda>] compensation: unit -> unit
44
44
  ) : AsyncResultOption<'ok, 'error> =
45
45
  async.TryFinally(computation, compensation)
46
-
47
-
48
- #if NETSTANDARD2_1
49
-
46
+ #if !FABLE_COMPILER
50
47
  member inline _.TryFinallyAsync
51
48
  (
52
49
  computation: AsyncResultOption<'ok, 'error>,
@@ -66,10 +63,9 @@ module AsyncResultOptionCE =
66
63
 
67
64
  Async.TryFinallyAsync(computation, compensation)
68
65
 
69
-
70
66
  member inline this.Using
71
67
  (
72
- resource: 'ok :> IAsyncDisposable,
68
+ resource: 'ok :> IAsyncDisposableNull,
73
69
  [<InlineIfLambda>] binder: 'ok -> AsyncResultOption<'okOut, 'error>
74
70
  ) : AsyncResultOption<'okOut, 'error> =
75
71
  this.TryFinallyAsync(
@@ -83,12 +79,9 @@ module AsyncResultOptionCE =
83
79
  )
84
80
  #endif
85
81
 
86
-
87
82
  member inline this.While
88
- (
89
- [<InlineIfLambda>] guard: unit -> bool,
90
- computation: AsyncResultOption<unit, 'error>
91
- ) : AsyncResultOption<unit, 'error> =
83
+ ([<InlineIfLambda>] guard: unit -> bool, computation: AsyncResultOption<unit, 'error>)
84
+ : AsyncResultOption<unit, 'error> =
92
85
  if guard () then
93
86
  let mutable whileAsync = Unchecked.defaultof<_>
94
87
 
@@ -108,19 +101,7 @@ module AsyncResultOptionCE =
108
101
  (result: AsyncResultOption<'ok, 'error>)
109
102
  : AsyncResultOption<'ok, 'error> =
110
103
  result
111
- #if !FABLE_COMPILER
112
104
 
113
- /// <summary>
114
- /// Method lets us transform data types into our internal representation. This is the identity method to recognize the self type.
115
- ///
116
- /// See https://stackoverflow.com/questions/35286541/why-would-you-use-builder-source-in-a-custom-computation-expression-builder
117
- /// </summary>
118
- member inline _.Source
119
- (result: Task<Result<Option<'ok>, 'error>>)
120
- : AsyncResultOption<'ok, 'error> =
121
- result
122
- |> Async.AwaitTask
123
- #endif
124
105
  let asyncResultOption = new AsyncResultOptionBuilder()
125
106
 
126
107
 
@@ -149,7 +130,7 @@ module AsyncResultOptionCEExtensions =
149
130
  /// <summary>
150
131
  /// Method lets us transform data types into our internal representation.
151
132
  /// </summary>
152
- member inline this.Source(optional: Option<'ok>) : AsyncResultOption<'ok, 'error> =
133
+ member inline this.Source(optional: 'ok option) : AsyncResultOption<'ok, 'error> =
153
134
  AsyncResultOption.ofOption optional
154
135
 
155
136
  /// <summary>
@@ -161,17 +142,15 @@ module AsyncResultOptionCEExtensions =
161
142
 
162
143
  member inline _.Using
163
144
  (
164
- resource: 'ok :> IDisposable,
145
+ resource: 'ok :> IDisposableNull,
165
146
  [<InlineIfLambda>] binder: 'ok -> AsyncResultOption<'okOutput, 'error>
166
147
  ) : AsyncResultOption<'okOutput, 'error> =
167
148
  async.Using(resource, binder)
168
149
 
169
150
 
170
151
  member inline this.For
171
- (
172
- sequence: #seq<'ok>,
173
- [<InlineIfLambda>] binder: 'ok -> AsyncResultOption<unit, 'error>
174
- ) : AsyncResultOption<unit, 'error> =
152
+ (sequence: #seq<'ok>, [<InlineIfLambda>] binder: 'ok -> AsyncResultOption<unit, 'error>)
153
+ : AsyncResultOption<unit, 'error> =
175
154
  this.Using(
176
155
  sequence.GetEnumerator(),
177
156
  fun enum ->
@@ -215,7 +194,7 @@ module AsyncResultOptionCEExtensionsHighPriority =
215
194
  /// <summary>
216
195
  /// Method lets us transform data types into our internal representation.
217
196
  /// </summary>
218
- member inline _.Source(result: Async<Option<'ok>>) : AsyncResultOption<'ok, 'error> =
197
+ member inline _.Source(result: Async<'ok option>) : AsyncResultOption<'ok, 'error> =
219
198
  AsyncResultOption.ofAsyncOption result
220
199
 
221
200
 
@@ -231,8 +210,27 @@ module AsyncResultOptionCEExtensionsHighPriority =
231
210
  /// <summary>
232
211
  /// Method lets us transform data types into our internal representation.
233
212
  /// </summary>
234
- member inline _.Source(result: Task<Option<'ok>>) : AsyncResultOption<'ok, 'error> =
213
+ member inline _.Source(result: Task<'ok option>) : AsyncResultOption<'ok, 'error> =
235
214
  result
236
215
  |> Async.AwaitTask
237
216
  |> AsyncResultOption.ofAsyncOption
238
217
  #endif
218
+
219
+ #if !FABLE_COMPILER
220
+ [<AutoOpen>]
221
+ module AsyncResultOptionCEExtensionsHighPriority2 =
222
+
223
+ type AsyncResultOptionBuilder with
224
+
225
+
226
+ /// <summary>
227
+ /// Method lets us transform data types into our internal representation. This is the identity method to recognize the self type.
228
+ ///
229
+ /// See https://stackoverflow.com/questions/35286541/why-would-you-use-builder-source-in-a-custom-computation-expression-builder
230
+ /// </summary>
231
+ member inline _.Source
232
+ (result: Task<Result<'ok option, 'error>>)
233
+ : AsyncResultOption<'ok, 'error> =
234
+ result
235
+ |> Async.AwaitTask
236
+ #endif