@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.
- package/README.md +19 -1
- package/dist/Glutinum.Converter/Abbreviations.js +246 -0
- package/dist/Glutinum.Converter/FsharpAST.js +87 -28
- package/dist/Glutinum.Converter/Generate.js +55 -8
- package/dist/Glutinum.Converter/GlueAST.js +333 -34
- package/dist/Glutinum.Converter/Log.js +7 -8
- package/dist/Glutinum.Converter/Merge.js +683 -31
- package/dist/Glutinum.Converter/Packages.js +308 -0
- package/dist/Glutinum.Converter/Printer.js +323 -186
- package/dist/Glutinum.Converter/Read.js +279 -6
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +13 -7
- package/dist/Glutinum.Converter/Reader/Declaration.js +102 -17
- package/dist/Glutinum.Converter/Reader/Documentation.js +168 -73
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.js +7 -51
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js +64 -15
- package/dist/Glutinum.Converter/Reader/ExportDeclaration.js +165 -0
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +30 -5
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +122 -4
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +83 -7
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js +8 -8
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js +11 -9
- package/dist/Glutinum.Converter/Reader/NamedTupleMember.js +3 -2
- package/dist/Glutinum.Converter/Reader/Node.js +24 -10
- package/dist/Glutinum.Converter/Reader/Parameters.js +110 -7
- package/dist/Glutinum.Converter/Reader/Report.js +31 -12
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js +4 -3
- package/dist/Glutinum.Converter/Reader/TypeNode.js +1524 -253
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +75 -20
- package/dist/Glutinum.Converter/Reader/TypeParameters.js +8 -5
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js +184 -50
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +32 -13
- package/dist/Glutinum.Converter/Reader/Types.js +180 -0
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +99 -43
- package/dist/Glutinum.Converter/Reader/Utils.js +1143 -55
- package/dist/Glutinum.Converter/Reader/VariableStatement.js +59 -14
- package/dist/Glutinum.Converter/Transform.js +8292 -1119
- package/dist/Glutinum.Converter/TypeScript.Extensions.js +3 -3
- package/dist/Glutinum.Converter/TypeScript.js +3 -3
- package/dist/Glutinum.Converter/Utils/Keywords.js +6 -6
- package/dist/Glutinum.Converter/Utils/List.js +3 -3
- package/dist/Glutinum.Converter/Utils/Naming.js +61 -12
- package/dist/Glutinum.Converter/Utils/String.js +7 -3
- package/dist/Program.js +230 -72
- package/dist/fable_modules/Fable.Promise.3.2.1/AsyncIterable.fs +89 -0
- package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/AsyncIterable.fs.js +29 -29
- package/dist/fable_modules/Fable.Promise.3.2.1/Fable.Promise.fableproj +25 -0
- package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/Promise.fs +842 -766
- package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/Promise.fs.js +26 -12
- package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/PromiseImpl.fs +31 -31
- package/dist/fable_modules/{Fable.Promise.3.2.0 → Fable.Promise.3.2.1}/PromiseImpl.fs.js +5 -5
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Array.fs +235 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Array.fs.js +384 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AssemblyInfo.fs +4 -4
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Async.fs +89 -9
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Async.fs.js +13 -12
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOption.fs +50 -4
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionCE.fs +30 -39
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionCE.fs.js +10 -10
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResult.fs +52 -8
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultCE.fs +26 -42
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultCE.fs.js +3 -3
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOption.fs +17 -5
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultOption.fs.js +26 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionCE.fs +31 -33
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionCE.fs.js +3 -3
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidation.fs +1 -6
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationCE.fs +10 -18
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationCE.fs.js +3 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/FsToolkit.ErrorHandling.fableproj +69 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/List.fs +68 -10
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/List.fs.js +47 -41
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Nullness.fs +81 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Option.fs +133 -2
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionCE.fs +139 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionCE.fs.js +48 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/OptionOp.fs +3 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResult.fs +88 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResult.fs.js +30 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResultCE.fs +200 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResultCE.fs.js +18 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidation.fs +34 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidationCE.fs +244 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidationCE.fs.js +18 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Result.fs +87 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Result.fs.js +8 -8
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultCE.fs +8 -23
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultCE.fs.js +5 -5
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOption.fs +1 -1
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOption.fs.js +10 -10
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionCE.fs +7 -18
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionCE.fs.js +3 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Seq.fs +503 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Seq.fs.js +295 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/Validation.fs +0 -5
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationCE.fs +7 -13
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationCE.fs.js +3 -3
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValueOption.fs +1 -4
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOption.fs +102 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOptionCE.fs +587 -0
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValueTaskValueOptionOp.fs +10 -0
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Debug/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +3 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/net9.0/.NETCoreApp,Version=v9.0.AssemblyAttributes.fs +3 -0
- 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
- package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/obj/Release/netstandard2.0/FsToolkit.ErrorHandling.AssemblyInfo.fs +4 -4
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/obj/Release/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +20 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Array.js +192 -86
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Async.js +58 -53
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/AsyncBuilder.js +29 -8
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/BigInt.js +71 -46
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/BitConverter.js +2 -2
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Boolean.js +4 -3
- package/dist/fable_modules/fable-library-js.5.17.2/CHANGELOG.md +348 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Char.js +64 -31
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Choice.js +2 -2
- package/dist/fable_modules/fable-library-js.5.17.2/CollectionUtil.js +182 -0
- package/dist/fable_modules/fable-library-js.5.17.2/ConditionalWeakTable.js +21 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Date.js +197 -112
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/DateOffset.js +46 -62
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/DateOnly.js +6 -6
- package/dist/fable_modules/fable-library-js.5.17.2/DateOnlyTemporal.js +146 -0
- package/dist/fable_modules/fable-library-js.5.17.2/DateTimeFormat.js +523 -0
- package/dist/fable_modules/fable-library-js.5.17.2/DateTimeOffsetTemporal.js +283 -0
- package/dist/fable_modules/fable-library-js.5.17.2/DateTimeTemporal.js +243 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Decimal.js +39 -13
- package/dist/fable_modules/fable-library-js.5.17.2/Directory.js +11 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Double.js +10 -3
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Encoding.js +20 -8
- package/dist/fable_modules/fable-library-js.5.17.2/Environment.js +3 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Event.js +10 -1
- package/dist/fable_modules/fable-library-js.5.17.2/FSharp.Collections.js +45 -0
- package/dist/fable_modules/fable-library-js.5.17.2/FSharp.Core.js +156 -0
- package/dist/fable_modules/fable-library-js.5.17.2/File.js +27 -0
- package/dist/fable_modules/fable-library-js.5.17.2/Global.js +29 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Guid.js +33 -12
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Int32.js +17 -17
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/List.js +170 -106
- package/dist/fable_modules/fable-library-js.5.17.2/Long.js +38 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MailboxProcessor.js +13 -6
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Map.js +65 -61
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MapUtil.js +22 -4
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MutableMap.js +28 -16
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/MutableSet.js +7 -7
- package/dist/fable_modules/fable-library-js.5.17.2/Native.js +14 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Numeric.js +44 -3
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Observable.js +5 -3
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Option.js +11 -20
- package/dist/fable_modules/fable-library-js.5.17.2/Path.js +31 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Random.js +22 -20
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Range.js +12 -12
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Reflection.js +50 -22
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/RegExp.js +68 -30
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Result.js +6 -6
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Seq.js +229 -104
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Seq2.js +1 -1
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Set.js +153 -113
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/String.js +238 -50
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/System.Collections.Generic.js +30 -14
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/System.Text.js +69 -31
- package/dist/fable_modules/fable-library-js.5.17.2/System.js +289 -0
- package/dist/fable_modules/fable-library-js.5.17.2/Task.js +27 -0
- package/dist/fable_modules/fable-library-js.5.17.2/TaskBuilder.js +72 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/TimeOnly.js +6 -6
- package/dist/fable_modules/fable-library-js.5.17.2/TimeOnlyTemporal.js +142 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/TimeSpan.js +18 -15
- package/dist/fable_modules/fable-library-js.5.17.2/TimeSpanTemporal.js +259 -0
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Types.js +14 -24
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Uri.js +44 -21
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Util.js +49 -12
- package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/lib/big.js +14 -11
- package/dist/fable_modules/fable-library-js.5.17.2/package.json +24 -0
- package/dist/fable_modules/fable-library-js.5.17.2/quotation.js +682 -0
- package/package.json +4 -4
- package/src/Glutinum.Converter/js/bootstrap.js +109 -2
- package/src/Glutinum.Converter/js/host.js +144 -0
- package/src/Glutinum.Converter/js/npm.js +137 -0
- package/src/Glutinum.Converter/js/resolve.js +402 -0
- package/dist/Glutinum.Converter/FsharpAST.js.map +0 -1
- package/dist/Glutinum.Converter/Generate.js.map +0 -1
- package/dist/Glutinum.Converter/GlueAST.js.map +0 -1
- package/dist/Glutinum.Converter/Log.js.map +0 -1
- package/dist/Glutinum.Converter/Merge.js.map +0 -1
- package/dist/Glutinum.Converter/Printer.js.map +0 -1
- package/dist/Glutinum.Converter/Read.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Declaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Documentation.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/NamedTupleMember.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Node.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Parameters.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Report.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeAliasDeclaration.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeParameters.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/Utils.js.map +0 -1
- package/dist/Glutinum.Converter/Reader/VariableStatement.js.map +0 -1
- package/dist/Glutinum.Converter/Transform.js.map +0 -1
- package/dist/Glutinum.Converter/TypeScript.Extensions.js.map +0 -1
- package/dist/Glutinum.Converter/TypeScript.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/Keywords.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/List.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/Naming.js.map +0 -1
- package/dist/Glutinum.Converter/Utils/String.js.map +0 -1
- package/dist/Program.js.map +0 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs +0 -57
- package/dist/fable_modules/Fable.Promise.3.2.0/AsyncIterable.fs.js.map +0 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/Fable.Promise.fableproj +0 -20
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js.map +0 -1
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js +0 -26
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/FsToolkit.ErrorHandling.fableproj +0 -51
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs +0 -186
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/OptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs +0 -19
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js +0 -31
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Seq.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs +0 -22
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Shims.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOptionCE.fs +0 -165
- package/dist/fable_modules/fable-library-js.4.14.0/Array.d.ts +0 -123
- package/dist/fable_modules/fable-library-js.4.14.0/Async.d.ts +0 -32
- package/dist/fable_modules/fable-library-js.4.14.0/AsyncBuilder.d.ts +0 -59
- package/dist/fable_modules/fable-library-js.4.14.0/BigInt.d.ts +0 -115
- package/dist/fable_modules/fable-library-js.4.14.0/BitConverter.d.ts +0 -27
- package/dist/fable_modules/fable-library-js.4.14.0/Boolean.d.ts +0 -3
- package/dist/fable_modules/fable-library-js.4.14.0/CHANGELOG.md +0 -37
- package/dist/fable_modules/fable-library-js.4.14.0/Char.d.ts +0 -65
- package/dist/fable_modules/fable-library-js.4.14.0/Choice.d.ts +0 -121
- package/dist/fable_modules/fable-library-js.4.14.0/Date.d.ts +0 -70
- package/dist/fable_modules/fable-library-js.4.14.0/DateOffset.d.ts +0 -63
- package/dist/fable_modules/fable-library-js.4.14.0/DateOnly.d.ts +0 -18
- package/dist/fable_modules/fable-library-js.4.14.0/Decimal.d.ts +0 -45
- package/dist/fable_modules/fable-library-js.4.14.0/Double.d.ts +0 -11
- package/dist/fable_modules/fable-library-js.4.14.0/Encoding.d.ts +0 -12
- package/dist/fable_modules/fable-library-js.4.14.0/Event.d.ts +0 -31
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.d.ts +0 -7
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Collections.js +0 -27
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.CompilerServices.d.ts +0 -12
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.d.ts +0 -17
- package/dist/fable_modules/fable-library-js.4.14.0/FSharp.Core.js +0 -69
- package/dist/fable_modules/fable-library-js.4.14.0/Global.d.ts +0 -24
- package/dist/fable_modules/fable-library-js.4.14.0/Global.js +0 -8
- package/dist/fable_modules/fable-library-js.4.14.0/Guid.d.ts +0 -10
- package/dist/fable_modules/fable-library-js.4.14.0/Int32.d.ts +0 -28
- package/dist/fable_modules/fable-library-js.4.14.0/List.d.ts +0 -143
- package/dist/fable_modules/fable-library-js.4.14.0/Long.d.ts +0 -3
- package/dist/fable_modules/fable-library-js.4.14.0/Long.js +0 -46
- package/dist/fable_modules/fable-library-js.4.14.0/MailboxProcessor.d.ts +0 -25
- package/dist/fable_modules/fable-library-js.4.14.0/Map.d.ts +0 -178
- package/dist/fable_modules/fable-library-js.4.14.0/MapUtil.d.ts +0 -10
- package/dist/fable_modules/fable-library-js.4.14.0/MutableMap.d.ts +0 -52
- package/dist/fable_modules/fable-library-js.4.14.0/MutableSet.d.ts +0 -39
- package/dist/fable_modules/fable-library-js.4.14.0/Native.d.ts +0 -2
- package/dist/fable_modules/fable-library-js.4.14.0/Native.js +0 -8
- package/dist/fable_modules/fable-library-js.4.14.0/Numeric.d.ts +0 -19
- package/dist/fable_modules/fable-library-js.4.14.0/Observable.d.ts +0 -32
- package/dist/fable_modules/fable-library-js.4.14.0/Option.d.ts +0 -28
- package/dist/fable_modules/fable-library-js.4.14.0/Random.d.ts +0 -37
- package/dist/fable_modules/fable-library-js.4.14.0/Range.d.ts +0 -12
- package/dist/fable_modules/fable-library-js.4.14.0/Reflection.d.ts +0 -119
- package/dist/fable_modules/fable-library-js.4.14.0/RegExp.d.ts +0 -10
- package/dist/fable_modules/fable-library-js.4.14.0/Result.d.ts +0 -37
- package/dist/fable_modules/fable-library-js.4.14.0/Seq.d.ts +0 -165
- package/dist/fable_modules/fable-library-js.4.14.0/Seq2.d.ts +0 -18
- package/dist/fable_modules/fable-library-js.4.14.0/Set.d.ts +0 -190
- package/dist/fable_modules/fable-library-js.4.14.0/String.d.ts +0 -50
- package/dist/fable_modules/fable-library-js.4.14.0/System.Collections.Generic.d.ts +0 -79
- package/dist/fable_modules/fable-library-js.4.14.0/System.Text.d.ts +0 -38
- package/dist/fable_modules/fable-library-js.4.14.0/SystemException.d.ts +0 -5
- package/dist/fable_modules/fable-library-js.4.14.0/SystemException.js +0 -5
- package/dist/fable_modules/fable-library-js.4.14.0/TimeOnly.d.ts +0 -15
- package/dist/fable_modules/fable-library-js.4.14.0/TimeSpan.d.ts +0 -34
- package/dist/fable_modules/fable-library-js.4.14.0/Timer.d.ts +0 -19
- package/dist/fable_modules/fable-library-js.4.14.0/Types.d.ts +0 -58
- package/dist/fable_modules/fable-library-js.4.14.0/Unicode.13.0.0.d.ts +0 -2
- package/dist/fable_modules/fable-library-js.4.14.0/Uri.d.ts +0 -29
- package/dist/fable_modules/fable-library-js.4.14.0/Util.d.ts +0 -207
- package/dist/fable_modules/fable-library-js.4.14.0/lib/big.d.ts +0 -5
- package/dist/fable_modules/fable-library-js.4.14.0/package.json +0 -24
- package/dist/fable_modules/project_cracked.json +0 -1
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncOptionOp.fs +0 -0
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOp.fs +0 -0
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncResultOptionOp.fs +0 -0
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/AsyncValidationOp.fs +0 -0
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOp.fs +0 -0
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ResultOptionOp.fs +0 -0
- /package/dist/fable_modules/{FsToolkit.ErrorHandling.4.16.0 → FsToolkit.ErrorHandling.5.2.0}/ValidationOp.fs +0 -0
- /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
- /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
- /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
- /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/FSharp.Core.CompilerServices.js +0 -0
- /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/README.md +0 -0
- /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Timer.js +0 -0
- /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Unicode.13.0.0.js +0 -0
- /package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/big.d.ts +0 -0
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OperationCanceledException, Trampoline } from "./AsyncBuilder.js";
|
|
2
2
|
import { CancellationToken } from "./AsyncBuilder.js";
|
|
3
|
-
import { protectedCont } from "./AsyncBuilder.js";
|
|
4
|
-
import { protectedBind } from "./AsyncBuilder.js";
|
|
5
|
-
import { protectedReturn } from "./AsyncBuilder.js";
|
|
3
|
+
import { protectedCont, protectedBind, protectedReturn } from "./AsyncBuilder.js";
|
|
6
4
|
import { Choice_makeChoice1Of2, Choice_makeChoice2Of2 } from "./Choice.js";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
export class Async {
|
|
10
|
-
}
|
|
5
|
+
import { TimeoutException_$ctor } from "./System.js";
|
|
6
|
+
import { Exception } from "./Util.js";
|
|
11
7
|
function emptyContinuation(_x) {
|
|
12
8
|
// NOP
|
|
13
9
|
}
|
|
14
|
-
// see AsyncBuilder.Delay
|
|
15
|
-
function delay(generator) {
|
|
16
|
-
return protectedCont((ctx) => generator()(ctx));
|
|
17
|
-
}
|
|
18
10
|
// MakeAsync: body:(AsyncActivation<'T> -> AsyncReturn) -> Async<'T>
|
|
19
11
|
export function makeAsync(body) {
|
|
20
12
|
return body;
|
|
@@ -49,36 +41,54 @@ export function isCancellationRequested(token) {
|
|
|
49
41
|
}
|
|
50
42
|
export function throwIfCancellationRequested(token) {
|
|
51
43
|
if (token != null && token.isCancelled) {
|
|
52
|
-
throw new
|
|
44
|
+
throw new Exception("Operation is cancelled");
|
|
53
45
|
}
|
|
54
46
|
}
|
|
55
|
-
function
|
|
47
|
+
export function startChild(computation, ms) {
|
|
48
|
+
return protectedCont((ctx) => {
|
|
49
|
+
// Share the parent's cancellation token so cancelling the parent
|
|
50
|
+
// cancels the child, like .NET Async.StartChild
|
|
51
|
+
const promise = startAsPromise(computation, ctx.cancelToken);
|
|
52
|
+
let promiseToRun = promise;
|
|
53
|
+
if (ms) {
|
|
54
|
+
// Race the computation against a timeout: whichever settles first wins.
|
|
55
|
+
promiseToRun = new Promise((resolve, reject) => {
|
|
56
|
+
const timeoutId = setTimeout(() => reject(TimeoutException_$ctor()), ms);
|
|
57
|
+
promise.then(value => { clearTimeout(timeoutId); resolve(value); }, error => { clearTimeout(timeoutId); reject(error); });
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
// Prevent an unhandled rejection when the child is cancelled or fails
|
|
61
|
+
// while nobody awaits it (in F# an unobserved child's cancellation or
|
|
62
|
+
// failure is simply not propagated). awaitPromise attaches its own
|
|
63
|
+
// handlers to the same promise, so awaiting still observes the result.
|
|
64
|
+
promiseToRun.catch(emptyContinuation);
|
|
65
|
+
// JS Promises are hot, computation has already started
|
|
66
|
+
// but we delay returning the result
|
|
67
|
+
protectedReturn(awaitPromise(promiseToRun))(ctx);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
export function awaitPromise(p) {
|
|
71
|
+
return fromContinuations((conts) => p.then(conts[0]).catch((err) => (err instanceof OperationCanceledException
|
|
72
|
+
? conts[2] : conts[1])(err)));
|
|
73
|
+
}
|
|
74
|
+
export function awaitEvent(event, cancelAction) {
|
|
56
75
|
return protectedCont((ctx) => {
|
|
57
76
|
let tokenId;
|
|
58
|
-
const
|
|
77
|
+
const handler = ((_sender, arg) => {
|
|
59
78
|
ctx.cancelToken.removeListener(tokenId);
|
|
60
|
-
|
|
61
|
-
|
|
79
|
+
event.RemoveHandler(handler);
|
|
80
|
+
ctx.onSuccess(arg);
|
|
81
|
+
});
|
|
62
82
|
tokenId = ctx.cancelToken.addListener(() => {
|
|
63
|
-
|
|
64
|
-
|
|
83
|
+
event.RemoveHandler(handler);
|
|
84
|
+
if (cancelAction != null) {
|
|
85
|
+
cancelAction();
|
|
86
|
+
}
|
|
87
|
+
ctx.onCancel(new OperationCanceledException());
|
|
65
88
|
});
|
|
89
|
+
event.AddHandler(handler);
|
|
66
90
|
});
|
|
67
91
|
}
|
|
68
|
-
export function startChild(computation, ms) {
|
|
69
|
-
if (ms) {
|
|
70
|
-
const computationWithTimeout = protectedBind(parallel2(computation, throwAfter(ms)), xs => protectedReturn(xs[0]));
|
|
71
|
-
return startChild(computationWithTimeout);
|
|
72
|
-
}
|
|
73
|
-
const promise = startAsPromise(computation);
|
|
74
|
-
// JS Promises are hot, computation has already started
|
|
75
|
-
// but we delay returning the result
|
|
76
|
-
return protectedCont((ctx) => protectedReturn(awaitPromise(promise))(ctx));
|
|
77
|
-
}
|
|
78
|
-
export function awaitPromise(p) {
|
|
79
|
-
return fromContinuations((conts) => p.then(conts[0]).catch((err) => (err instanceof OperationCanceledError
|
|
80
|
-
? conts[2] : conts[1])(err)));
|
|
81
|
-
}
|
|
82
92
|
export function cancellationToken() {
|
|
83
93
|
return protectedCont((ctx) => ctx.onSuccess(ctx.cancelToken));
|
|
84
94
|
}
|
|
@@ -101,20 +111,19 @@ export function ignore(computation) {
|
|
|
101
111
|
return protectedBind(computation, (_x) => protectedReturn(void 0));
|
|
102
112
|
}
|
|
103
113
|
export function parallel(computations) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
function parallel2(a, b) {
|
|
107
|
-
return delay(() => awaitPromise(Promise.all([startAsPromise(a), startAsPromise(b)])));
|
|
114
|
+
// Children share the parent's cancellation token, like .NET Async.Parallel
|
|
115
|
+
return protectedCont((ctx) => awaitPromise(Promise.all(Array.from(computations, (w) => startAsPromise(w, ctx.cancelToken))))(ctx));
|
|
108
116
|
}
|
|
109
117
|
export function sequential(computations) {
|
|
110
|
-
function _sequential(computations) {
|
|
118
|
+
function _sequential(computations, cancelToken) {
|
|
111
119
|
let pr = Promise.resolve([]);
|
|
112
120
|
for (const c of computations) {
|
|
113
|
-
pr = pr.then(results => startAsPromise(c).then(r => results.concat([r])));
|
|
121
|
+
pr = pr.then(results => startAsPromise(c, cancelToken).then(r => results.concat([r])));
|
|
114
122
|
}
|
|
115
123
|
return pr;
|
|
116
124
|
}
|
|
117
|
-
|
|
125
|
+
// Children share the parent's cancellation token, like .NET Async.Sequential
|
|
126
|
+
return protectedCont((ctx) => awaitPromise(_sequential(computations, ctx.cancelToken))(ctx));
|
|
118
127
|
}
|
|
119
128
|
export function sleep(millisecondsDueTime) {
|
|
120
129
|
return protectedCont((ctx) => {
|
|
@@ -125,29 +134,26 @@ export function sleep(millisecondsDueTime) {
|
|
|
125
134
|
}, millisecondsDueTime);
|
|
126
135
|
tokenId = ctx.cancelToken.addListener(() => {
|
|
127
136
|
clearTimeout(timeoutId);
|
|
128
|
-
ctx.onCancel(new
|
|
137
|
+
ctx.onCancel(new OperationCanceledException());
|
|
129
138
|
});
|
|
130
139
|
});
|
|
131
140
|
}
|
|
132
|
-
export function runSynchronously() {
|
|
133
|
-
throw new Error("Asynchronous code cannot be run synchronously in JS");
|
|
134
|
-
}
|
|
135
141
|
export function start(computation, cancellationToken) {
|
|
136
|
-
return startWithContinuations(computation, cancellationToken);
|
|
142
|
+
return startWithContinuations(computation, emptyContinuation, function (err) { throw err; }, emptyContinuation, cancellationToken);
|
|
137
143
|
}
|
|
138
144
|
export function startImmediate(computation, cancellationToken) {
|
|
139
145
|
return start(computation, cancellationToken);
|
|
140
146
|
}
|
|
141
147
|
export function startWithContinuations(computation, continuation, exceptionContinuation, cancellationContinuation, cancelToken) {
|
|
142
|
-
if (typeof continuation !== "function") {
|
|
143
|
-
cancelToken = continuation;
|
|
144
|
-
continuation = undefined;
|
|
145
|
-
}
|
|
146
148
|
const trampoline = new Trampoline();
|
|
149
|
+
// Mark the computation completed as soon as a terminal continuation is entered
|
|
150
|
+
// so protectedCont lets exceptions from continuation code propagate instead of
|
|
151
|
+
// routing them to onError (see Trampoline.completed).
|
|
152
|
+
const done = (cont) => (x) => { trampoline.completed = true; return cont(x); };
|
|
147
153
|
computation({
|
|
148
|
-
onSuccess: continuation ? continuation : emptyContinuation,
|
|
149
|
-
onError: exceptionContinuation
|
|
150
|
-
onCancel: cancellationContinuation
|
|
154
|
+
onSuccess: done(continuation ? continuation : emptyContinuation),
|
|
155
|
+
onError: done(exceptionContinuation),
|
|
156
|
+
onCancel: done(cancellationContinuation),
|
|
151
157
|
cancelToken: cancelToken ? cancelToken : defaultCancellationToken,
|
|
152
158
|
trampoline,
|
|
153
159
|
});
|
|
@@ -155,4 +161,3 @@ export function startWithContinuations(computation, continuation, exceptionConti
|
|
|
155
161
|
export function startAsPromise(computation, cancellationToken) {
|
|
156
162
|
return new Promise((resolve, reject) => startWithContinuations(computation, resolve, reject, reject, cancellationToken ? cancellationToken : defaultCancellationToken));
|
|
157
163
|
}
|
|
158
|
-
export default Async;
|
package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/AsyncBuilder.js
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ensureErrorOrException } from
|
|
1
|
+
import { Exception, ensureErrorOrException } from "./Util.js";
|
|
2
2
|
export class CancellationToken {
|
|
3
3
|
constructor(cancelled = false) {
|
|
4
4
|
this._id = 0;
|
|
@@ -35,10 +35,10 @@ export class CancellationToken {
|
|
|
35
35
|
// https://docs.microsoft.com/en-us/dotnet/api/system.threading.cancellationtokensource.dispose?view=net-6.0
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
export class
|
|
39
|
-
constructor() {
|
|
40
|
-
super("The operation was canceled");
|
|
41
|
-
Object.setPrototypeOf(this,
|
|
38
|
+
export class OperationCanceledException extends Exception {
|
|
39
|
+
constructor(msg) {
|
|
40
|
+
super(msg ?? "The operation was canceled");
|
|
41
|
+
// Object.setPrototypeOf(this, OperationCanceledException.prototype);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
export class Trampoline {
|
|
@@ -47,6 +47,7 @@ export class Trampoline {
|
|
|
47
47
|
}
|
|
48
48
|
constructor() {
|
|
49
49
|
this.callCount = 0;
|
|
50
|
+
this.completed = false;
|
|
50
51
|
}
|
|
51
52
|
incrementAndCheck() {
|
|
52
53
|
return this.callCount++ > Trampoline.maxTrampolineCallCount;
|
|
@@ -59,7 +60,7 @@ export class Trampoline {
|
|
|
59
60
|
export function protectedCont(f) {
|
|
60
61
|
return (ctx) => {
|
|
61
62
|
if (ctx.cancelToken.isCancelled) {
|
|
62
|
-
ctx.onCancel(new
|
|
63
|
+
ctx.onCancel(new OperationCanceledException());
|
|
63
64
|
}
|
|
64
65
|
else if (ctx.trampoline.incrementAndCheck()) {
|
|
65
66
|
ctx.trampoline.hijack(() => {
|
|
@@ -67,6 +68,9 @@ export function protectedCont(f) {
|
|
|
67
68
|
f(ctx);
|
|
68
69
|
}
|
|
69
70
|
catch (err) {
|
|
71
|
+
if (ctx.trampoline.completed) {
|
|
72
|
+
throw err;
|
|
73
|
+
}
|
|
70
74
|
ctx.onError(ensureErrorOrException(err));
|
|
71
75
|
}
|
|
72
76
|
});
|
|
@@ -76,6 +80,13 @@ export function protectedCont(f) {
|
|
|
76
80
|
f(ctx);
|
|
77
81
|
}
|
|
78
82
|
catch (err) {
|
|
83
|
+
// Once a terminal continuation has run the computation is complete, so
|
|
84
|
+
// an exception from user continuation code must propagate rather than be
|
|
85
|
+
// routed to onError (which would resolve the computation a second time,
|
|
86
|
+
// e.g. a succeeded try/with body re-entering its with handler).
|
|
87
|
+
if (ctx.trampoline.completed) {
|
|
88
|
+
throw err;
|
|
89
|
+
}
|
|
79
90
|
ctx.onError(ensureErrorOrException(err));
|
|
80
91
|
}
|
|
81
92
|
}
|
|
@@ -85,12 +96,18 @@ export function protectedBind(computation, binder) {
|
|
|
85
96
|
return protectedCont((ctx) => {
|
|
86
97
|
computation({
|
|
87
98
|
onSuccess: (x) => {
|
|
99
|
+
// Only guard the binder evaluation itself: the resulting computation
|
|
100
|
+
// is protected on its own, and re-catching what it throws would
|
|
101
|
+
// route continuation exceptions back into onError (double-resolve).
|
|
102
|
+
let bound;
|
|
88
103
|
try {
|
|
89
|
-
binder(x)
|
|
104
|
+
bound = binder(x);
|
|
90
105
|
}
|
|
91
106
|
catch (err) {
|
|
92
107
|
ctx.onError(ensureErrorOrException(err));
|
|
108
|
+
return;
|
|
93
109
|
}
|
|
110
|
+
bound(ctx);
|
|
94
111
|
},
|
|
95
112
|
onError: ctx.onError,
|
|
96
113
|
onCancel: ctx.onCancel,
|
|
@@ -155,12 +172,16 @@ export class AsyncBuilder {
|
|
|
155
172
|
cancelToken: ctx.cancelToken,
|
|
156
173
|
trampoline: ctx.trampoline,
|
|
157
174
|
onError: (ex) => {
|
|
175
|
+
// See protectedBind: only guard the handler evaluation itself.
|
|
176
|
+
let handled;
|
|
158
177
|
try {
|
|
159
|
-
catchHandler(ex)
|
|
178
|
+
handled = catchHandler(ex);
|
|
160
179
|
}
|
|
161
180
|
catch (err) {
|
|
162
181
|
ctx.onError(ensureErrorOrException(err));
|
|
182
|
+
return;
|
|
163
183
|
}
|
|
184
|
+
handled(ctx);
|
|
164
185
|
},
|
|
165
186
|
});
|
|
166
187
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fromParts, truncate } from "./Decimal.js";
|
|
2
|
-
import { bigintHash } from "./Util.js";
|
|
2
|
+
import { Exception, bigintHash } from "./Util.js";
|
|
3
3
|
const isBigEndian = false;
|
|
4
4
|
BigInt.prototype.toJSON = function () {
|
|
5
5
|
return `${this.toString()}`;
|
|
@@ -95,26 +95,53 @@ export function fromByteArray(bytes) {
|
|
|
95
95
|
export function toByteArray(value) {
|
|
96
96
|
return toSignedBytes(value, isBigEndian);
|
|
97
97
|
}
|
|
98
|
-
export function
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
export function
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
export function
|
|
98
|
+
export function toIntN_unchecked(bits, x, signed) {
|
|
99
|
+
return signed ? BigInt.asIntN(bits, x) : BigInt.asUintN(bits, x);
|
|
100
|
+
}
|
|
101
|
+
export function toIntN(bits, x, signed) {
|
|
102
|
+
const truncated = signed ? BigInt.asIntN(bits, x) : BigInt.asUintN(bits, x);
|
|
103
|
+
if (truncated !== x) {
|
|
104
|
+
const s = signed ? "a signed" : "an unsigned";
|
|
105
|
+
throw new Exception(`Value was either too large or too small for ${s} ${bits}-bit integer.`);
|
|
106
|
+
}
|
|
107
|
+
return truncated;
|
|
108
|
+
}
|
|
109
|
+
export function toInt8(x) { return Number(toIntN(8, x, true)); }
|
|
110
|
+
export function toUInt8(x) { return Number(toIntN(8, x, false)); }
|
|
111
|
+
export function toInt16(x) { return Number(toIntN(16, x, true)); }
|
|
112
|
+
export function toUInt16(x) { return Number(toIntN(16, x, false)); }
|
|
113
|
+
export function toInt32(x) { return Number(toIntN(32, x, true)); }
|
|
114
|
+
export function toUInt32(x) { return Number(toIntN(32, x, false)); }
|
|
115
|
+
export function toInt64(x) { return toIntN(64, x, true); }
|
|
116
|
+
export function toUInt64(x) { return toIntN(64, x, false); }
|
|
117
|
+
export function toInt128(x) { return toIntN(128, x, true); }
|
|
118
|
+
export function toUInt128(x) { return toIntN(128, x, false); }
|
|
119
|
+
export function toNativeInt(x) { return toIntN(64, x, true); }
|
|
120
|
+
export function toUNativeInt(x) { return toIntN(64, x, false); }
|
|
121
|
+
export function toInt8_unchecked(x) { return Number(toIntN_unchecked(8, x, true)); }
|
|
122
|
+
export function toUInt8_unchecked(x) { return Number(toIntN_unchecked(8, x, false)); }
|
|
123
|
+
export function toInt16_unchecked(x) { return Number(toIntN_unchecked(16, x, true)); }
|
|
124
|
+
export function toUInt16_unchecked(x) { return Number(toIntN_unchecked(16, x, false)); }
|
|
125
|
+
export function toInt32_unchecked(x) { return Number(toIntN_unchecked(32, x, true)); }
|
|
126
|
+
export function toUInt32_unchecked(x) { return Number(toIntN_unchecked(32, x, false)); }
|
|
127
|
+
export function toInt64_unchecked(x) { return toIntN_unchecked(64, x, true); }
|
|
128
|
+
export function toUInt64_unchecked(x) { return toIntN_unchecked(64, x, false); }
|
|
129
|
+
export function toInt128_unchecked(x) { return toIntN_unchecked(128, x, true); }
|
|
130
|
+
export function toUInt128_unchecked(x) { return toIntN_unchecked(128, x, false); }
|
|
131
|
+
export function toNativeInt_unchecked(x) { return toIntN_unchecked(64, x, true); }
|
|
132
|
+
export function toUNativeInt_unchecked(x) { return toIntN_unchecked(64, x, false); }
|
|
110
133
|
export function toFloat16(x) { return Number(x); }
|
|
111
134
|
export function toFloat32(x) { return Number(x); }
|
|
112
135
|
export function toFloat64(x) { return Number(x); }
|
|
113
136
|
export function toDecimal(x) {
|
|
114
|
-
const low = Number(BigInt.asUintN(32, x));
|
|
115
|
-
const mid = Number(BigInt.asUintN(32, x >> 32n));
|
|
116
|
-
const high = Number(BigInt.asUintN(32, x >> 64n));
|
|
117
137
|
const isNegative = x < zero;
|
|
138
|
+
const bits = abs(x);
|
|
139
|
+
if ((bits >> 96n) !== zero) {
|
|
140
|
+
throw new Exception("Value was either too large or too small for a Decimal.");
|
|
141
|
+
}
|
|
142
|
+
const low = Number(BigInt.asUintN(32, bits));
|
|
143
|
+
const mid = Number(BigInt.asUintN(32, bits >> 32n));
|
|
144
|
+
const high = Number(BigInt.asUintN(32, bits >> 64n));
|
|
118
145
|
const scale = 0;
|
|
119
146
|
return fromParts(low, mid, high, isNegative, scale);
|
|
120
147
|
}
|
|
@@ -154,6 +181,8 @@ export function divRem(x, y, out) {
|
|
|
154
181
|
}
|
|
155
182
|
}
|
|
156
183
|
export function greatestCommonDivisor(x, y) {
|
|
184
|
+
x = abs(x);
|
|
185
|
+
y = abs(y);
|
|
157
186
|
while (y > zero) {
|
|
158
187
|
const q = x / y;
|
|
159
188
|
const r = x - q * y;
|
|
@@ -162,8 +191,16 @@ export function greatestCommonDivisor(x, y) {
|
|
|
162
191
|
}
|
|
163
192
|
return x;
|
|
164
193
|
}
|
|
194
|
+
// Number of bits in the binary representation of x (x must be positive)
|
|
195
|
+
function bitLength(x) {
|
|
196
|
+
const hex = x.toString(16);
|
|
197
|
+
return (hex.length - 1) * 4 + (32 - Math.clz32(fromHexCode(hex.charCodeAt(0))));
|
|
198
|
+
}
|
|
165
199
|
export function getBitLength(x) {
|
|
166
|
-
|
|
200
|
+
if (x < zero) {
|
|
201
|
+
x = -x - one; // two's complement bit length excluding the sign bit
|
|
202
|
+
}
|
|
203
|
+
return x === zero ? zero : BigInt(bitLength(x));
|
|
167
204
|
}
|
|
168
205
|
export function log2(x) {
|
|
169
206
|
const n = Number(x);
|
|
@@ -195,7 +232,10 @@ export function log(x, base) {
|
|
|
195
232
|
return log2(x) / Math.log2(base);
|
|
196
233
|
}
|
|
197
234
|
export function ilog2(x) {
|
|
198
|
-
|
|
235
|
+
if (x < zero) {
|
|
236
|
+
throw new Exception("Value must be non-negative.");
|
|
237
|
+
}
|
|
238
|
+
return x === zero ? zero : BigInt(bitLength(x) - 1);
|
|
199
239
|
}
|
|
200
240
|
// export function copySign
|
|
201
241
|
// export function createChecked
|
|
@@ -224,39 +264,24 @@ function fromHexCode(code) {
|
|
|
224
264
|
}
|
|
225
265
|
function toSignedBytes(x, isBigEndian) {
|
|
226
266
|
const isNeg = x < 0n;
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
x = x
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
const first = hex.charCodeAt(0);
|
|
237
|
-
const isLow = 48 <= first && first <= 55; // 0..7
|
|
238
|
-
const start = (isNeg && isLow) || (!isNeg && !isLow) ? 1 : 0;
|
|
239
|
-
const bytes = new Uint8Array(start + (len + odd) / 2);
|
|
240
|
-
const inc = isBigEndian ? 1 : -1;
|
|
241
|
-
let pos = isBigEndian ? 0 : bytes.length - 1;
|
|
242
|
-
if (start > 0) {
|
|
243
|
-
bytes[pos] = isNeg ? 255 : 0;
|
|
244
|
-
pos += inc;
|
|
245
|
-
}
|
|
246
|
-
if (odd > 0) {
|
|
247
|
-
bytes[pos] = fromHexCode(first);
|
|
248
|
-
pos += inc;
|
|
267
|
+
const sentinel = isNeg ? -1n : 0n;
|
|
268
|
+
const bytes = []; // little-endian
|
|
269
|
+
do {
|
|
270
|
+
bytes.push(Number(BigInt.asUintN(8, x)));
|
|
271
|
+
x = x >> 8n;
|
|
272
|
+
} while (x !== sentinel);
|
|
273
|
+
// extra byte if the top byte's sign bit would misrepresent the sign
|
|
274
|
+
if (isNeg !== (bytes[bytes.length - 1] > 127)) {
|
|
275
|
+
bytes.push(isNeg ? 255 : 0);
|
|
249
276
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
const b = fromHexCode(hex.charCodeAt(i + 1));
|
|
253
|
-
bytes[pos] = (a << 4) | b;
|
|
277
|
+
if (isBigEndian) {
|
|
278
|
+
bytes.reverse();
|
|
254
279
|
}
|
|
255
|
-
return bytes;
|
|
280
|
+
return new Uint8Array(bytes);
|
|
256
281
|
}
|
|
257
282
|
function fromSignedBytes(bytes, isBigEndian) {
|
|
258
283
|
if (bytes == null) {
|
|
259
|
-
throw new
|
|
284
|
+
throw new Exception("bytes is null");
|
|
260
285
|
}
|
|
261
286
|
const len = bytes.length;
|
|
262
287
|
const first = isBigEndian ? 0 : len - 1;
|
package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/BitConverter.js
RENAMED
|
@@ -77,7 +77,7 @@ export function doubleToInt64Bits(value) {
|
|
|
77
77
|
export function toBoolean(bytes, offset) {
|
|
78
78
|
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
|
|
79
79
|
const view = new DataView(array.buffer, array.byteOffset, array.byteLength);
|
|
80
|
-
return view.getUint8(offset)
|
|
80
|
+
return view.getUint8(offset) !== 0;
|
|
81
81
|
}
|
|
82
82
|
export function toChar(bytes, offset) {
|
|
83
83
|
const array = ArrayBuffer.isView(bytes) ? bytes : Uint8Array.from(bytes);
|
|
@@ -134,5 +134,5 @@ export function toString(bytes, offset, count) {
|
|
|
134
134
|
else if (offset != null) {
|
|
135
135
|
buffer = buffer.subarray(offset);
|
|
136
136
|
}
|
|
137
|
-
return Array.from(buffer).map((b) => ("0" + b.toString(16)).slice(-2)).join("-");
|
|
137
|
+
return Array.from(buffer).map((b) => ("0" + b.toString(16)).slice(-2).toUpperCase()).join("-");
|
|
138
138
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { FSharpRef } from "./Types.js";
|
|
2
|
+
import { Exception } from "./Util.js";
|
|
2
3
|
export function tryParse(str, defValue) {
|
|
3
|
-
if (str.match(/^\s*true\s*$/i)) {
|
|
4
|
+
if (str != null && str.match(/^\s*true\s*$/i)) {
|
|
4
5
|
defValue.contents = true;
|
|
5
6
|
return true;
|
|
6
7
|
}
|
|
7
|
-
else if (str.match(/^\s*false\s*$/i)) {
|
|
8
|
+
else if (str != null && str.match(/^\s*false\s*$/i)) {
|
|
8
9
|
defValue.contents = false;
|
|
9
10
|
return true;
|
|
10
11
|
}
|
|
@@ -16,6 +17,6 @@ export function parse(str) {
|
|
|
16
17
|
return defValue.contents;
|
|
17
18
|
}
|
|
18
19
|
else {
|
|
19
|
-
throw new
|
|
20
|
+
throw new Exception(`String '${str}' was not recognized as a valid Boolean.`);
|
|
20
21
|
}
|
|
21
22
|
}
|