@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
package/dist/fable_modules/{fable-library-js.4.14.0 → fable-library-js.5.17.2}/Reflection.js
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Record, Union } from "./Types.js";
|
|
2
|
-
import { combineHashCodes, equalArraysWith, stringHash } from "./Util.js";
|
|
2
|
+
import { Exception, combineHashCodes, equalArraysWith, stringHash } from "./Util.js";
|
|
3
3
|
import Decimal from "./Decimal.js";
|
|
4
|
+
import { Some, some } from "./Option.js";
|
|
4
5
|
export class CaseInfo {
|
|
5
6
|
constructor(declaringType, tag, name, fields) {
|
|
6
7
|
this.declaringType = declaringType;
|
|
@@ -85,10 +86,18 @@ export function lambda_type(argType, returnType) {
|
|
|
85
86
|
return new TypeInfo("Microsoft.FSharp.Core.FSharpFunc`2", [argType, returnType]);
|
|
86
87
|
}
|
|
87
88
|
export function option_type(generic) {
|
|
88
|
-
|
|
89
|
+
const t = new TypeInfo("Microsoft.FSharp.Core.FSharpOption`1", [generic], undefined, undefined, undefined, () => [
|
|
90
|
+
new CaseInfo(t, 0, "None"),
|
|
91
|
+
new CaseInfo(t, 1, "Some", [["value", generic]])
|
|
92
|
+
]);
|
|
93
|
+
return t;
|
|
89
94
|
}
|
|
90
95
|
export function list_type(generic) {
|
|
91
|
-
|
|
96
|
+
const t = new TypeInfo("Microsoft.FSharp.Collections.FSharpList`1", [generic], undefined, undefined, undefined, () => [
|
|
97
|
+
new CaseInfo(t, 0, "Empty"),
|
|
98
|
+
new CaseInfo(t, 1, "Cons", [["Head", generic], ["Tail", t]])
|
|
99
|
+
]);
|
|
100
|
+
return t;
|
|
92
101
|
}
|
|
93
102
|
export function array_type(generic) {
|
|
94
103
|
return new TypeInfo("[]", [generic]);
|
|
@@ -135,7 +144,7 @@ export function name(info) {
|
|
|
135
144
|
}
|
|
136
145
|
else {
|
|
137
146
|
const i = info.fullname.lastIndexOf(".");
|
|
138
|
-
return i === -1 ? info.fullname : info.fullname.
|
|
147
|
+
return i === -1 ? info.fullname : info.fullname.slice(i + 1);
|
|
139
148
|
}
|
|
140
149
|
}
|
|
141
150
|
else {
|
|
@@ -161,7 +170,7 @@ export function namespace(t) {
|
|
|
161
170
|
}
|
|
162
171
|
else {
|
|
163
172
|
const i = t.fullname.lastIndexOf(".");
|
|
164
|
-
return i === -1 ? "" : t.fullname.
|
|
173
|
+
return i === -1 ? "" : t.fullname.slice(0, i);
|
|
165
174
|
}
|
|
166
175
|
}
|
|
167
176
|
export function isArray(t) {
|
|
@@ -239,7 +248,7 @@ export function getEnumValues(t) {
|
|
|
239
248
|
return t.enumCases.map((kv) => kv[1]);
|
|
240
249
|
}
|
|
241
250
|
else {
|
|
242
|
-
throw new
|
|
251
|
+
throw new Exception(`${t.fullname} is not an enum type`);
|
|
243
252
|
}
|
|
244
253
|
}
|
|
245
254
|
export function getEnumNames(t) {
|
|
@@ -247,7 +256,7 @@ export function getEnumNames(t) {
|
|
|
247
256
|
return t.enumCases.map((kv) => kv[0]);
|
|
248
257
|
}
|
|
249
258
|
else {
|
|
250
|
-
throw new
|
|
259
|
+
throw new Exception(`${t.fullname} is not an enum type`);
|
|
251
260
|
}
|
|
252
261
|
}
|
|
253
262
|
function getEnumCase(t, v) {
|
|
@@ -258,7 +267,7 @@ function getEnumCase(t, v) {
|
|
|
258
267
|
return kv;
|
|
259
268
|
}
|
|
260
269
|
}
|
|
261
|
-
throw new
|
|
270
|
+
throw new Exception(`'${v}' was not found in ${t.fullname}`);
|
|
262
271
|
}
|
|
263
272
|
else {
|
|
264
273
|
for (const kv of t.enumCases) {
|
|
@@ -271,7 +280,7 @@ function getEnumCase(t, v) {
|
|
|
271
280
|
}
|
|
272
281
|
}
|
|
273
282
|
else {
|
|
274
|
-
throw new
|
|
283
|
+
throw new Exception(`${t.fullname} is not an enum type`);
|
|
275
284
|
}
|
|
276
285
|
}
|
|
277
286
|
export function parseEnum(t, str) {
|
|
@@ -307,7 +316,7 @@ export function getUnionCases(t) {
|
|
|
307
316
|
return t.cases();
|
|
308
317
|
}
|
|
309
318
|
else {
|
|
310
|
-
throw new
|
|
319
|
+
throw new Exception(`${t.fullname} is not an F# union type`);
|
|
311
320
|
}
|
|
312
321
|
}
|
|
313
322
|
export function getRecordElements(t) {
|
|
@@ -315,7 +324,7 @@ export function getRecordElements(t) {
|
|
|
315
324
|
return t.fields();
|
|
316
325
|
}
|
|
317
326
|
else {
|
|
318
|
-
throw new
|
|
327
|
+
throw new Exception(`${t.fullname} is not an F# record type`);
|
|
319
328
|
}
|
|
320
329
|
}
|
|
321
330
|
export function getTupleElements(t) {
|
|
@@ -323,7 +332,7 @@ export function getTupleElements(t) {
|
|
|
323
332
|
return t.generics;
|
|
324
333
|
}
|
|
325
334
|
else {
|
|
326
|
-
throw new
|
|
335
|
+
throw new Exception(`${t.fullname} is not a tuple type`);
|
|
327
336
|
}
|
|
328
337
|
}
|
|
329
338
|
export function getFunctionElements(t) {
|
|
@@ -332,7 +341,7 @@ export function getFunctionElements(t) {
|
|
|
332
341
|
return [gen[0], gen[1]];
|
|
333
342
|
}
|
|
334
343
|
else {
|
|
335
|
-
throw new
|
|
344
|
+
throw new Exception(`${t.fullname} is not an F# function type`);
|
|
336
345
|
}
|
|
337
346
|
}
|
|
338
347
|
export function isUnion(t) {
|
|
@@ -351,9 +360,19 @@ export function isFunction(t) {
|
|
|
351
360
|
// FSharpValue
|
|
352
361
|
export function getUnionFields(v, t) {
|
|
353
362
|
const cases = getUnionCases(t);
|
|
363
|
+
// Special handling for option types (None is undefined, Some is the value or a Some wrapper)
|
|
364
|
+
if (t.fullname === "Microsoft.FSharp.Core.FSharpOption`1") {
|
|
365
|
+
if (v == null) {
|
|
366
|
+
return [cases[0], []]; // None case
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
const innerValue = v instanceof Some ? v.value : v;
|
|
370
|
+
return [cases[1], [innerValue]]; // Some case
|
|
371
|
+
}
|
|
372
|
+
}
|
|
354
373
|
const case_ = cases[v.tag];
|
|
355
374
|
if (case_ == null) {
|
|
356
|
-
throw new
|
|
375
|
+
throw new Exception(`Cannot find case ${v.name} in union type`);
|
|
357
376
|
}
|
|
358
377
|
return [case_, v.fields];
|
|
359
378
|
}
|
|
@@ -362,8 +381,14 @@ export function getUnionCaseFields(uci) {
|
|
|
362
381
|
}
|
|
363
382
|
// This is used as replacement of `FSharpValue.GetRecordFields`
|
|
364
383
|
// For `FSharpTypes.GetRecordFields` see `getRecordElements`
|
|
365
|
-
//
|
|
366
|
-
|
|
384
|
+
// TypeInfo is used when available to enumerate fields by name: anonymous record None fields
|
|
385
|
+
// are omitted from the JS object, so Object.keys alone would miss them.
|
|
386
|
+
// Boxed anonymous record would are still not covered but this is the best we can do for now
|
|
387
|
+
// without adding a __fields__ to every anonymous record being created
|
|
388
|
+
export function getRecordFields(v, t) {
|
|
389
|
+
if (t.fields != null) {
|
|
390
|
+
return t.fields().map(([key, _]) => v[key]);
|
|
391
|
+
}
|
|
367
392
|
return Object.keys(v).map((k) => v[k]);
|
|
368
393
|
}
|
|
369
394
|
export function getRecordField(v, field) {
|
|
@@ -378,7 +403,11 @@ export function getTupleField(v, i) {
|
|
|
378
403
|
export function makeUnion(uci, values) {
|
|
379
404
|
const expectedLength = (uci.fields || []).length;
|
|
380
405
|
if (values.length !== expectedLength) {
|
|
381
|
-
throw new
|
|
406
|
+
throw new Exception(`Expected an array of length ${expectedLength} but got ${values.length}`);
|
|
407
|
+
}
|
|
408
|
+
// Special handling for option types
|
|
409
|
+
if (uci.declaringType.fullname === "Microsoft.FSharp.Core.FSharpOption`1") {
|
|
410
|
+
return uci.tag === 0 ? undefined : some(values[0]);
|
|
382
411
|
}
|
|
383
412
|
const construct = uci.declaringType.construct;
|
|
384
413
|
if (construct == null) {
|
|
@@ -395,7 +424,7 @@ export function makeUnion(uci, values) {
|
|
|
395
424
|
export function makeRecord(t, values) {
|
|
396
425
|
const fields = getRecordElements(t);
|
|
397
426
|
if (fields.length !== values.length) {
|
|
398
|
-
throw new
|
|
427
|
+
throw new Exception(`Expected an array of length ${fields.length} but got ${values.length}`);
|
|
399
428
|
}
|
|
400
429
|
return t.construct != null
|
|
401
430
|
? new t.construct(...values)
|
|
@@ -431,10 +460,9 @@ export function createInstance(t, consArgs) {
|
|
|
431
460
|
case decimal_type.fullname:
|
|
432
461
|
return new Decimal(0);
|
|
433
462
|
case char_type.fullname:
|
|
434
|
-
|
|
435
|
-
return null;
|
|
463
|
+
return "\0";
|
|
436
464
|
default:
|
|
437
|
-
throw new
|
|
465
|
+
throw new Exception(`Cannot access constructor of ${t.fullname}`);
|
|
438
466
|
}
|
|
439
467
|
}
|
|
440
468
|
}
|
|
@@ -444,7 +472,7 @@ export function getValue(propertyInfo, v) {
|
|
|
444
472
|
// Fable.Core.Reflection
|
|
445
473
|
function assertUnion(x) {
|
|
446
474
|
if (!(x instanceof Union)) {
|
|
447
|
-
throw new
|
|
475
|
+
throw new Exception(`Value is not an F# union type`);
|
|
448
476
|
}
|
|
449
477
|
}
|
|
450
478
|
export function getCaseTag(x) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Exception } from "./Util.js";
|
|
1
2
|
export function create(pattern, options = 0) {
|
|
2
3
|
// Supported RegexOptions
|
|
3
4
|
// * IgnoreCase: 0x0001
|
|
@@ -6,7 +7,7 @@ export function create(pattern, options = 0) {
|
|
|
6
7
|
// * Singleline: 0x0010
|
|
7
8
|
// * ECMAScript: 0x0100 (ignored)
|
|
8
9
|
if ((options & ~(1 ^ 2 ^ 8 ^ 16 ^ 256)) !== 0) {
|
|
9
|
-
throw new
|
|
10
|
+
throw new Exception("RegexOptions only supports: IgnoreCase, Multiline, Compiled, Singleline and ECMAScript");
|
|
10
11
|
}
|
|
11
12
|
// Set always global and unicode flags for compatibility with dotnet, see #2925
|
|
12
13
|
let flags = "gu";
|
|
@@ -17,10 +18,19 @@ export function create(pattern, options = 0) {
|
|
|
17
18
|
}
|
|
18
19
|
// From http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
|
|
19
20
|
export function escape(str) {
|
|
20
|
-
|
|
21
|
+
// Matches the characters escaped by .NET's Regex.Escape.
|
|
22
|
+
// Note:
|
|
23
|
+
//
|
|
24
|
+
// .NET also escapes space and # (relevant for IgnorePatternWhitespace mode),
|
|
25
|
+
// but JS unicode-mode regex rejects \ and \# as invalid escapes, and we don't
|
|
26
|
+
// support IgnorePatternWhitespace, so we omit them.
|
|
27
|
+
//
|
|
28
|
+
// .NET does not escape ] and } but JS unicode-mode regex rejects bare ] and }
|
|
29
|
+
// as invalid, so we escape them too for compatibility.
|
|
30
|
+
return str.replace(/[$()*+.?[\\\^{|}\]]/g, "\\$&");
|
|
21
31
|
}
|
|
22
32
|
export function unescape(str) {
|
|
23
|
-
return str.replace(/\\([
|
|
33
|
+
return str.replace(/\\([$()*+.?[\\\^{|}\]])/g, "$1");
|
|
24
34
|
}
|
|
25
35
|
export function isMatch(reg, input, startAt = 0) {
|
|
26
36
|
reg.lastIndex = startAt;
|
|
@@ -32,16 +42,15 @@ export function match(reg, input, startAt = 0) {
|
|
|
32
42
|
}
|
|
33
43
|
export function matches(reg, input, startAt = 0) {
|
|
34
44
|
if (input == null) {
|
|
35
|
-
throw new
|
|
45
|
+
throw new Exception("Input cannot ve null");
|
|
36
46
|
}
|
|
37
47
|
if (!reg.global) {
|
|
38
|
-
throw new
|
|
48
|
+
throw new Exception("Non-global RegExp"); // Prevent infinite loop
|
|
39
49
|
}
|
|
40
50
|
reg.lastIndex = startAt;
|
|
41
51
|
const matches = [];
|
|
42
52
|
let m;
|
|
43
53
|
let lastMatchIndex = -1;
|
|
44
|
-
// tslint:disable-next-line:no-conditional-assignment
|
|
45
54
|
while ((m = reg.exec(input)) != null) {
|
|
46
55
|
// It can happen even global regex get stuck, see #2845
|
|
47
56
|
if (m.index === lastMatchIndex) {
|
|
@@ -96,29 +105,38 @@ export function replace(reg, input, replacement, limit, offset = 0) {
|
|
|
96
105
|
input = tmp;
|
|
97
106
|
limit = undefined;
|
|
98
107
|
}
|
|
99
|
-
if (typeof replacement === "
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
108
|
+
if (typeof replacement === "string") {
|
|
109
|
+
const rep = replacement;
|
|
110
|
+
// .NET replacement patterns cannot be rewritten as JS replacement strings unambiguously
|
|
111
|
+
// (e.g. `$$0` must stay literal "$0", `$0` doesn't work with JS regex (see #1155), and
|
|
112
|
+
// `${1}` followed by a digit must not become `$1` + digit), so interpret them with an
|
|
113
|
+
// evaluator instead, honoring the `$$` escape left-to-right
|
|
114
|
+
replacement = (match) => rep.replace(/\$(?:(\$)|(&)|(`)|(')|(\d+)|\{(\d+)\}|\{([^}]+)\})/g, (s, dollar, and, before, after, num, numBraced, name) => {
|
|
115
|
+
if (dollar != null) {
|
|
116
|
+
return "$";
|
|
117
|
+
}
|
|
118
|
+
if (and != null) {
|
|
119
|
+
return match[0];
|
|
120
|
+
}
|
|
121
|
+
if (before != null) {
|
|
122
|
+
return match.input.substring(0, match.index);
|
|
123
|
+
}
|
|
124
|
+
if (after != null) {
|
|
125
|
+
return match.input.substring(match.index + match[0].length);
|
|
126
|
+
}
|
|
127
|
+
const n = num ?? numBraced;
|
|
128
|
+
if (n != null) {
|
|
129
|
+
const i = parseInt(n, 10);
|
|
130
|
+
// Same as .NET: an unmatched group is replaced by an empty string,
|
|
131
|
+
// a nonexistent group number keeps the substitution pattern literally
|
|
132
|
+
return i < match.length ? (match[i] ?? "") : s;
|
|
133
|
+
}
|
|
134
|
+
// Named groups are `${name}` in .NET (in regex: groups are `(?<name>...)` in both)
|
|
135
|
+
return match.groups != null && name in match.groups ? (match.groups[name] ?? "") : s;
|
|
136
|
+
});
|
|
121
137
|
}
|
|
138
|
+
limit = limit == null ? -1 : limit;
|
|
139
|
+
return input.substring(0, offset) + input.substring(offset).replace(reg, replacer);
|
|
122
140
|
}
|
|
123
141
|
export function split(reg, input, limit, offset = 0) {
|
|
124
142
|
if (typeof reg === "string") {
|
|
@@ -127,6 +145,26 @@ export function split(reg, input, limit, offset = 0) {
|
|
|
127
145
|
input = tmp;
|
|
128
146
|
limit = undefined;
|
|
129
147
|
}
|
|
130
|
-
|
|
131
|
-
|
|
148
|
+
// JS String.split(regex, limit) truncates the result and discards the remainder,
|
|
149
|
+
// whereas .NET keeps it in the last element (`limit` is the max number of elements),
|
|
150
|
+
// keeps the text before `offset` in the first element and includes the values of
|
|
151
|
+
// matched capture groups, so iterate the matches manually like .NET Regex.Split does
|
|
152
|
+
const result = [];
|
|
153
|
+
let prev = 0;
|
|
154
|
+
let count = limit == null ? -1 : limit - 1;
|
|
155
|
+
for (const m of matches(reg, input, offset)) {
|
|
156
|
+
if (count === 0) {
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
result.push(input.substring(prev, m.index));
|
|
160
|
+
prev = m.index + m[0].length;
|
|
161
|
+
for (let i = 1; i < m.length; i++) {
|
|
162
|
+
if (m[i] !== undefined) {
|
|
163
|
+
result.push(m[i]);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
count--;
|
|
167
|
+
}
|
|
168
|
+
result.push(input.substring(prev));
|
|
169
|
+
return result;
|
|
132
170
|
}
|
|
@@ -6,7 +6,7 @@ import { some } from "./Option.js";
|
|
|
6
6
|
export function FSharpResult$2_Ok(ResultValue) {
|
|
7
7
|
return new FSharpResult$2(0, [ResultValue]);
|
|
8
8
|
}
|
|
9
|
-
export function FSharpResult$2_Error(ErrorValue) {
|
|
9
|
+
export function FSharpResult$2_Error$(ErrorValue) {
|
|
10
10
|
return new FSharpResult$2(1, [ErrorValue]);
|
|
11
11
|
}
|
|
12
12
|
export class FSharpResult$2 extends Union {
|
|
@@ -27,7 +27,7 @@ export function Result_Map(mapping, result) {
|
|
|
27
27
|
return FSharpResult$2_Ok(mapping(result.fields[0]));
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
|
-
return FSharpResult$2_Error(result.fields[0]);
|
|
30
|
+
return FSharpResult$2_Error$(result.fields[0]);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
export function Result_MapError(mapping, result) {
|
|
@@ -35,7 +35,7 @@ export function Result_MapError(mapping, result) {
|
|
|
35
35
|
return FSharpResult$2_Ok(result.fields[0]);
|
|
36
36
|
}
|
|
37
37
|
else {
|
|
38
|
-
return FSharpResult$2_Error(mapping(result.fields[0]));
|
|
38
|
+
return FSharpResult$2_Error$(mapping(result.fields[0]));
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
export function Result_Bind(binder, result) {
|
|
@@ -43,7 +43,7 @@ export function Result_Bind(binder, result) {
|
|
|
43
43
|
return binder(result.fields[0]);
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
|
-
return FSharpResult$2_Error(result.fields[0]);
|
|
46
|
+
return FSharpResult$2_Error$(result.fields[0]);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
export function Result_IsOk(result) {
|
|
@@ -152,7 +152,7 @@ export function Result_ToOption(result) {
|
|
|
152
152
|
return some(result.fields[0]);
|
|
153
153
|
}
|
|
154
154
|
else {
|
|
155
|
-
return
|
|
155
|
+
return undefined;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
export function Result_ToValueOption(result) {
|
|
@@ -160,6 +160,6 @@ export function Result_ToValueOption(result) {
|
|
|
160
160
|
return some(result.fields[0]);
|
|
161
161
|
}
|
|
162
162
|
else {
|
|
163
|
-
return
|
|
163
|
+
return undefined;
|
|
164
164
|
}
|
|
165
165
|
}
|