@glutinum/cli 0.12.0 → 0.14.0
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 +35 -3
- package/dist/Glutinum.Converter/Abbreviations.js +246 -0
- package/dist/Glutinum.Converter/FsharpAST.js +98 -34
- package/dist/Glutinum.Converter/Generate.js +55 -8
- package/dist/Glutinum.Converter/GlueAST.js +446 -30
- 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 +332 -170
- 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 -8
- 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 +1527 -248
- 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 +8710 -1137
- 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 +76 -14
- package/dist/Glutinum.Converter/Utils/String.js +7 -3
- package/dist/Program.js +230 -72
- 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 +0 -105
- 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 +0 -766
- package/dist/fable_modules/Fable.Promise.3.2.0/Promise.fs.js +0 -218
- 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 +0 -31
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js +0 -20
- package/dist/fable_modules/Fable.Promise.3.2.0/PromiseImpl.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AssemblyInfo.fs +0 -19
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs +0 -207
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js +0 -127
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Async.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOption.fs +0 -81
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs +0 -183
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js +0 -37
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncOptionOp.fs +0 -24
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResult.fs +0 -439
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs +0 -217
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOp.fs +0 -24
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOption.fs +0 -75
- 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 +0 -238
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncResultOptionOp.fs +0 -24
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidation.fs +0 -190
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs +0 -194
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/AsyncValidationOp.fs +0 -35
- 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 +0 -218
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js +0 -358
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/List.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Option.fs +0 -331
- 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/OptionOp.fs +0 -21
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs +0 -644
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/Result.fs.js +0 -45
- 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 +0 -155
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js +0 -23
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOp.fs +0 -45
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs +0 -201
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOption.fs.js +0 -65
- 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 +0 -146
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ResultOptionOp.fs +0 -57
- 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/Validation.fs +0 -172
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs +0 -148
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js +0 -18
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationCE.fs.js.map +0 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValidationOp.fs +0 -35
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOption.fs +0 -151
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/ValueOptionCE.fs +0 -165
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Debug/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.0/.NETStandard,Version=v2.0.AssemblyAttributes.fs +0 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.0/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.fs +0 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.4.16.0/obj/Release/netstandard2.1/FsToolkit.ErrorHandling.AssemblyInfo.fs +0 -20
- 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/Array.js +0 -1242
- 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/Async.js +0 -158
- 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/AsyncBuilder.js +0 -183
- 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/BigInt.js +0 -282
- 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/BitConverter.js +0 -138
- 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/Boolean.js +0 -21
- 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/Char.js +0 -169
- 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/Choice.js +0 -184
- 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/Date.js +0 -749
- 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/DateOffset.js +0 -268
- 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/DateOnly.js +0 -124
- 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/Decimal.js +0 -212
- 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/Double.js +0 -46
- 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/Encoding.js +0 -173
- 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/Event.js +0 -93
- 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.CompilerServices.js +0 -27
- 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/Guid.js +0 -142
- 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/Int32.js +0 -135
- 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/List.js +0 -1273
- 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/MailboxProcessor.js +0 -93
- 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/Map.js +0 -1396
- 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/MapUtil.js +0 -112
- 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/MutableMap.js +0 -327
- 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/MutableSet.js +0 -233
- 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/Numeric.js +0 -71
- 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/Observable.js +0 -113
- 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/Option.js +0 -96
- package/dist/fable_modules/fable-library-js.4.14.0/README.md +0 -3
- 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/Random.js +0 -170
- 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/Range.js +0 -45
- 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/Reflection.js +0 -461
- 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/RegExp.js +0 -132
- 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/Result.js +0 -165
- 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/Seq.js +0 -1379
- 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/Seq2.js +0 -111
- 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/Set.js +0 -1789
- 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/String.js +0 -543
- 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.Collections.Generic.js +0 -317
- 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/System.Text.js +0 -162
- 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/TimeOnly.js +0 -122
- 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/TimeSpan.js +0 -177
- 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/Timer.js +0 -67
- 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/Types.js +0 -208
- 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/Unicode.13.0.0.js +0 -4
- 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/Uri.js +0 -142
- 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/Util.js +0 -770
- package/dist/fable_modules/fable-library-js.4.14.0/big.d.ts +0 -338
- 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/lib/big.js +0 -826
- package/dist/fable_modules/fable-library-js.4.14.0/package.json +0 -24
- package/dist/fable_modules/project_cracked.json +0 -1
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { FSharpResult$2 } from "../fable-library-js.4.14.0/Result.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Takes two results and returns a tuple of the pair
|
|
5
|
-
*
|
|
6
|
-
* Documentation is found here: <href>https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/result/zip</href>
|
|
7
|
-
*/
|
|
8
|
-
export function zip(left, right) {
|
|
9
|
-
const copyOfStruct = left;
|
|
10
|
-
if (copyOfStruct.tag === 1) {
|
|
11
|
-
return new FSharpResult$2(1, [copyOfStruct.fields[0]]);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
const copyOfStruct_1 = right;
|
|
15
|
-
if (copyOfStruct_1.tag === 1) {
|
|
16
|
-
return new FSharpResult$2(1, [copyOfStruct_1.fields[0]]);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
return new FSharpResult$2(0, [[copyOfStruct.fields[0], copyOfStruct_1.fields[0]]]);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Takes two results and returns a tuple of the error pair
|
|
26
|
-
*
|
|
27
|
-
* Documentation is found here: <href>https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/result/ziperror</href>
|
|
28
|
-
*/
|
|
29
|
-
export function zipError(left, right) {
|
|
30
|
-
const copyOfStruct = left;
|
|
31
|
-
if (copyOfStruct.tag === 0) {
|
|
32
|
-
return new FSharpResult$2(0, [copyOfStruct.fields[0]]);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
const copyOfStruct_1 = right;
|
|
36
|
-
if (copyOfStruct_1.tag === 0) {
|
|
37
|
-
return new FSharpResult$2(0, [copyOfStruct_1.fields[0]]);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
return new FSharpResult$2(1, [[copyOfStruct.fields[0], copyOfStruct_1.fields[0]]]);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
//# sourceMappingURL=Result.fs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["./Result.fs"],"names":["copyOfStruct","left","right"],"mappings":";;;;;;;;AA\u002BmBcA,yBAAAC;AAAA,QAAA,AAAAD;AAEU,eAAA,uBAFV,AAAAA;;;AAAAA,\u002BBAAME;AAAN,YAAA,AAAAF;AAGU,mBAAA,uBAHV,AAAAA;;;AACkB,mBAAA,wBADlB,AAAAA,wBAAA,AAAAA;;;;;;;;;;;AAiBAA,yBAAAC;AAAA,QAAA,AAAAD;AAEO,eAAA,uBAFP,AAAAA;;;AAAAA,\u002BBAAME;AAAN,YAAA,AAAAF;AAGO,mBAAA,uBAHP,AAAAA;;;AACwB,mBAAA,wBADxB,AAAAA,wBAAA,AAAAA","file":null,"sourcesContent":null,"sourceRoot":null}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
namespace FsToolkit.ErrorHandling
|
|
2
|
-
|
|
3
|
-
open System
|
|
4
|
-
|
|
5
|
-
[<AutoOpen>]
|
|
6
|
-
module ResultCE =
|
|
7
|
-
|
|
8
|
-
type ResultBuilder() =
|
|
9
|
-
member inline _.Return(value: 'ok) : Result<'ok, 'error> = Ok value
|
|
10
|
-
|
|
11
|
-
member inline _.ReturnFrom(result: Result<'ok, 'error>) : Result<'ok, 'error> = result
|
|
12
|
-
|
|
13
|
-
member this.Zero() : Result<unit, 'error> = this.Return()
|
|
14
|
-
|
|
15
|
-
member inline _.Bind
|
|
16
|
-
(
|
|
17
|
-
input: Result<'okInput, 'error>,
|
|
18
|
-
[<InlineIfLambda>] binder: 'okInput -> Result<'okOutput, 'error>
|
|
19
|
-
) : Result<'okOutput, 'error> =
|
|
20
|
-
Result.bind binder input
|
|
21
|
-
|
|
22
|
-
member inline _.Delay
|
|
23
|
-
([<InlineIfLambda>] generator: unit -> Result<'ok, 'error>)
|
|
24
|
-
: unit -> Result<'ok, 'error> =
|
|
25
|
-
generator
|
|
26
|
-
|
|
27
|
-
member inline _.Run
|
|
28
|
-
([<InlineIfLambda>] generator: unit -> Result<'ok, 'error>)
|
|
29
|
-
: Result<'ok, 'error> =
|
|
30
|
-
generator ()
|
|
31
|
-
|
|
32
|
-
member inline this.Combine
|
|
33
|
-
(
|
|
34
|
-
result: Result<unit, 'error>,
|
|
35
|
-
[<InlineIfLambda>] binder: unit -> Result<'ok, 'error>
|
|
36
|
-
) : Result<'ok, 'error> =
|
|
37
|
-
this.Bind(result, binder)
|
|
38
|
-
|
|
39
|
-
member inline this.TryWith
|
|
40
|
-
(
|
|
41
|
-
[<InlineIfLambda>] generator: unit -> Result<'T, 'TError>,
|
|
42
|
-
[<InlineIfLambda>] handler: exn -> Result<'T, 'TError>
|
|
43
|
-
) : Result<'T, 'TError> =
|
|
44
|
-
try
|
|
45
|
-
this.Run generator
|
|
46
|
-
with e ->
|
|
47
|
-
handler e
|
|
48
|
-
|
|
49
|
-
member inline this.TryFinally
|
|
50
|
-
(
|
|
51
|
-
[<InlineIfLambda>] generator: unit -> Result<'ok, 'error>,
|
|
52
|
-
[<InlineIfLambda>] compensation: unit -> unit
|
|
53
|
-
) : Result<'ok, 'error> =
|
|
54
|
-
try
|
|
55
|
-
this.Run generator
|
|
56
|
-
finally
|
|
57
|
-
compensation ()
|
|
58
|
-
|
|
59
|
-
member inline this.Using
|
|
60
|
-
(
|
|
61
|
-
resource: 'disposable :> IDisposable,
|
|
62
|
-
binder: 'disposable -> Result<'ok, 'error>
|
|
63
|
-
) : Result<'ok, 'error> =
|
|
64
|
-
this.TryFinally(
|
|
65
|
-
(fun () -> binder resource),
|
|
66
|
-
(fun () ->
|
|
67
|
-
if not (obj.ReferenceEquals(resource, null)) then
|
|
68
|
-
resource.Dispose()
|
|
69
|
-
)
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
member inline this.While
|
|
73
|
-
(
|
|
74
|
-
[<InlineIfLambda>] guard: unit -> bool,
|
|
75
|
-
[<InlineIfLambda>] generator: unit -> Result<unit, 'error>
|
|
76
|
-
) : Result<unit, 'error> =
|
|
77
|
-
|
|
78
|
-
let mutable doContinue = true
|
|
79
|
-
let mutable result = Ok()
|
|
80
|
-
|
|
81
|
-
while doContinue
|
|
82
|
-
&& guard () do
|
|
83
|
-
match generator () with
|
|
84
|
-
| Ok() -> ()
|
|
85
|
-
| Error e ->
|
|
86
|
-
doContinue <- false
|
|
87
|
-
result <- Error e
|
|
88
|
-
|
|
89
|
-
result
|
|
90
|
-
|
|
91
|
-
member inline this.For
|
|
92
|
-
(
|
|
93
|
-
sequence: #seq<'T>,
|
|
94
|
-
[<InlineIfLambda>] binder: 'T -> Result<unit, 'TError>
|
|
95
|
-
) : Result<unit, 'TError> =
|
|
96
|
-
this.Using(
|
|
97
|
-
sequence.GetEnumerator(),
|
|
98
|
-
fun enum ->
|
|
99
|
-
this.While(
|
|
100
|
-
(fun () -> enum.MoveNext()),
|
|
101
|
-
this.Delay(fun () -> binder enum.Current)
|
|
102
|
-
)
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
member inline _.BindReturn
|
|
106
|
-
(
|
|
107
|
-
x: Result<'okInput, 'error>,
|
|
108
|
-
[<InlineIfLambda>] f: 'okInput -> 'okOutput
|
|
109
|
-
) : Result<'okOutput, 'error> =
|
|
110
|
-
Result.map f x
|
|
111
|
-
|
|
112
|
-
member inline _.MergeSources
|
|
113
|
-
(
|
|
114
|
-
left: Result<'left, 'error>,
|
|
115
|
-
right: Result<'right, 'error>
|
|
116
|
-
) : Result<'left * 'right, 'error> =
|
|
117
|
-
Result.zip left right
|
|
118
|
-
|
|
119
|
-
/// <summary>
|
|
120
|
-
/// Method lets us transform data types into our internal representation. This is the identity method to recognize the self type.
|
|
121
|
-
///
|
|
122
|
-
/// See https://stackoverflow.com/questions/35286541/why-would-you-use-builder-source-in-a-custom-computation-expression-builder
|
|
123
|
-
/// </summary>
|
|
124
|
-
/// <param name="result"></param>
|
|
125
|
-
/// <returns></returns>
|
|
126
|
-
member inline _.Source(result: Result<'ok, 'error>) : Result<'ok, 'error> = result
|
|
127
|
-
|
|
128
|
-
/// <summary>
|
|
129
|
-
/// The <c>Result</c> computation expression.
|
|
130
|
-
/// </summary>
|
|
131
|
-
let result = ResultBuilder()
|
|
132
|
-
|
|
133
|
-
[<AutoOpen>]
|
|
134
|
-
module ResultCEExtensions =
|
|
135
|
-
|
|
136
|
-
type ResultBuilder with
|
|
137
|
-
|
|
138
|
-
/// <summary>
|
|
139
|
-
/// Needed to allow `for..in` and `for..do` functionality
|
|
140
|
-
/// </summary>
|
|
141
|
-
member inline _.Source(s: #seq<_>) : #seq<_> = s
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
// Having Choice<_> members as extensions gives them lower priority in
|
|
145
|
-
// overload resolution and allows skipping more type annotations.
|
|
146
|
-
[<AutoOpen>]
|
|
147
|
-
module ResultCEChoiceExtensions =
|
|
148
|
-
type ResultBuilder with
|
|
149
|
-
|
|
150
|
-
/// <summary>
|
|
151
|
-
/// Method lets us transform data types into our internal representation.
|
|
152
|
-
/// </summary>
|
|
153
|
-
/// <returns></returns>
|
|
154
|
-
member inline _.Source(choice: Choice<'ok, 'error>) : Result<'ok, 'error> =
|
|
155
|
-
Result.ofChoice choice
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { class_type } from "../fable-library-js.4.14.0/Reflection.js";
|
|
2
|
-
import { FSharpResult$2 } from "../fable-library-js.4.14.0/Result.js";
|
|
3
|
-
|
|
4
|
-
export class ResultCE_ResultBuilder {
|
|
5
|
-
constructor() {
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function ResultCE_ResultBuilder_$reflection() {
|
|
10
|
-
return class_type("FsToolkit.ErrorHandling.ResultCE.ResultBuilder", void 0, ResultCE_ResultBuilder);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function ResultCE_ResultBuilder_$ctor() {
|
|
14
|
-
return new ResultCE_ResultBuilder();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function ResultCE_ResultBuilder__Zero(this$) {
|
|
18
|
-
return new FSharpResult$2(0, [void 0]);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const ResultCE_result = ResultCE_ResultBuilder_$ctor();
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=ResultCE.fs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["./ResultCE.fs"],"names":["\u0060\u0060.ctor\u0060\u0060"],"mappings":";;;;;;;;;;;;;;;;;WAQmE,uBAIJ;;;\u002BBAsH9C,AAAAA","file":null,"sourcesContent":null,"sourceRoot":null}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
namespace FsToolkit.ErrorHandling.Operator.Result
|
|
2
|
-
|
|
3
|
-
open FsToolkit.ErrorHandling
|
|
4
|
-
|
|
5
|
-
/// <summary>
|
|
6
|
-
/// Operators for working with the <c>Result</c> type.
|
|
7
|
-
/// </summary>
|
|
8
|
-
[<AutoOpen>]
|
|
9
|
-
module Result =
|
|
10
|
-
|
|
11
|
-
/// <summary>
|
|
12
|
-
/// Shorthand for <c>Result.map</c>
|
|
13
|
-
/// </summary>
|
|
14
|
-
/// <param name="mapper">The function to map over the <c>Result</c> value.</param>
|
|
15
|
-
/// <param name="input">The <c>Result</c> value to map over.</param>
|
|
16
|
-
/// <returns>The result of mapping the function over the <c>Result</c> value.</returns>
|
|
17
|
-
let inline (<!>)
|
|
18
|
-
(([<InlineIfLambda>] mapper: 'okInput -> 'okOutput))
|
|
19
|
-
(input: Result<'okInput, 'error>)
|
|
20
|
-
: Result<'okOutput, 'error> =
|
|
21
|
-
Result.map mapper input
|
|
22
|
-
|
|
23
|
-
/// <summary>
|
|
24
|
-
/// Shorthand for <c>Result.apply</c>
|
|
25
|
-
/// </summary>
|
|
26
|
-
/// <param name="applier">The <c>Result</c> value containing the function to apply.</param>
|
|
27
|
-
/// <param name="input">The <c>Result</c> value containing the value to apply the function to.</param>
|
|
28
|
-
/// <returns>The result of applying the function in the <c>Result</c> value to the value in the other <c>Result</c> value.</returns>
|
|
29
|
-
let inline (<*>)
|
|
30
|
-
(applier: Result<'okInput -> 'okOutput, 'error>)
|
|
31
|
-
(input: Result<'okInput, 'error>)
|
|
32
|
-
: Result<'okOutput, 'error> =
|
|
33
|
-
Result.apply applier input
|
|
34
|
-
|
|
35
|
-
/// <summary>
|
|
36
|
-
/// Shorthand for <c>Result.bind</c>
|
|
37
|
-
/// </summary>
|
|
38
|
-
/// <param name="input">The <c>Result</c> value to bind over.</param>
|
|
39
|
-
/// <param name="binder">The function to bind over the <c>Result</c> value.</param>
|
|
40
|
-
/// <returns>The result of binding the function over the <c>Result</c> value.</returns>
|
|
41
|
-
let inline (>>=)
|
|
42
|
-
(input: Result<'input, 'error>)
|
|
43
|
-
([<InlineIfLambda>] binder: 'input -> Result<'okOutput, 'error>)
|
|
44
|
-
: Result<'okOutput, 'error> =
|
|
45
|
-
Result.bind binder input
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
namespace FsToolkit.ErrorHandling
|
|
2
|
-
|
|
3
|
-
/// <summary>
|
|
4
|
-
/// Helper functions for working with <c>Result</c> values that contain <c>Option</c> values.
|
|
5
|
-
/// </summary>
|
|
6
|
-
[<RequireQualifiedAccess>]
|
|
7
|
-
module ResultOption =
|
|
8
|
-
|
|
9
|
-
/// <summary>
|
|
10
|
-
/// Converts a value to a value into a <c>Result</c> which contains the value wrapped in an <c>Option</c>.
|
|
11
|
-
/// </summary>
|
|
12
|
-
/// <param name="x">The value to convert.</param>
|
|
13
|
-
/// <returns>The value wrapped in an <c>Option</c> and then wrapped in a <c>Result</c>.</returns>
|
|
14
|
-
let inline retn x = Ok(Some x)
|
|
15
|
-
|
|
16
|
-
/// <summary>
|
|
17
|
-
/// Applies a transformation function to a <c>Result</c> value that contains an <c>Option</c> value.
|
|
18
|
-
///
|
|
19
|
-
/// Documentation is found here: <href>https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/option/map</href>
|
|
20
|
-
/// </summary>
|
|
21
|
-
/// <param name="mapper">The transformation function to apply.</param>
|
|
22
|
-
/// <param name="input">The <c>Result</c> value to apply the transformation function to.</param>
|
|
23
|
-
/// <returns>The result of applying the transformation function to the <c>Result</c> value.</returns>
|
|
24
|
-
let inline map
|
|
25
|
-
([<InlineIfLambda>] mapper: 'okInput -> 'okOutput)
|
|
26
|
-
(input: Result<'okInput option, 'error>)
|
|
27
|
-
: Result<'okOutput option, 'error> =
|
|
28
|
-
Result.map (Option.map mapper) input
|
|
29
|
-
|
|
30
|
-
/// <summary>
|
|
31
|
-
/// Maps the error value of a <c>Result</c> value that contains an <c>Option</c> value using the provided function.
|
|
32
|
-
///
|
|
33
|
-
/// Documentation is found here: <href>https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/option/maperror</href>
|
|
34
|
-
/// </summary>
|
|
35
|
-
/// <param name="mapper">The function to map over the error value.</param>
|
|
36
|
-
/// <param name="input">The <c>Result</c> value to map the error value of.</param>
|
|
37
|
-
/// <returns>The result of mapping the error value of the <c>Result</c> value.</returns>
|
|
38
|
-
let inline mapError
|
|
39
|
-
([<InlineIfLambda>] mapper: 'errorInput -> 'errorOutput)
|
|
40
|
-
(input: Result<'ok option, 'errorInput>)
|
|
41
|
-
: Result<'ok option, 'errorOutput> =
|
|
42
|
-
Result.mapError mapper input
|
|
43
|
-
|
|
44
|
-
/// <summary>
|
|
45
|
-
/// Takes a transformation function and applies to to the value in a <c>Result</c> value that contains an <c>Option</c> value, if is is <c>Ok</c> and <c>Some</c>.
|
|
46
|
-
///
|
|
47
|
-
/// Documentation is found here: <href>https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/option/bind</href>
|
|
48
|
-
/// </summary>
|
|
49
|
-
/// <param name="binder">The transformation function to apply.</param>
|
|
50
|
-
/// <param name="input">The <c>Result</c> value to apply the transformation function to.</param>
|
|
51
|
-
/// <returns>The result of applying the transformation function to the <c>Result</c> value.</returns>
|
|
52
|
-
let inline bind
|
|
53
|
-
([<InlineIfLambda>] binder: 'okInput -> Result<'okOutput option, 'error>)
|
|
54
|
-
(input: Result<'okInput option, 'error>)
|
|
55
|
-
: Result<'okOutput option, 'error> =
|
|
56
|
-
Result.bind
|
|
57
|
-
(function
|
|
58
|
-
| Some x -> binder x
|
|
59
|
-
| None -> Ok None)
|
|
60
|
-
input
|
|
61
|
-
|
|
62
|
-
/// <summary>
|
|
63
|
-
/// Applies a transformation function to a <c>Result</c> value that contains an <c>Option</c> value and returns the result wrapped in an <c>Option</c> within a <c>Result</c>.
|
|
64
|
-
///
|
|
65
|
-
/// Documentation is found here: <href>https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/option/apply</href>
|
|
66
|
-
/// </summary>
|
|
67
|
-
/// <param name="applier">The <c>Result</c> containing a potential function to apply</param>
|
|
68
|
-
/// <param name="input">The <c>Result</c> containing a potential value to apply the function to</param>
|
|
69
|
-
/// <returns>The result of applying the function to the value, wrapped in an <c>Option</c> and then wrapped in a <c>Result</c>.</returns>
|
|
70
|
-
let inline apply
|
|
71
|
-
(applier: Result<('okInput -> 'okOutput) option, 'error>)
|
|
72
|
-
(input: Result<'okInput option, 'error>)
|
|
73
|
-
: Result<'okOutput option, 'error> =
|
|
74
|
-
match (applier, input) with
|
|
75
|
-
| Ok f, Ok x ->
|
|
76
|
-
match f, x with
|
|
77
|
-
| Some f', Some x' -> Ok(Some(f' x'))
|
|
78
|
-
| _ -> Ok None
|
|
79
|
-
| Error e, _
|
|
80
|
-
| _, Error e -> Error e
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/// <summary>
|
|
84
|
-
/// Combines two <c>Result</c> values that contain <c>Option</c> values into a single <c>Result</c> value that contains the result wrapped in an <c>Option</c>.
|
|
85
|
-
///
|
|
86
|
-
/// Documentation is found here: <href>https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/option/map2</href>
|
|
87
|
-
/// </summary>
|
|
88
|
-
/// <param name="mapper">The function to combine the two values with.</param>
|
|
89
|
-
/// <param name="input1">The first <c>Result</c> value to combine.</param>
|
|
90
|
-
/// <param name="input2">The second <c>Result</c> value to combine.</param>
|
|
91
|
-
/// <returns>The result of combining the two <c>Result</c> values, wrapped in an <c>Option</c> and then wrapped in a <c>Result</c>.</returns>
|
|
92
|
-
let inline map2
|
|
93
|
-
([<InlineIfLambda>] mapper: 'okInput1 -> 'okInput2 -> 'okOutput)
|
|
94
|
-
(input1: Result<'okInput1 option, 'error>)
|
|
95
|
-
(input2: Result<'okInput2 option, 'error>)
|
|
96
|
-
: Result<'okOutput option, 'error> =
|
|
97
|
-
match (input1, input2) with
|
|
98
|
-
| Ok x, Ok y ->
|
|
99
|
-
match x, y with
|
|
100
|
-
| Some x', Some y' -> Ok(Some(mapper x' y'))
|
|
101
|
-
| _ -> Ok None
|
|
102
|
-
| Error e, _
|
|
103
|
-
| _, Error e -> Error e
|
|
104
|
-
|
|
105
|
-
/// <summary>
|
|
106
|
-
/// Combines three <c>Result</c> values that contain <c>Option</c> values into a single <c>Result</c> value that contains the result wrapped in an <c>Option</c>.
|
|
107
|
-
///
|
|
108
|
-
/// Documentation is found here: <href>https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/option/map3</href>
|
|
109
|
-
/// </summary>
|
|
110
|
-
/// <param name="mapper">The function to combine the three values with.</param>
|
|
111
|
-
/// <param name="input1">The first <c>Result</c> value to combine.</param>
|
|
112
|
-
/// <param name="input2">The second <c>Result</c> value to combine.</param>
|
|
113
|
-
/// <param name="input3">The third <c>Result</c> value to combine.</param>
|
|
114
|
-
/// <returns>The result of combining the three <c>Result</c> values, wrapped in an <c>Option</c> and then wrapped in a <c>Result</c>.</returns>
|
|
115
|
-
let inline map3
|
|
116
|
-
([<InlineIfLambda>] mapper: 'okInput1 -> 'okInput2 -> 'okInput3 -> 'okOutput)
|
|
117
|
-
(input1: Result<'okInput1 option, 'error>)
|
|
118
|
-
(input2: Result<'okInput2 option, 'error>)
|
|
119
|
-
(input3: Result<'okInput3 option, 'error>)
|
|
120
|
-
: Result<'okOutput option, 'error> =
|
|
121
|
-
match (input1, input2, input3) with
|
|
122
|
-
| Ok x, Ok y, Ok z ->
|
|
123
|
-
match x, y, z with
|
|
124
|
-
| Some x', Some y', Some z' -> Ok(Some(mapper x' y' z'))
|
|
125
|
-
| _ -> Ok None
|
|
126
|
-
| Error e, _, _
|
|
127
|
-
| _, Error e, _
|
|
128
|
-
| _, _, Error e -> Error e
|
|
129
|
-
|
|
130
|
-
/// <summary>
|
|
131
|
-
/// Combines two <c>Result</c> values that contain <c>Option</c> values into a single <c>Result</c> value that contains the tuple of the two values wrapped in an <c>Option</c>, if they are both <c>Some</c>.
|
|
132
|
-
///
|
|
133
|
-
/// Documentation is found here: <href>https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/option/zip</href>
|
|
134
|
-
/// </summary>
|
|
135
|
-
/// <param name="input1">The first <c>Result</c> value to combine.</param>
|
|
136
|
-
/// <param name="input2">The second <c>Result</c> value to combine.</param>
|
|
137
|
-
/// <returns>A tuple of the two values wrapped in an <c>Option</c> and then wrapped in a <c>Result</c>.</returns>
|
|
138
|
-
let zip
|
|
139
|
-
(left: Result<'leftOk option, 'error>)
|
|
140
|
-
(right: Result<'rightOk option, 'error>)
|
|
141
|
-
: Result<('leftOk * 'rightOk) option, 'error> =
|
|
142
|
-
match left, right with
|
|
143
|
-
| Ok x1res, Ok x2res ->
|
|
144
|
-
match x1res, x2res with
|
|
145
|
-
| Some x1, Some x2 -> Ok(Some(x1, x2))
|
|
146
|
-
| _ -> Ok None
|
|
147
|
-
| Error e, _ -> Error e
|
|
148
|
-
| _, Error e -> Error e
|
|
149
|
-
|
|
150
|
-
/// <summary>
|
|
151
|
-
/// Takes two results and returns a tuple of the error pair
|
|
152
|
-
///
|
|
153
|
-
/// Documentation is found here: <href>https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/option/ziperror</href>
|
|
154
|
-
/// </summary>
|
|
155
|
-
/// <param name="left">The first <c>Result</c> value to combine.</param>
|
|
156
|
-
/// <param name="right">The second <c>Result</c> value to combine.</param>
|
|
157
|
-
/// <returns>A tuple of the error pair of the input results.</returns>
|
|
158
|
-
let zipError
|
|
159
|
-
(left: Result<'ok option, 'leftError>)
|
|
160
|
-
(right: Result<'ok option, 'rightError>)
|
|
161
|
-
: Result<'ok option, 'leftError * 'rightError> =
|
|
162
|
-
match left, right with
|
|
163
|
-
| Error x1res, Error x2res -> Error(x1res, x2res)
|
|
164
|
-
| Ok e, _ -> Ok e
|
|
165
|
-
| _, Ok e -> Ok e
|
|
166
|
-
|
|
167
|
-
/// <summary>
|
|
168
|
-
/// Replaces the wrapped value with unit
|
|
169
|
-
/// </summary>
|
|
170
|
-
/// <param name="resultOpt">The <c>Result</c> value to ignore the value of.</param>
|
|
171
|
-
/// <returns>The <c>Result</c> value with the value replaced with an <c>Option</c> unit.</returns>
|
|
172
|
-
let inline ignore<'ok, 'error> (resultOpt: Result<'ok option, 'error>) =
|
|
173
|
-
resultOpt
|
|
174
|
-
|> map ignore<'ok>
|
|
175
|
-
|
|
176
|
-
/// <summary>
|
|
177
|
-
/// Converts a <c>Result</c> into a <c>Result</c> that contains the value wrapped in an <c>Option</c>.
|
|
178
|
-
/// </summary>
|
|
179
|
-
/// <param name="result">The <c>Result</c> to convert.</param>
|
|
180
|
-
/// <returns>The <c>Result</c> with the value wrapped in an <c>Option</c>.</returns>
|
|
181
|
-
let inline ofResult (result: Result<'ok, 'error>) : Result<'ok option, 'error> =
|
|
182
|
-
match result with
|
|
183
|
-
| Ok x -> Ok(Some x)
|
|
184
|
-
| Error e -> Error e
|
|
185
|
-
|
|
186
|
-
/// <summary>
|
|
187
|
-
/// Converts an <c>Option</c> into a <c>Result</c> that contains the <c>Option</c>
|
|
188
|
-
/// </summary>
|
|
189
|
-
/// <param name="option">The <c>Option</c> to convert.</param>
|
|
190
|
-
/// <returns>The <c>Result</c> with the <c>Option</c>.</returns>
|
|
191
|
-
let inline ofOption (option: 'T option) : Result<'T option, 'error> = Ok option
|
|
192
|
-
|
|
193
|
-
/// <summary>
|
|
194
|
-
/// Converts a <c>Choice</c> into a <c>Result</c> that contains the value wrapped in an <c>Option</c>.
|
|
195
|
-
/// </summary>
|
|
196
|
-
/// <param name="choice">The <c>Choice</c> to convert.</param>
|
|
197
|
-
/// <returns>The <c>Result</c> with the value wrapped in an <c>Option</c>.</returns>
|
|
198
|
-
let inline ofChoice (choice: Choice<'ok, 'error>) : Result<'ok option, 'error> =
|
|
199
|
-
match choice with
|
|
200
|
-
| Choice1Of2 x -> Ok(Some x)
|
|
201
|
-
| Choice2Of2 e -> Error e
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { FSharpResult$2 } from "../fable-library-js.4.14.0/Result.js";
|
|
2
|
-
import { value } from "../fable-library-js.4.14.0/Option.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Combines two <c>Result</c> values that contain <c>Option</c> values into a single <c>Result</c> value that contains the tuple of the two values wrapped in an <c>Option</c>, if they are both <c>Some</c>.
|
|
6
|
-
*
|
|
7
|
-
* Documentation is found here: <href>https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/option/zip</href>
|
|
8
|
-
*/
|
|
9
|
-
export function zip(left, right) {
|
|
10
|
-
const copyOfStruct = left;
|
|
11
|
-
if (copyOfStruct.tag === 1) {
|
|
12
|
-
return new FSharpResult$2(1, [copyOfStruct.fields[0]]);
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
const copyOfStruct_1 = right;
|
|
16
|
-
if (copyOfStruct_1.tag === 1) {
|
|
17
|
-
return new FSharpResult$2(1, [copyOfStruct_1.fields[0]]);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
let matchResult, x1, x2;
|
|
21
|
-
if (copyOfStruct.fields[0] != null) {
|
|
22
|
-
if (copyOfStruct_1.fields[0] != null) {
|
|
23
|
-
matchResult = 0;
|
|
24
|
-
x1 = value(copyOfStruct.fields[0]);
|
|
25
|
-
x2 = value(copyOfStruct_1.fields[0]);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
matchResult = 1;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
matchResult = 1;
|
|
33
|
-
}
|
|
34
|
-
switch (matchResult) {
|
|
35
|
-
case 0:
|
|
36
|
-
return new FSharpResult$2(0, [[x1, x2]]);
|
|
37
|
-
default:
|
|
38
|
-
return new FSharpResult$2(0, [void 0]);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Takes two results and returns a tuple of the error pair
|
|
46
|
-
*
|
|
47
|
-
* Documentation is found here: <href>https://demystifyfp.gitbook.io/fstoolkit-errorhandling/fstoolkit.errorhandling/option/ziperror</href>
|
|
48
|
-
*/
|
|
49
|
-
export function zipError(left, right) {
|
|
50
|
-
const copyOfStruct = left;
|
|
51
|
-
if (copyOfStruct.tag === 0) {
|
|
52
|
-
return new FSharpResult$2(0, [copyOfStruct.fields[0]]);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
const copyOfStruct_1 = right;
|
|
56
|
-
if (copyOfStruct_1.tag === 0) {
|
|
57
|
-
return new FSharpResult$2(0, [copyOfStruct_1.fields[0]]);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
return new FSharpResult$2(1, [[copyOfStruct.fields[0], copyOfStruct_1.fields[0]]]);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
//# sourceMappingURL=ResultOption.fs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["./ResultOption.fs"],"names":["copyOfStruct","left","right","x1","x2"],"mappings":";;;;;;;;;AA6IcA,yBAAAC;AAAA,QAAA,AAAAD;AAKU,eAAA,uBALV,AAAAA;;;AAAAA,\u002BBAAME;AAAN,YAAA,AAAAF;AAMU,mBAAA,uBANV,AAAAA;;;6BAGKG,IAASC;AADV,gBAAA,AAFJ,AAAAJ;AAEI,oBAAA,AAFJ,AAAAA;;AAGKG,\u002BBAHL,AAAAH;AAGcI,\u002BBAHd,AAAAJ;;;;;;;;;;;AAGoB,2BAAA,wBAAQG,IAAIC;;AAC3B,2BAAA,uBAAG;;;;;;;;;;;;AAgBRJ,yBAAAC;AAAA,QAAA,AAAAD;AAEO,eAAA,uBAFP,AAAAA;;;AAAAA,\u002BBAAME;AAAN,YAAA,AAAAF;AAGO,mBAAA,uBAHP,AAAAA;;;AACwB,mBAAA,wBADxB,AAAAA,wBAAA,AAAAA","file":null,"sourcesContent":null,"sourceRoot":null}
|