@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,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InvalidOperationException_$ctor_Z721C83C5, NotSupportedException_$ctor_Z721C83C5 } from "./System.js";
|
|
2
|
+
import { clear, Exception, isDisposable, isArrayLike, toIterator, disposeSafe, getEnumerator } from "./Util.js";
|
|
2
3
|
import { toString } from "./Types.js";
|
|
3
4
|
import { class_type } from "./Reflection.js";
|
|
4
5
|
import { some, value as value_1 } from "./Option.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
6
|
+
import { KeyNotFoundException_$ctor_Z721C83C5 } from "./System.Collections.Generic.js";
|
|
7
|
+
import { Operators_Lock, Operators_NullArgCheck } from "./FSharp.Core.js";
|
|
8
|
+
import { randomSampleBy as randomSampleBy_1, randomChoicesBy as randomChoicesBy_1, randomChoice as randomChoice_1, randomChoiceWith as randomChoiceWith_1, randomChoiceBy as randomChoiceBy_1, randomShuffleInPlaceBy, chunkBySize as chunkBySize_1, permute as permute_1, transpose as transpose_1, map as map_1, windowed as windowed_1, splitInto as splitInto_1, pairwise as pairwise_1, scanBack as scanBack_1, reverse as reverse_1, mapFoldBack as mapFoldBack_1, mapFold as mapFold_1, tryItem as tryItem_1, tryHead as tryHead_1, item as item_1, foldBack as foldBack_1, tryFindIndexBack as tryFindIndexBack_1, tryFindBack as tryFindBack_1, singleton as singleton_1 } from "./Array.js";
|
|
7
9
|
import { length as length_1, tryItem as tryItem_2, isEmpty as isEmpty_1, tryHead as tryHead_2, ofSeq as ofSeq_1, ofArray as ofArray_1, toArray as toArray_1, FSharpList } from "./List.js";
|
|
10
|
+
import { min as min_1 } from "./Double.js";
|
|
8
11
|
import { SR_indexOutOfBounds } from "./Global.js";
|
|
12
|
+
import { nonSeeded } from "./Random.js";
|
|
9
13
|
export const SR_enumerationAlreadyFinished = "Enumeration already finished.";
|
|
10
14
|
export const SR_enumerationNotStarted = "Enumeration has not started. Call MoveNext.";
|
|
11
15
|
export const SR_inputSequenceEmpty = "The input sequence was empty.";
|
|
@@ -14,13 +18,13 @@ export const SR_keyNotFoundAlt = "An index satisfying the predicate was not foun
|
|
|
14
18
|
export const SR_notEnoughElements = "The input sequence has an insufficient number of elements.";
|
|
15
19
|
export const SR_resetNotSupported = "Reset is not supported on this enumerator.";
|
|
16
20
|
export function Enumerator_noReset() {
|
|
17
|
-
throw
|
|
21
|
+
throw NotSupportedException_$ctor_Z721C83C5(SR_resetNotSupported);
|
|
18
22
|
}
|
|
19
23
|
export function Enumerator_notStarted() {
|
|
20
|
-
throw
|
|
24
|
+
throw InvalidOperationException_$ctor_Z721C83C5(SR_enumerationNotStarted);
|
|
21
25
|
}
|
|
22
26
|
export function Enumerator_alreadyFinished() {
|
|
23
|
-
throw
|
|
27
|
+
throw InvalidOperationException_$ctor_Z721C83C5(SR_enumerationAlreadyFinished);
|
|
24
28
|
}
|
|
25
29
|
export class Enumerator_Seq {
|
|
26
30
|
constructor(f) {
|
|
@@ -100,16 +104,15 @@ export function Enumerator_FromFunctions$1_$ctor_58C54629(current, next, dispose
|
|
|
100
104
|
}
|
|
101
105
|
export function Enumerator_cast(e) {
|
|
102
106
|
return Enumerator_FromFunctions$1_$ctor_58C54629(() => e["System.Collections.Generic.IEnumerator`1.get_Current"](), () => e["System.Collections.IEnumerator.MoveNext"](), () => {
|
|
103
|
-
|
|
104
|
-
disposeSafe(e_1);
|
|
107
|
+
disposeSafe(e);
|
|
105
108
|
});
|
|
106
109
|
}
|
|
107
110
|
export function Enumerator_concat(sources) {
|
|
108
|
-
let outerOpt =
|
|
109
|
-
let innerOpt =
|
|
111
|
+
let outerOpt = undefined;
|
|
112
|
+
let innerOpt = undefined;
|
|
110
113
|
let started = false;
|
|
111
114
|
let finished = false;
|
|
112
|
-
let curr =
|
|
115
|
+
let curr = undefined;
|
|
113
116
|
const finish = () => {
|
|
114
117
|
finished = true;
|
|
115
118
|
if (innerOpt != null) {
|
|
@@ -118,7 +121,7 @@ export function Enumerator_concat(sources) {
|
|
|
118
121
|
disposeSafe(inner);
|
|
119
122
|
}
|
|
120
123
|
finally {
|
|
121
|
-
innerOpt =
|
|
124
|
+
innerOpt = undefined;
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
127
|
if (outerOpt != null) {
|
|
@@ -127,7 +130,7 @@ export function Enumerator_concat(sources) {
|
|
|
127
130
|
disposeSafe(outer);
|
|
128
131
|
}
|
|
129
132
|
finally {
|
|
130
|
-
outerOpt =
|
|
133
|
+
outerOpt = undefined;
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
136
|
};
|
|
@@ -145,7 +148,6 @@ export function Enumerator_concat(sources) {
|
|
|
145
148
|
return Enumerator_alreadyFinished();
|
|
146
149
|
}
|
|
147
150
|
}, () => {
|
|
148
|
-
let copyOfStruct;
|
|
149
151
|
if (!started) {
|
|
150
152
|
started = true;
|
|
151
153
|
}
|
|
@@ -153,8 +155,9 @@ export function Enumerator_concat(sources) {
|
|
|
153
155
|
return false;
|
|
154
156
|
}
|
|
155
157
|
else {
|
|
156
|
-
let res =
|
|
158
|
+
let res = undefined;
|
|
157
159
|
while (res == null) {
|
|
160
|
+
let copyOfStruct = undefined;
|
|
158
161
|
const outerOpt_1 = outerOpt;
|
|
159
162
|
const innerOpt_1 = innerOpt;
|
|
160
163
|
if (outerOpt_1 != null) {
|
|
@@ -169,7 +172,7 @@ export function Enumerator_concat(sources) {
|
|
|
169
172
|
disposeSafe(inner_1);
|
|
170
173
|
}
|
|
171
174
|
finally {
|
|
172
|
-
innerOpt =
|
|
175
|
+
innerOpt = undefined;
|
|
173
176
|
}
|
|
174
177
|
}
|
|
175
178
|
}
|
|
@@ -209,7 +212,7 @@ export function Enumerator_enumerateThenFinally(f, e) {
|
|
|
209
212
|
}
|
|
210
213
|
export function Enumerator_generateWhileSome(openf, compute, closef) {
|
|
211
214
|
let started = false;
|
|
212
|
-
let curr =
|
|
215
|
+
let curr = undefined;
|
|
213
216
|
let state = some(openf());
|
|
214
217
|
const dispose = () => {
|
|
215
218
|
if (state != null) {
|
|
@@ -218,7 +221,7 @@ export function Enumerator_generateWhileSome(openf, compute, closef) {
|
|
|
218
221
|
closef(x_1);
|
|
219
222
|
}
|
|
220
223
|
finally {
|
|
221
|
-
state =
|
|
224
|
+
state = undefined;
|
|
222
225
|
}
|
|
223
226
|
}
|
|
224
227
|
};
|
|
@@ -227,7 +230,7 @@ export function Enumerator_generateWhileSome(openf, compute, closef) {
|
|
|
227
230
|
dispose();
|
|
228
231
|
}
|
|
229
232
|
finally {
|
|
230
|
-
curr =
|
|
233
|
+
curr = undefined;
|
|
231
234
|
}
|
|
232
235
|
};
|
|
233
236
|
return Enumerator_FromFunctions$1_$ctor_58C54629(() => {
|
|
@@ -269,12 +272,12 @@ export function Enumerator_generateWhileSome(openf, compute, closef) {
|
|
|
269
272
|
}, dispose);
|
|
270
273
|
}
|
|
271
274
|
export function Enumerator_unfold(f, state) {
|
|
272
|
-
let curr =
|
|
275
|
+
let curr = undefined;
|
|
273
276
|
let acc = state;
|
|
274
277
|
return Enumerator_FromFunctions$1_$ctor_58C54629(() => {
|
|
275
278
|
if (curr != null) {
|
|
276
279
|
const x = value_1(curr)[0];
|
|
277
|
-
|
|
280
|
+
value_1(curr)[1];
|
|
278
281
|
return x;
|
|
279
282
|
}
|
|
280
283
|
else {
|
|
@@ -283,7 +286,7 @@ export function Enumerator_unfold(f, state) {
|
|
|
283
286
|
}, () => {
|
|
284
287
|
curr = f(acc);
|
|
285
288
|
if (curr != null) {
|
|
286
|
-
|
|
289
|
+
value_1(curr)[0];
|
|
287
290
|
const st_1 = value_1(curr)[1];
|
|
288
291
|
acc = st_1;
|
|
289
292
|
return true;
|
|
@@ -295,19 +298,13 @@ export function Enumerator_unfold(f, state) {
|
|
|
295
298
|
});
|
|
296
299
|
}
|
|
297
300
|
export function indexNotFound() {
|
|
298
|
-
throw
|
|
299
|
-
}
|
|
300
|
-
export function checkNonNull(argName, arg) {
|
|
301
|
-
if (arg == null) {
|
|
302
|
-
Operators_NullArg(argName);
|
|
303
|
-
}
|
|
301
|
+
throw KeyNotFoundException_$ctor_Z721C83C5(SR_keyNotFoundAlt);
|
|
304
302
|
}
|
|
305
303
|
export function mkSeq(f) {
|
|
306
304
|
return Enumerator_Seq_$ctor_673A07F2(f);
|
|
307
305
|
}
|
|
308
306
|
export function ofSeq(xs) {
|
|
309
|
-
|
|
310
|
-
return getEnumerator(xs);
|
|
307
|
+
return getEnumerator(Operators_NullArgCheck("source", xs));
|
|
311
308
|
}
|
|
312
309
|
export function delay(generator) {
|
|
313
310
|
return mkSeq(() => getEnumerator(generator()));
|
|
@@ -366,14 +363,11 @@ export function append(xs, ys) {
|
|
|
366
363
|
return concat([xs, ys]);
|
|
367
364
|
}
|
|
368
365
|
export function cast(xs) {
|
|
369
|
-
return mkSeq(() =>
|
|
370
|
-
checkNonNull("source", xs);
|
|
371
|
-
return Enumerator_cast(getEnumerator(xs));
|
|
372
|
-
});
|
|
366
|
+
return mkSeq(() => Enumerator_cast(getEnumerator(Operators_NullArgCheck("source", xs))));
|
|
373
367
|
}
|
|
374
368
|
export function choose(chooser, xs) {
|
|
375
369
|
return generate(() => ofSeq(xs), (e) => {
|
|
376
|
-
let curr =
|
|
370
|
+
let curr = undefined;
|
|
377
371
|
while ((curr == null) && e["System.Collections.IEnumerator.MoveNext"]()) {
|
|
378
372
|
curr = chooser(e["System.Collections.Generic.IEnumerator`1.get_Current"]());
|
|
379
373
|
}
|
|
@@ -421,7 +415,7 @@ export function contains(value, xs, comparer) {
|
|
|
421
415
|
}
|
|
422
416
|
}
|
|
423
417
|
export function enumerateFromFunctions(create, moveNext, current) {
|
|
424
|
-
return generate(create, (x) => (moveNext(x) ? some(current(x)) :
|
|
418
|
+
return generate(create, (x) => (moveNext(x) ? some(current(x)) : undefined), (x_1) => {
|
|
425
419
|
const matchValue = x_1;
|
|
426
420
|
if (isDisposable(matchValue)) {
|
|
427
421
|
const id = matchValue;
|
|
@@ -443,7 +437,7 @@ export function enumerateThenFinally(source, compensation) {
|
|
|
443
437
|
}
|
|
444
438
|
export function enumerateUsing(resource, source) {
|
|
445
439
|
const compensation = () => {
|
|
446
|
-
if (
|
|
440
|
+
if (resource == null) {
|
|
447
441
|
}
|
|
448
442
|
else {
|
|
449
443
|
let copyOfStruct = resource;
|
|
@@ -461,7 +455,94 @@ export function enumerateUsing(resource, source) {
|
|
|
461
455
|
});
|
|
462
456
|
}
|
|
463
457
|
export function enumerateWhile(guard, xs) {
|
|
464
|
-
return concat(unfold((i) => (guard() ? [xs, i + 1] :
|
|
458
|
+
return concat(unfold((i) => (guard() ? [xs, i + 1] : undefined), 0));
|
|
459
|
+
}
|
|
460
|
+
export function enumerateTryWith(source, catchFilter, catchHandler) {
|
|
461
|
+
return mkSeq(() => {
|
|
462
|
+
let e = undefined;
|
|
463
|
+
let caught = false;
|
|
464
|
+
let started = false;
|
|
465
|
+
let finished = false;
|
|
466
|
+
let curr = undefined;
|
|
467
|
+
const tryNext = () => {
|
|
468
|
+
try {
|
|
469
|
+
let en_2;
|
|
470
|
+
if (e == null) {
|
|
471
|
+
const en_1 = getEnumerator(source);
|
|
472
|
+
e = en_1;
|
|
473
|
+
en_2 = en_1;
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
en_2 = value_1(e);
|
|
477
|
+
}
|
|
478
|
+
if (en_2["System.Collections.IEnumerator.MoveNext"]()) {
|
|
479
|
+
curr = some(en_2["System.Collections.Generic.IEnumerator`1.get_Current"]());
|
|
480
|
+
return true;
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
finished = true;
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
catch (matchValue) {
|
|
488
|
+
if (!caught) {
|
|
489
|
+
const ex_1 = matchValue;
|
|
490
|
+
if (catchFilter(ex_1) !== 0) {
|
|
491
|
+
caught = true;
|
|
492
|
+
if (e == null) {
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
const en_3 = value_1(e);
|
|
496
|
+
try {
|
|
497
|
+
disposeSafe(en_3);
|
|
498
|
+
}
|
|
499
|
+
catch (matchValue_1) {
|
|
500
|
+
}
|
|
501
|
+
e = undefined;
|
|
502
|
+
}
|
|
503
|
+
e = getEnumerator(catchHandler(ex_1));
|
|
504
|
+
return tryNext();
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
507
|
+
throw matchValue;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
throw matchValue;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
return Enumerator_FromFunctions$1_$ctor_58C54629(() => {
|
|
516
|
+
if (!started) {
|
|
517
|
+
Enumerator_notStarted();
|
|
518
|
+
}
|
|
519
|
+
else if (finished) {
|
|
520
|
+
Enumerator_alreadyFinished();
|
|
521
|
+
}
|
|
522
|
+
if (curr != null) {
|
|
523
|
+
return value_1(curr);
|
|
524
|
+
}
|
|
525
|
+
else {
|
|
526
|
+
return Enumerator_alreadyFinished();
|
|
527
|
+
}
|
|
528
|
+
}, () => {
|
|
529
|
+
if (!started) {
|
|
530
|
+
started = true;
|
|
531
|
+
}
|
|
532
|
+
if (finished) {
|
|
533
|
+
return false;
|
|
534
|
+
}
|
|
535
|
+
else {
|
|
536
|
+
return tryNext();
|
|
537
|
+
}
|
|
538
|
+
}, () => {
|
|
539
|
+
if (e == null) {
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
disposeSafe(value_1(e));
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
});
|
|
465
546
|
}
|
|
466
547
|
export function filter(f, xs) {
|
|
467
548
|
return choose((x) => {
|
|
@@ -469,7 +550,7 @@ export function filter(f, xs) {
|
|
|
469
550
|
return some(x);
|
|
470
551
|
}
|
|
471
552
|
else {
|
|
472
|
-
return
|
|
553
|
+
return undefined;
|
|
473
554
|
}
|
|
474
555
|
}, xs);
|
|
475
556
|
}
|
|
@@ -511,14 +592,14 @@ export function exactlyOne(xs) {
|
|
|
511
592
|
if (e["System.Collections.IEnumerator.MoveNext"]()) {
|
|
512
593
|
const v = e["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
513
594
|
if (e["System.Collections.IEnumerator.MoveNext"]()) {
|
|
514
|
-
throw new
|
|
595
|
+
throw new Exception(SR_inputSequenceTooLong + " (Parameter \'source\')");
|
|
515
596
|
}
|
|
516
597
|
else {
|
|
517
598
|
return v;
|
|
518
599
|
}
|
|
519
600
|
}
|
|
520
601
|
else {
|
|
521
|
-
throw new
|
|
602
|
+
throw new Exception(SR_inputSequenceEmpty + " (Parameter \'source\')");
|
|
522
603
|
}
|
|
523
604
|
}
|
|
524
605
|
finally {
|
|
@@ -530,10 +611,10 @@ export function tryExactlyOne(xs) {
|
|
|
530
611
|
try {
|
|
531
612
|
if (e["System.Collections.IEnumerator.MoveNext"]()) {
|
|
532
613
|
const v = e["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
533
|
-
return e["System.Collections.IEnumerator.MoveNext"]() ?
|
|
614
|
+
return e["System.Collections.IEnumerator.MoveNext"]() ? undefined : some(v);
|
|
534
615
|
}
|
|
535
616
|
else {
|
|
536
|
-
return
|
|
617
|
+
return undefined;
|
|
537
618
|
}
|
|
538
619
|
}
|
|
539
620
|
finally {
|
|
@@ -543,7 +624,7 @@ export function tryExactlyOne(xs) {
|
|
|
543
624
|
export function tryFind(predicate, xs) {
|
|
544
625
|
const e = ofSeq(xs);
|
|
545
626
|
try {
|
|
546
|
-
let res =
|
|
627
|
+
let res = undefined;
|
|
547
628
|
while ((res == null) && e["System.Collections.IEnumerator.MoveNext"]()) {
|
|
548
629
|
const c = e["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
549
630
|
if (predicate(c)) {
|
|
@@ -593,7 +674,7 @@ export function tryFindIndex(predicate, xs) {
|
|
|
593
674
|
}
|
|
594
675
|
}
|
|
595
676
|
else {
|
|
596
|
-
return
|
|
677
|
+
return undefined;
|
|
597
678
|
}
|
|
598
679
|
break;
|
|
599
680
|
}
|
|
@@ -663,7 +744,14 @@ export function fold2(folder, state, xs, ys) {
|
|
|
663
744
|
}
|
|
664
745
|
}
|
|
665
746
|
export function foldBack2(folder, xs, ys, state) {
|
|
666
|
-
|
|
747
|
+
const xs_1 = toArray(xs);
|
|
748
|
+
const ys_1 = toArray(ys);
|
|
749
|
+
const len = min_1(xs_1.length, ys_1.length) | 0;
|
|
750
|
+
let acc = state;
|
|
751
|
+
for (let i = len - 1; i >= 0; i--) {
|
|
752
|
+
acc = folder(item_1(i, xs_1), item_1(i, ys_1), acc);
|
|
753
|
+
}
|
|
754
|
+
return acc;
|
|
667
755
|
}
|
|
668
756
|
export function forAll(predicate, xs) {
|
|
669
757
|
return !exists((x) => !predicate(x), xs);
|
|
@@ -681,7 +769,7 @@ export function tryHead(xs) {
|
|
|
681
769
|
else {
|
|
682
770
|
const e = ofSeq(xs);
|
|
683
771
|
try {
|
|
684
|
-
return e["System.Collections.IEnumerator.MoveNext"]() ? some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()) :
|
|
772
|
+
return e["System.Collections.IEnumerator.MoveNext"]() ? some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()) : undefined;
|
|
685
773
|
}
|
|
686
774
|
finally {
|
|
687
775
|
disposeSafe(e);
|
|
@@ -691,14 +779,14 @@ export function tryHead(xs) {
|
|
|
691
779
|
export function head(xs) {
|
|
692
780
|
const matchValue = tryHead(xs);
|
|
693
781
|
if (matchValue == null) {
|
|
694
|
-
throw new
|
|
782
|
+
throw new Exception(SR_inputSequenceEmpty + " (Parameter \'source\')");
|
|
695
783
|
}
|
|
696
784
|
else {
|
|
697
785
|
return value_1(matchValue);
|
|
698
786
|
}
|
|
699
787
|
}
|
|
700
788
|
export function initialize(count, f) {
|
|
701
|
-
return unfold((i) => ((i < count) ? [f(i), i + 1] :
|
|
789
|
+
return unfold((i) => ((i < count) ? [f(i), i + 1] : undefined), 0);
|
|
702
790
|
}
|
|
703
791
|
export function initializeInfinite(f) {
|
|
704
792
|
return initialize(2147483647, f);
|
|
@@ -735,7 +823,7 @@ export function tryItem(index, xs) {
|
|
|
735
823
|
loop: while (true) {
|
|
736
824
|
const index_1 = index_1_mut;
|
|
737
825
|
if (!e["System.Collections.IEnumerator.MoveNext"]()) {
|
|
738
|
-
return
|
|
826
|
+
return undefined;
|
|
739
827
|
}
|
|
740
828
|
else if (index_1 === 0) {
|
|
741
829
|
return some(e["System.Collections.Generic.IEnumerator`1.get_Current"]());
|
|
@@ -757,7 +845,7 @@ export function tryItem(index, xs) {
|
|
|
757
845
|
export function item(index, xs) {
|
|
758
846
|
const matchValue = tryItem(index, xs);
|
|
759
847
|
if (matchValue == null) {
|
|
760
|
-
throw new
|
|
848
|
+
throw new Exception(SR_notEnoughElements + " (Parameter \'index\')");
|
|
761
849
|
}
|
|
762
850
|
else {
|
|
763
851
|
return value_1(matchValue);
|
|
@@ -766,12 +854,12 @@ export function item(index, xs) {
|
|
|
766
854
|
export function iterate(action, xs) {
|
|
767
855
|
fold((unitVar, x) => {
|
|
768
856
|
action(x);
|
|
769
|
-
},
|
|
857
|
+
}, undefined, xs);
|
|
770
858
|
}
|
|
771
859
|
export function iterate2(action, xs, ys) {
|
|
772
860
|
fold2((unitVar, x, y) => {
|
|
773
861
|
action(x, y);
|
|
774
|
-
},
|
|
862
|
+
}, undefined, xs, ys);
|
|
775
863
|
}
|
|
776
864
|
export function iterateIndexed(action, xs) {
|
|
777
865
|
fold((i, x) => {
|
|
@@ -801,7 +889,7 @@ export function tryLast(xs) {
|
|
|
801
889
|
break;
|
|
802
890
|
}
|
|
803
891
|
};
|
|
804
|
-
return e["System.Collections.IEnumerator.MoveNext"]() ? some(loop(e["System.Collections.Generic.IEnumerator`1.get_Current"]())) :
|
|
892
|
+
return e["System.Collections.IEnumerator.MoveNext"]() ? some(loop(e["System.Collections.Generic.IEnumerator`1.get_Current"]())) : undefined;
|
|
805
893
|
}
|
|
806
894
|
finally {
|
|
807
895
|
disposeSafe(e);
|
|
@@ -810,7 +898,7 @@ export function tryLast(xs) {
|
|
|
810
898
|
export function last(xs) {
|
|
811
899
|
const matchValue = tryLast(xs);
|
|
812
900
|
if (matchValue == null) {
|
|
813
|
-
throw new
|
|
901
|
+
throw new Exception(SR_notEnoughElements + " (Parameter \'source\')");
|
|
814
902
|
}
|
|
815
903
|
else {
|
|
816
904
|
return value_1(matchValue);
|
|
@@ -839,12 +927,12 @@ export function length(xs) {
|
|
|
839
927
|
}
|
|
840
928
|
}
|
|
841
929
|
export function map(mapping, xs) {
|
|
842
|
-
return generate(() => ofSeq(xs), (e) => (e["System.Collections.IEnumerator.MoveNext"]() ? some(mapping(e["System.Collections.Generic.IEnumerator`1.get_Current"]())) :
|
|
930
|
+
return generate(() => ofSeq(xs), (e) => (e["System.Collections.IEnumerator.MoveNext"]() ? some(mapping(e["System.Collections.Generic.IEnumerator`1.get_Current"]())) : undefined), (e_1) => {
|
|
843
931
|
disposeSafe(e_1);
|
|
844
932
|
});
|
|
845
933
|
}
|
|
846
934
|
export function mapIndexed(mapping, xs) {
|
|
847
|
-
return generateIndexed(() => ofSeq(xs), (i, e) => (e["System.Collections.IEnumerator.MoveNext"]() ? some(mapping(i, e["System.Collections.Generic.IEnumerator`1.get_Current"]())) :
|
|
935
|
+
return generateIndexed(() => ofSeq(xs), (i, e) => (e["System.Collections.IEnumerator.MoveNext"]() ? some(mapping(i, e["System.Collections.Generic.IEnumerator`1.get_Current"]())) : undefined), (e_1) => {
|
|
848
936
|
disposeSafe(e_1);
|
|
849
937
|
});
|
|
850
938
|
}
|
|
@@ -855,7 +943,7 @@ export function map2(mapping, xs, ys) {
|
|
|
855
943
|
return generate(() => [ofSeq(xs), ofSeq(ys)], (tupledArg) => {
|
|
856
944
|
const e1 = tupledArg[0];
|
|
857
945
|
const e2 = tupledArg[1];
|
|
858
|
-
return (e1["System.Collections.IEnumerator.MoveNext"]() && e2["System.Collections.IEnumerator.MoveNext"]()) ? some(mapping(e1["System.Collections.Generic.IEnumerator`1.get_Current"](), e2["System.Collections.Generic.IEnumerator`1.get_Current"]())) :
|
|
946
|
+
return (e1["System.Collections.IEnumerator.MoveNext"]() && e2["System.Collections.IEnumerator.MoveNext"]()) ? some(mapping(e1["System.Collections.Generic.IEnumerator`1.get_Current"](), e2["System.Collections.Generic.IEnumerator`1.get_Current"]())) : undefined;
|
|
859
947
|
}, (tupledArg_1) => {
|
|
860
948
|
try {
|
|
861
949
|
disposeSafe(tupledArg_1[0]);
|
|
@@ -869,7 +957,7 @@ export function mapIndexed2(mapping, xs, ys) {
|
|
|
869
957
|
return generateIndexed(() => [ofSeq(xs), ofSeq(ys)], (i, tupledArg) => {
|
|
870
958
|
const e1 = tupledArg[0];
|
|
871
959
|
const e2 = tupledArg[1];
|
|
872
|
-
return (e1["System.Collections.IEnumerator.MoveNext"]() && e2["System.Collections.IEnumerator.MoveNext"]()) ? some(mapping(i, e1["System.Collections.Generic.IEnumerator`1.get_Current"](), e2["System.Collections.Generic.IEnumerator`1.get_Current"]())) :
|
|
960
|
+
return (e1["System.Collections.IEnumerator.MoveNext"]() && e2["System.Collections.IEnumerator.MoveNext"]()) ? some(mapping(i, e1["System.Collections.Generic.IEnumerator`1.get_Current"](), e2["System.Collections.Generic.IEnumerator`1.get_Current"]())) : undefined;
|
|
873
961
|
}, (tupledArg_1) => {
|
|
874
962
|
try {
|
|
875
963
|
disposeSafe(tupledArg_1[0]);
|
|
@@ -884,7 +972,7 @@ export function map3(mapping, xs, ys, zs) {
|
|
|
884
972
|
const e1 = tupledArg[0];
|
|
885
973
|
const e2 = tupledArg[1];
|
|
886
974
|
const e3 = tupledArg[2];
|
|
887
|
-
return ((e1["System.Collections.IEnumerator.MoveNext"]() && e2["System.Collections.IEnumerator.MoveNext"]()) && e3["System.Collections.IEnumerator.MoveNext"]()) ? some(mapping(e1["System.Collections.Generic.IEnumerator`1.get_Current"](), e2["System.Collections.Generic.IEnumerator`1.get_Current"](), e3["System.Collections.Generic.IEnumerator`1.get_Current"]())) :
|
|
975
|
+
return ((e1["System.Collections.IEnumerator.MoveNext"]() && e2["System.Collections.IEnumerator.MoveNext"]()) && e3["System.Collections.IEnumerator.MoveNext"]()) ? some(mapping(e1["System.Collections.Generic.IEnumerator`1.get_Current"](), e2["System.Collections.Generic.IEnumerator`1.get_Current"](), e3["System.Collections.Generic.IEnumerator`1.get_Current"]())) : undefined;
|
|
888
976
|
}, (tupledArg_1) => {
|
|
889
977
|
try {
|
|
890
978
|
disposeSafe(tupledArg_1[0]);
|
|
@@ -900,8 +988,7 @@ export function map3(mapping, xs, ys, zs) {
|
|
|
900
988
|
});
|
|
901
989
|
}
|
|
902
990
|
export function readOnly(xs) {
|
|
903
|
-
|
|
904
|
-
return map((x) => x, xs);
|
|
991
|
+
return map((x) => x, Operators_NullArgCheck("source", xs));
|
|
905
992
|
}
|
|
906
993
|
export class CachedSeq$1 {
|
|
907
994
|
constructor(cleanup, res) {
|
|
@@ -934,13 +1021,13 @@ export function CachedSeq$1__Clear(_) {
|
|
|
934
1021
|
_.cleanup();
|
|
935
1022
|
}
|
|
936
1023
|
export function cache(source) {
|
|
937
|
-
|
|
1024
|
+
const source_1 = Operators_NullArgCheck("source", source);
|
|
938
1025
|
const prefix = [];
|
|
939
|
-
let enumeratorR =
|
|
1026
|
+
let enumeratorR = undefined;
|
|
940
1027
|
return CachedSeq$1_$ctor_Z7A8347D4(() => {
|
|
941
1028
|
Operators_Lock(prefix, () => {
|
|
942
1029
|
clear(prefix);
|
|
943
|
-
let matchResult, e;
|
|
1030
|
+
let matchResult = undefined, e = undefined;
|
|
944
1031
|
if (enumeratorR != null) {
|
|
945
1032
|
if (value_1(enumeratorR) != null) {
|
|
946
1033
|
matchResult = 0;
|
|
@@ -959,11 +1046,11 @@ export function cache(source) {
|
|
|
959
1046
|
break;
|
|
960
1047
|
}
|
|
961
1048
|
}
|
|
962
|
-
enumeratorR =
|
|
1049
|
+
enumeratorR = undefined;
|
|
963
1050
|
});
|
|
964
1051
|
}, unfold((i_1) => Operators_Lock(prefix, () => {
|
|
965
1052
|
if (i_1 < prefix.length) {
|
|
966
|
-
return [
|
|
1053
|
+
return [item_1(i_1, prefix), i_1 + 1];
|
|
967
1054
|
}
|
|
968
1055
|
else {
|
|
969
1056
|
if (i_1 >= prefix.length) {
|
|
@@ -972,7 +1059,7 @@ export function cache(source) {
|
|
|
972
1059
|
optEnumerator_2 = value_1(enumeratorR);
|
|
973
1060
|
}
|
|
974
1061
|
else {
|
|
975
|
-
const optEnumerator = getEnumerator(
|
|
1062
|
+
const optEnumerator = getEnumerator(source_1);
|
|
976
1063
|
enumeratorR = some(optEnumerator);
|
|
977
1064
|
optEnumerator_2 = optEnumerator;
|
|
978
1065
|
}
|
|
@@ -985,15 +1072,15 @@ export function cache(source) {
|
|
|
985
1072
|
}
|
|
986
1073
|
else {
|
|
987
1074
|
disposeSafe(enumerator);
|
|
988
|
-
enumeratorR = some(
|
|
1075
|
+
enumeratorR = some(undefined);
|
|
989
1076
|
}
|
|
990
1077
|
}
|
|
991
1078
|
}
|
|
992
1079
|
if (i_1 < prefix.length) {
|
|
993
|
-
return [
|
|
1080
|
+
return [item_1(i_1, prefix), i_1 + 1];
|
|
994
1081
|
}
|
|
995
1082
|
else {
|
|
996
|
-
return
|
|
1083
|
+
return undefined;
|
|
997
1084
|
}
|
|
998
1085
|
}
|
|
999
1086
|
}), 0));
|
|
@@ -1013,7 +1100,7 @@ export function mapFoldBack(mapping, xs, state) {
|
|
|
1013
1100
|
export function tryPick(chooser, xs) {
|
|
1014
1101
|
const e = ofSeq(xs);
|
|
1015
1102
|
try {
|
|
1016
|
-
let res =
|
|
1103
|
+
let res = undefined;
|
|
1017
1104
|
while ((res == null) && e["System.Collections.IEnumerator.MoveNext"]()) {
|
|
1018
1105
|
res = chooser(e["System.Collections.Generic.IEnumerator`1.get_Current"]());
|
|
1019
1106
|
}
|
|
@@ -1052,7 +1139,7 @@ export function reduce(folder, xs) {
|
|
|
1052
1139
|
return loop(e["System.Collections.Generic.IEnumerator`1.get_Current"]());
|
|
1053
1140
|
}
|
|
1054
1141
|
else {
|
|
1055
|
-
throw new
|
|
1142
|
+
throw new Exception(SR_inputSequenceEmpty);
|
|
1056
1143
|
}
|
|
1057
1144
|
}
|
|
1058
1145
|
finally {
|
|
@@ -1065,7 +1152,7 @@ export function reduceBack(folder, xs) {
|
|
|
1065
1152
|
return arr.reduceRight(folder);
|
|
1066
1153
|
}
|
|
1067
1154
|
else {
|
|
1068
|
-
throw new
|
|
1155
|
+
throw new Exception(SR_inputSequenceEmpty);
|
|
1069
1156
|
}
|
|
1070
1157
|
}
|
|
1071
1158
|
export function replicate(n, x) {
|
|
@@ -1092,7 +1179,7 @@ export function skip(count, source) {
|
|
|
1092
1179
|
try {
|
|
1093
1180
|
for (let _ = 1; _ <= count; _++) {
|
|
1094
1181
|
if (!e["System.Collections.IEnumerator.MoveNext"]()) {
|
|
1095
|
-
throw new
|
|
1182
|
+
throw new Exception(SR_notEnoughElements + " (Parameter \'source\')");
|
|
1096
1183
|
}
|
|
1097
1184
|
}
|
|
1098
1185
|
return Enumerator_enumerateThenFinally(() => {
|
|
@@ -1125,23 +1212,23 @@ export function take(count, xs) {
|
|
|
1125
1212
|
return some(e["System.Collections.Generic.IEnumerator`1.get_Current"]());
|
|
1126
1213
|
}
|
|
1127
1214
|
else {
|
|
1128
|
-
throw new
|
|
1215
|
+
throw new Exception(SR_notEnoughElements + " (Parameter \'source\')");
|
|
1129
1216
|
}
|
|
1130
1217
|
}
|
|
1131
1218
|
else {
|
|
1132
|
-
return
|
|
1219
|
+
return undefined;
|
|
1133
1220
|
}
|
|
1134
1221
|
}, (e_1) => {
|
|
1135
1222
|
disposeSafe(e_1);
|
|
1136
1223
|
});
|
|
1137
1224
|
}
|
|
1138
1225
|
export function takeWhile(predicate, xs) {
|
|
1139
|
-
return generate(() => ofSeq(xs), (e) => ((e["System.Collections.IEnumerator.MoveNext"]() && predicate(e["System.Collections.Generic.IEnumerator`1.get_Current"]())) ? some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()) :
|
|
1226
|
+
return generate(() => ofSeq(xs), (e) => ((e["System.Collections.IEnumerator.MoveNext"]() && predicate(e["System.Collections.Generic.IEnumerator`1.get_Current"]())) ? some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()) : undefined), (e_1) => {
|
|
1140
1227
|
disposeSafe(e_1);
|
|
1141
1228
|
});
|
|
1142
1229
|
}
|
|
1143
1230
|
export function truncate(count, xs) {
|
|
1144
|
-
return generateIndexed(() => ofSeq(xs), (i, e) => (((i < count) && e["System.Collections.IEnumerator.MoveNext"]()) ? some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()) :
|
|
1231
|
+
return generateIndexed(() => ofSeq(xs), (i, e) => (((i < count) && e["System.Collections.IEnumerator.MoveNext"]()) ? some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()) : undefined), (e_1) => {
|
|
1145
1232
|
disposeSafe(e_1);
|
|
1146
1233
|
});
|
|
1147
1234
|
}
|
|
@@ -1177,16 +1264,16 @@ export function sortWith(comparer, xs) {
|
|
|
1177
1264
|
});
|
|
1178
1265
|
}
|
|
1179
1266
|
export function sort(xs, comparer) {
|
|
1180
|
-
return sortWith((x, y) => comparer.Compare(x, y), xs);
|
|
1267
|
+
return sortWith((x, y) => (comparer.Compare(x, y) | 0), xs);
|
|
1181
1268
|
}
|
|
1182
1269
|
export function sortBy(projection, xs, comparer) {
|
|
1183
|
-
return sortWith((x, y) => comparer.Compare(projection(x), projection(y)), xs);
|
|
1270
|
+
return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) | 0), xs);
|
|
1184
1271
|
}
|
|
1185
1272
|
export function sortDescending(xs, comparer) {
|
|
1186
|
-
return sortWith((x, y) => (comparer.Compare(x, y) * -1), xs);
|
|
1273
|
+
return sortWith((x, y) => ((comparer.Compare(x, y) * -1) | 0), xs);
|
|
1187
1274
|
}
|
|
1188
1275
|
export function sortByDescending(projection, xs, comparer) {
|
|
1189
|
-
return sortWith((x, y) => (comparer.Compare(projection(x), projection(y)) * -1), xs);
|
|
1276
|
+
return sortWith((x, y) => ((comparer.Compare(projection(x), projection(y)) * -1) | 0), xs);
|
|
1190
1277
|
}
|
|
1191
1278
|
export function sum(xs, adder) {
|
|
1192
1279
|
return fold((acc, x) => adder.Add(acc, x), adder.GetZero(), xs);
|
|
@@ -1213,7 +1300,7 @@ export function average(xs, averager) {
|
|
|
1213
1300
|
return averager.Add(acc, x);
|
|
1214
1301
|
}, averager.GetZero(), xs);
|
|
1215
1302
|
if (count === 0) {
|
|
1216
|
-
throw new
|
|
1303
|
+
throw new Exception(SR_inputSequenceEmpty + " (Parameter \'source\')");
|
|
1217
1304
|
}
|
|
1218
1305
|
else {
|
|
1219
1306
|
return averager.DivideByInt(total, count);
|
|
@@ -1226,7 +1313,7 @@ export function averageBy(f, xs, averager) {
|
|
|
1226
1313
|
return averager.Add(acc, f(x));
|
|
1227
1314
|
}, averager.GetZero(), xs);
|
|
1228
1315
|
if (count === 0) {
|
|
1229
|
-
throw new
|
|
1316
|
+
throw new Exception(SR_inputSequenceEmpty + " (Parameter \'source\')");
|
|
1230
1317
|
}
|
|
1231
1318
|
else {
|
|
1232
1319
|
return averager.DivideByInt(total, count);
|
|
@@ -1241,7 +1328,7 @@ export function chunkBySize(chunkSize, xs) {
|
|
|
1241
1328
|
export function insertAt(index, y, xs) {
|
|
1242
1329
|
let isDone = false;
|
|
1243
1330
|
if (index < 0) {
|
|
1244
|
-
throw new
|
|
1331
|
+
throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
|
|
1245
1332
|
}
|
|
1246
1333
|
return generateIndexed(() => ofSeq(xs), (i, e) => {
|
|
1247
1334
|
if ((isDone ? true : (i < index)) && e["System.Collections.IEnumerator.MoveNext"]()) {
|
|
@@ -1253,9 +1340,9 @@ export function insertAt(index, y, xs) {
|
|
|
1253
1340
|
}
|
|
1254
1341
|
else {
|
|
1255
1342
|
if (!isDone) {
|
|
1256
|
-
throw new
|
|
1343
|
+
throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
|
|
1257
1344
|
}
|
|
1258
|
-
return
|
|
1345
|
+
return undefined;
|
|
1259
1346
|
}
|
|
1260
1347
|
}, (e_1) => {
|
|
1261
1348
|
disposeSafe(e_1);
|
|
@@ -1264,7 +1351,7 @@ export function insertAt(index, y, xs) {
|
|
|
1264
1351
|
export function insertManyAt(index, ys, xs) {
|
|
1265
1352
|
let status = -1;
|
|
1266
1353
|
if (index < 0) {
|
|
1267
|
-
throw new
|
|
1354
|
+
throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
|
|
1268
1355
|
}
|
|
1269
1356
|
return generateIndexed(() => [ofSeq(xs), ofSeq(ys)], (i, tupledArg) => {
|
|
1270
1357
|
const e1 = tupledArg[0];
|
|
@@ -1279,11 +1366,11 @@ export function insertManyAt(index, ys, xs) {
|
|
|
1279
1366
|
}
|
|
1280
1367
|
else {
|
|
1281
1368
|
status = 1;
|
|
1282
|
-
inserted =
|
|
1369
|
+
inserted = undefined;
|
|
1283
1370
|
}
|
|
1284
1371
|
}
|
|
1285
1372
|
else {
|
|
1286
|
-
inserted =
|
|
1373
|
+
inserted = undefined;
|
|
1287
1374
|
}
|
|
1288
1375
|
if (inserted == null) {
|
|
1289
1376
|
if (e1["System.Collections.IEnumerator.MoveNext"]()) {
|
|
@@ -1291,9 +1378,9 @@ export function insertManyAt(index, ys, xs) {
|
|
|
1291
1378
|
}
|
|
1292
1379
|
else {
|
|
1293
1380
|
if (status < 1) {
|
|
1294
|
-
throw new
|
|
1381
|
+
throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
|
|
1295
1382
|
}
|
|
1296
|
-
return
|
|
1383
|
+
return undefined;
|
|
1297
1384
|
}
|
|
1298
1385
|
}
|
|
1299
1386
|
else {
|
|
@@ -1307,7 +1394,7 @@ export function insertManyAt(index, ys, xs) {
|
|
|
1307
1394
|
export function removeAt(index, xs) {
|
|
1308
1395
|
let isDone = false;
|
|
1309
1396
|
if (index < 0) {
|
|
1310
|
-
throw new
|
|
1397
|
+
throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
|
|
1311
1398
|
}
|
|
1312
1399
|
return generateIndexed(() => ofSeq(xs), (i, e) => {
|
|
1313
1400
|
if ((isDone ? true : (i < index)) && e["System.Collections.IEnumerator.MoveNext"]()) {
|
|
@@ -1315,13 +1402,13 @@ export function removeAt(index, xs) {
|
|
|
1315
1402
|
}
|
|
1316
1403
|
else if ((i === index) && e["System.Collections.IEnumerator.MoveNext"]()) {
|
|
1317
1404
|
isDone = true;
|
|
1318
|
-
return e["System.Collections.IEnumerator.MoveNext"]() ? some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()) :
|
|
1405
|
+
return e["System.Collections.IEnumerator.MoveNext"]() ? some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()) : undefined;
|
|
1319
1406
|
}
|
|
1320
1407
|
else {
|
|
1321
1408
|
if (!isDone) {
|
|
1322
|
-
throw new
|
|
1409
|
+
throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
|
|
1323
1410
|
}
|
|
1324
|
-
return
|
|
1411
|
+
return undefined;
|
|
1325
1412
|
}
|
|
1326
1413
|
}, (e_1) => {
|
|
1327
1414
|
disposeSafe(e_1);
|
|
@@ -1329,7 +1416,7 @@ export function removeAt(index, xs) {
|
|
|
1329
1416
|
}
|
|
1330
1417
|
export function removeManyAt(index, count, xs) {
|
|
1331
1418
|
if (index < 0) {
|
|
1332
|
-
throw new
|
|
1419
|
+
throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
|
|
1333
1420
|
}
|
|
1334
1421
|
return generateIndexed(() => ofSeq(xs), (i, e) => {
|
|
1335
1422
|
if (i < index) {
|
|
@@ -1337,18 +1424,18 @@ export function removeManyAt(index, count, xs) {
|
|
|
1337
1424
|
return some(e["System.Collections.Generic.IEnumerator`1.get_Current"]());
|
|
1338
1425
|
}
|
|
1339
1426
|
else {
|
|
1340
|
-
throw new
|
|
1427
|
+
throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
|
|
1341
1428
|
}
|
|
1342
1429
|
}
|
|
1343
1430
|
else {
|
|
1344
1431
|
if (i === index) {
|
|
1345
1432
|
for (let _ = 1; _ <= count; _++) {
|
|
1346
1433
|
if (!e["System.Collections.IEnumerator.MoveNext"]()) {
|
|
1347
|
-
throw new
|
|
1434
|
+
throw new Exception(SR_indexOutOfBounds + " (Parameter \'count\')");
|
|
1348
1435
|
}
|
|
1349
1436
|
}
|
|
1350
1437
|
}
|
|
1351
|
-
return e["System.Collections.IEnumerator.MoveNext"]() ? some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()) :
|
|
1438
|
+
return e["System.Collections.IEnumerator.MoveNext"]() ? some(e["System.Collections.Generic.IEnumerator`1.get_Current"]()) : undefined;
|
|
1352
1439
|
}
|
|
1353
1440
|
}, (e_1) => {
|
|
1354
1441
|
disposeSafe(e_1);
|
|
@@ -1357,7 +1444,7 @@ export function removeManyAt(index, count, xs) {
|
|
|
1357
1444
|
export function updateAt(index, y, xs) {
|
|
1358
1445
|
let isDone = false;
|
|
1359
1446
|
if (index < 0) {
|
|
1360
|
-
throw new
|
|
1447
|
+
throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
|
|
1361
1448
|
}
|
|
1362
1449
|
return generateIndexed(() => ofSeq(xs), (i, e) => {
|
|
1363
1450
|
if ((isDone ? true : (i < index)) && e["System.Collections.IEnumerator.MoveNext"]()) {
|
|
@@ -1369,11 +1456,49 @@ export function updateAt(index, y, xs) {
|
|
|
1369
1456
|
}
|
|
1370
1457
|
else {
|
|
1371
1458
|
if (!isDone) {
|
|
1372
|
-
throw new
|
|
1459
|
+
throw new Exception(SR_indexOutOfBounds + " (Parameter \'index\')");
|
|
1373
1460
|
}
|
|
1374
|
-
return
|
|
1461
|
+
return undefined;
|
|
1375
1462
|
}
|
|
1376
1463
|
}, (e_1) => {
|
|
1377
1464
|
disposeSafe(e_1);
|
|
1378
1465
|
});
|
|
1379
1466
|
}
|
|
1467
|
+
export function randomShuffleBy(randomizer, xs) {
|
|
1468
|
+
const arr = toArray(xs);
|
|
1469
|
+
randomShuffleInPlaceBy(randomizer, arr);
|
|
1470
|
+
return ofArray(arr);
|
|
1471
|
+
}
|
|
1472
|
+
export function randomShuffleWith(random, xs) {
|
|
1473
|
+
return randomShuffleBy(() => random.NextDouble(), xs);
|
|
1474
|
+
}
|
|
1475
|
+
export function randomShuffle(xs) {
|
|
1476
|
+
return randomShuffleWith(nonSeeded(), xs);
|
|
1477
|
+
}
|
|
1478
|
+
export function randomChoiceBy(randomizer, xs) {
|
|
1479
|
+
return randomChoiceBy_1(randomizer, toArray(xs));
|
|
1480
|
+
}
|
|
1481
|
+
export function randomChoiceWith(random, xs) {
|
|
1482
|
+
return randomChoiceWith_1(random, toArray(xs));
|
|
1483
|
+
}
|
|
1484
|
+
export function randomChoice(xs) {
|
|
1485
|
+
return randomChoice_1(toArray(xs));
|
|
1486
|
+
}
|
|
1487
|
+
export function randomChoicesBy(randomizer, count, xs) {
|
|
1488
|
+
return ofArray(randomChoicesBy_1(randomizer, count, toArray(xs)));
|
|
1489
|
+
}
|
|
1490
|
+
export function randomChoicesWith(random, count, xs) {
|
|
1491
|
+
return randomChoicesBy(() => random.NextDouble(), count, xs);
|
|
1492
|
+
}
|
|
1493
|
+
export function randomChoices(count, xs) {
|
|
1494
|
+
return randomChoicesWith(nonSeeded(), count, xs);
|
|
1495
|
+
}
|
|
1496
|
+
export function randomSampleBy(randomizer, count, xs) {
|
|
1497
|
+
return ofArray(randomSampleBy_1(randomizer, count, toArray(xs)));
|
|
1498
|
+
}
|
|
1499
|
+
export function randomSampleWith(random, count, xs) {
|
|
1500
|
+
return randomSampleBy(() => random.NextDouble(), count, xs);
|
|
1501
|
+
}
|
|
1502
|
+
export function randomSample(count, xs) {
|
|
1503
|
+
return randomSampleWith(nonSeeded(), count, xs);
|
|
1504
|
+
}
|