@glutinum/cli 1.0.0-beta.10 → 1.0.0-beta.12
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/dist/Glutinum.Converter/Abbreviations.js +7 -7
- package/dist/Glutinum.Converter/DelegateExtensions.js +7 -7
- package/dist/Glutinum.Converter/FreeTypeParameters.js +4 -4
- package/dist/Glutinum.Converter/FsharpAST.js +3 -3
- package/dist/Glutinum.Converter/Generate.js +19 -6
- package/dist/Glutinum.Converter/GlueAST.js +8 -8
- package/dist/Glutinum.Converter/Hosting.js +11 -11
- package/dist/Glutinum.Converter/Merge.js +103 -27
- package/dist/Glutinum.Converter/Packages.js +11 -11
- package/dist/Glutinum.Converter/Printer.js +23 -11
- package/dist/Glutinum.Converter/Read.js +9 -9
- package/dist/Glutinum.Converter/Reader/ClassDeclaration.js +4 -4
- package/dist/Glutinum.Converter/Reader/ConditionalTypeNode.js +3 -3
- package/dist/Glutinum.Converter/Reader/Declaration.js +7 -7
- package/dist/Glutinum.Converter/Reader/Deferred.js +8 -8
- package/dist/Glutinum.Converter/Reader/Documentation.js +6 -6
- package/dist/Glutinum.Converter/Reader/EnumDeclaration.js +2 -2
- package/dist/Glutinum.Converter/Reader/ExportAssignment.js +6 -6
- package/dist/Glutinum.Converter/Reader/ExportDeclaration.js +4 -4
- package/dist/Glutinum.Converter/Reader/ExpressionWithTypeArguments.js +5 -5
- package/dist/Glutinum.Converter/Reader/FunctionDeclaration.js +4 -4
- package/dist/Glutinum.Converter/Reader/IndexedAccessType.js +1 -1
- package/dist/Glutinum.Converter/Reader/InterfaceDeclaration.js +5 -5
- package/dist/Glutinum.Converter/Reader/IntersectionTypeNode.js +5 -5
- package/dist/Glutinum.Converter/Reader/MappedTypeNode.js +4 -4
- package/dist/Glutinum.Converter/Reader/MemberTypes.js +5 -5
- package/dist/Glutinum.Converter/Reader/ModuleDeclaration.js +4 -4
- package/dist/Glutinum.Converter/Reader/Node.js +4 -4
- package/dist/Glutinum.Converter/Reader/Parameters.js +3 -3
- package/dist/Glutinum.Converter/Reader/Report.js +4 -4
- package/dist/Glutinum.Converter/Reader/TypeNode.js +9 -9
- package/dist/Glutinum.Converter/Reader/TypeOperatorNode.js +6 -6
- package/dist/Glutinum.Converter/Reader/TypeParameters.js +2 -2
- package/dist/Glutinum.Converter/Reader/TypeQueryNode.js +10 -10
- package/dist/Glutinum.Converter/Reader/TypeScriptReader.js +4 -4
- package/dist/Glutinum.Converter/Reader/Types.js +10 -10
- package/dist/Glutinum.Converter/Reader/UnionTypeNode.js +4 -4
- package/dist/Glutinum.Converter/Reader/UtilityType.js +8 -8
- package/dist/Glutinum.Converter/Reader/Utils.js +14 -14
- package/dist/Glutinum.Converter/Reader/VariableStatement.js +5 -5
- package/dist/Glutinum.Converter/Transform.js +262 -42
- package/dist/Glutinum.Converter/Transformer/AnyFunctionOverloads.js +5 -5
- package/dist/Glutinum.Converter/Transformer/CallableProperties.js +3 -3
- package/dist/Glutinum.Converter/Transformer/Comment.js +7 -7
- package/dist/Glutinum.Converter/Transformer/Conditionals.js +10 -10
- package/dist/Glutinum.Converter/Transformer/Context.js +11 -11
- package/dist/Glutinum.Converter/Transformer/Enum.js +5 -5
- package/dist/Glutinum.Converter/Transformer/Exports.js +11 -11
- package/dist/Glutinum.Converter/Transformer/Heritage.js +8 -8
- package/dist/Glutinum.Converter/Transformer/KeyOfMaps.js +9 -9
- package/dist/Glutinum.Converter/Transformer/ParamObjectCandidate.js +7 -7
- package/dist/Glutinum.Converter/Transformer/TypeParameter.js +5 -5
- package/dist/Glutinum.Converter/Transformer/TypeParameters.js +6 -6
- package/dist/Glutinum.Converter/Transformer/UnionOverloads.js +7 -25
- package/dist/Glutinum.Converter/Transformer/Utils.js +6 -6
- package/dist/Glutinum.Converter/Utils/Keywords.js +3 -3
- package/dist/Glutinum.Converter/Utils/List.js +2 -2
- package/dist/Glutinum.Converter/Utils/Naming.js +6 -6
- package/dist/Glutinum.Converter/Utils/String.js +3 -3
- package/dist/Program.js +7 -7
- package/dist/fable_modules/Fable.Promise.3.2.1/AsyncIterable.fs.js +2 -2
- package/dist/fable_modules/Fable.Promise.3.2.1/Promise.fs.js +4 -4
- package/dist/fable_modules/Fable.Promise.3.2.1/PromiseImpl.fs.js +2 -2
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Array.fs.js +5 -5
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Async.fs.js +4 -4
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncOptionCE.fs.js +3 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultCE.fs.js +1 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultOption.fs.js +3 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncResultOptionCE.fs.js +1 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/AsyncValidationCE.fs.js +1 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/List.fs.js +4 -4
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/OptionCE.fs.js +1 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResult.fs.js +3 -3
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncResultCE.fs.js +1 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ParallelAsyncValidationCE.fs.js +1 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Result.fs.js +1 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ResultCE.fs.js +2 -2
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ResultOption.fs.js +2 -2
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ResultOptionCE.fs.js +1 -1
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/Seq.fs.js +7 -7
- package/dist/fable_modules/FsToolkit.ErrorHandling.5.2.0/ValidationCE.fs.js +1 -1
- package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Async.js +21 -7
- package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/AsyncBuilder.js +51 -6
- package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/CHANGELOG.md +23 -1
- package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/CollectionUtil.js +10 -16
- package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/MailboxProcessor.js +19 -3
- package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/MutableMap.js +5 -1
- package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/MutableSet.js +5 -1
- package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Util.js +15 -3
- package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/package.json +1 -1
- package/package.json +1 -1
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Array.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/BigInt.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/BitConverter.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Boolean.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Char.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Choice.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/ConditionalWeakTable.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Date.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/DateOffset.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/DateOnly.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/DateOnlyTemporal.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/DateTimeFormat.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/DateTimeOffsetTemporal.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/DateTimeTemporal.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Decimal.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Directory.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Double.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Encoding.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Environment.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Event.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/FSharp.Collections.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/FSharp.Core.CompilerServices.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/FSharp.Core.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/File.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Global.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Guid.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Int32.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/List.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Long.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Map.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/MapUtil.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Native.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Numeric.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Observable.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Option.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Path.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/README.md +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Random.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Range.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Reflection.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/RegExp.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Result.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Seq.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Seq2.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Set.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/String.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/System.Collections.Generic.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/System.Text.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/System.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Task.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/TaskBuilder.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/TimeOnly.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/TimeOnlyTemporal.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/TimeSpan.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/TimeSpanTemporal.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Timer.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Types.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Unicode.13.0.0.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/Uri.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/big.d.ts +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/lib/big.js +0 -0
- /package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/quotation.js +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
import { substring } from "../../fable_modules/fable-library-js.5.
|
|
3
|
-
import { length, collect, filter, choose, empty, append, forAll, exists, tail, head, isEmpty, map, fold, tryPick } from "../../fable_modules/fable-library-js.5.
|
|
4
|
-
import { FSharpSet__Contains, empty as empty_1, ofList, add, contains } from "../../fable_modules/fable-library-js.5.
|
|
5
|
-
import { safeHash, equals, comparePrimitives, curry2 } from "../../fable_modules/fable-library-js.5.
|
|
2
|
+
import { substring } from "../../fable_modules/fable-library-js.5.21.0/String.js";
|
|
3
|
+
import { length, collect, filter, choose, empty, append, forAll, exists, tail, head, isEmpty, map, fold, tryPick } from "../../fable_modules/fable-library-js.5.21.0/List.js";
|
|
4
|
+
import { FSharpSet__Contains, empty as empty_1, ofList, add, contains } from "../../fable_modules/fable-library-js.5.21.0/Set.js";
|
|
5
|
+
import { safeHash, equals, comparePrimitives, curry2 } from "../../fable_modules/fable-library-js.5.21.0/Util.js";
|
|
6
6
|
import { GluePrimitive, GlueSubstitution_substituteMember, GlueTypeUnion, GlueTypeReference, GlueType, GlueSubstitution_substitute, GlueSubstitution_ofTypeArguments, GlueMember, GlueProperty } from "../GlueAST.js";
|
|
7
|
-
import { List_distinct, List_distinctBy } from "../../fable_modules/fable-library-js.5.
|
|
8
|
-
import { FSharpChoice$2 } from "../../fable_modules/fable-library-js.5.
|
|
7
|
+
import { List_distinct, List_distinctBy } from "../../fable_modules/fable-library-js.5.21.0/Seq2.js";
|
|
8
|
+
import { FSharpChoice$2 } from "../../fable_modules/fable-library-js.5.21.0/Choice.js";
|
|
9
9
|
import { isUnionCaseName } from "./Utils.js";
|
|
10
10
|
import { memberTypeParameterNames } from "./TypeParameters.js";
|
|
11
|
-
import { defaultArg } from "../../fable_modules/fable-library-js.5.
|
|
11
|
+
import { defaultArg } from "../../fable_modules/fable-library-js.5.21.0/Option.js";
|
|
12
12
|
|
|
13
13
|
function containerOf(fullName) {
|
|
14
14
|
let unquoted;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
import { Record } from "../../fable_modules/fable-library-js.5.
|
|
3
|
-
import { list_type, option_type, record_type, string_type } from "../../fable_modules/fable-library-js.5.
|
|
2
|
+
import { Record } from "../../fable_modules/fable-library-js.5.21.0/Types.js";
|
|
3
|
+
import { list_type, option_type, record_type, string_type } from "../../fable_modules/fable-library-js.5.21.0/Reflection.js";
|
|
4
4
|
import { FSharpParameter, FSharpTypeAlias, FSharpFunctionType, FSharpUnion, FSharpUnionCase, FSharpTypeReference, FSharpType, FSharpMapped, FSharpTypeParameter, FSharpTypeParameterInfo_Create_Z6CFD3565, FSharpTypeParameter_$reflection, FSharpType_$reflection } from "../FsharpAST.js";
|
|
5
|
-
import { defaultArg, unwrap } from "../../fable_modules/fable-library-js.5.
|
|
6
|
-
import { map, tryFind } from "../../fable_modules/fable-library-js.5.
|
|
7
|
-
import { substring } from "../../fable_modules/fable-library-js.5.
|
|
5
|
+
import { defaultArg, unwrap } from "../../fable_modules/fable-library-js.5.21.0/Option.js";
|
|
6
|
+
import { map, tryFind } from "../../fable_modules/fable-library-js.5.21.0/List.js";
|
|
7
|
+
import { substring } from "../../fable_modules/fable-library-js.5.21.0/String.js";
|
|
8
8
|
import { tryUnwrapOption } from "./Utils.js";
|
|
9
9
|
|
|
10
10
|
export class SealedTypeInfo extends Record {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
import { GlueSubstitution_substitute, GlueType, GluePrimitive, GlueTypeParameter } from "../GlueAST.js";
|
|
3
|
-
import { cons, length, choose, exists, empty, append, contains, filter, collect, singleton, map } from "../../fable_modules/fable-library-js.5.
|
|
3
|
+
import { cons, length, choose, exists, empty, append, contains, filter, collect, singleton, map } from "../../fable_modules/fable-library-js.5.21.0/List.js";
|
|
4
4
|
import { FSharpTypeModule_children, FSharpType, FSharpTypeParameter, FSharpTypeParameterInfo_Create_Z6CFD3565 } from "../FsharpAST.js";
|
|
5
|
-
import { comparePrimitives, stringHash } from "../../fable_modules/fable-library-js.5.
|
|
6
|
-
import { singleton as singleton_2, add, ofSeq, FSharpSet__Contains, ofList } from "../../fable_modules/fable-library-js.5.
|
|
7
|
-
import { empty as empty_1, singleton as singleton_1, append as append_1, delay, toList } from "../../fable_modules/fable-library-js.5.
|
|
8
|
-
import { substring } from "../../fable_modules/fable-library-js.5.
|
|
9
|
-
import { remove, map as map_1, FSharpMap__ContainsKey, FSharpMap__get_Item, ofList as ofList_1 } from "../../fable_modules/fable-library-js.5.
|
|
5
|
+
import { comparePrimitives, stringHash } from "../../fable_modules/fable-library-js.5.21.0/Util.js";
|
|
6
|
+
import { singleton as singleton_2, add, ofSeq, FSharpSet__Contains, ofList } from "../../fable_modules/fable-library-js.5.21.0/Set.js";
|
|
7
|
+
import { empty as empty_1, singleton as singleton_1, append as append_1, delay, toList } from "../../fable_modules/fable-library-js.5.21.0/Seq.js";
|
|
8
|
+
import { substring } from "../../fable_modules/fable-library-js.5.21.0/String.js";
|
|
9
|
+
import { remove, map as map_1, FSharpMap__ContainsKey, FSharpMap__get_Item, ofList as ofList_1 } from "../../fable_modules/fable-library-js.5.21.0/Map.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* A type parameter without constraint nor default
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
import { takeWhile, ofArray, mapIndexed, append, fold, tryFindIndex, empty, zip, tail as tail_1, head as head_1, tryFind, choose, forAll, filter, isEmpty, length, tryPick, map, exists, cons, singleton, collect } from "../../fable_modules/fable-library-js.5.
|
|
2
|
+
import { takeWhile, ofArray, mapIndexed, append, fold, tryFindIndex, empty, zip, tail as tail_1, head as head_1, tryFind, choose, forAll, filter, isEmpty, length, tryPick, map, exists, cons, singleton, collect } from "../../fable_modules/fable-library-js.5.21.0/List.js";
|
|
3
3
|
import { GlueConstructSignature, GlueMethod, GlueMember, GlueMethodSignature, GlueParameter, GlueTypeUnion, GlueSubstitution_substitute, GlueType, GluePrimitive } from "../GlueAST.js";
|
|
4
|
-
import { List_distinct } from "../../fable_modules/fable-library-js.5.
|
|
5
|
-
import { defaultArg } from "../../fable_modules/fable-library-js.5.
|
|
6
|
-
import { comparePrimitives, safeHash, equals } from "../../fable_modules/fable-library-js.5.
|
|
7
|
-
import { ofList } from "../../fable_modules/fable-library-js.5.
|
|
8
|
-
import { map as map_1, empty as empty_1, singleton as singleton_1, append as append_1, delay, toList } from "../../fable_modules/fable-library-js.5.
|
|
4
|
+
import { List_distinct } from "../../fable_modules/fable-library-js.5.21.0/Seq2.js";
|
|
5
|
+
import { defaultArg } from "../../fable_modules/fable-library-js.5.21.0/Option.js";
|
|
6
|
+
import { comparePrimitives, safeHash, equals } from "../../fable_modules/fable-library-js.5.21.0/Util.js";
|
|
7
|
+
import { ofList } from "../../fable_modules/fable-library-js.5.21.0/Map.js";
|
|
8
|
+
import { map as map_1, empty as empty_1, singleton as singleton_1, append as append_1, delay, toList } from "../../fable_modules/fable-library-js.5.21.0/Seq.js";
|
|
9
9
|
|
|
10
10
|
export const defaultMaxOverloads = 16;
|
|
11
11
|
|
|
@@ -304,32 +304,14 @@ export function expandParameters(maxOverloads, typeMemory, parameters) {
|
|
|
304
304
|
return singleton(parameter_1);
|
|
305
305
|
}
|
|
306
306
|
}, parameters), parameters));
|
|
307
|
-
const choices_1 = patternInput[0];
|
|
308
|
-
const expandsAnOptional = exists((tupledArg_2) => {
|
|
309
|
-
if (tupledArg_2[1].IsOptional) {
|
|
310
|
-
return length(tupledArg_2[0]) > 1;
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
return false;
|
|
314
|
-
}
|
|
315
|
-
}, zip(choices_1, parameters));
|
|
316
307
|
if (patternInput[1] <= 1) {
|
|
317
308
|
return singleton(parameters);
|
|
318
309
|
}
|
|
319
310
|
else {
|
|
320
|
-
|
|
311
|
+
return List_distinct(map((combination) => choose((x) => x, takeWhile((option) => (option != null), combination)), cartesian(patternInput[0])), {
|
|
321
312
|
Equals: equals,
|
|
322
313
|
GetHashCode: (x_1) => (safeHash(x_1) | 0),
|
|
323
314
|
});
|
|
324
|
-
if (expandsAnOptional) {
|
|
325
|
-
return expanded;
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
return List_distinct(append(expanded, singleton(parameters)), {
|
|
329
|
-
Equals: equals,
|
|
330
|
-
GetHashCode: (x_2) => (safeHash(x_2) | 0),
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
315
|
}
|
|
334
316
|
}
|
|
335
317
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import { FSharpSet__Contains, ofSeq } from "../../fable_modules/fable-library-js.5.
|
|
3
|
-
import { safeHash, equals, comparePrimitives } from "../../fable_modules/fable-library-js.5.
|
|
2
|
+
import { FSharpSet__Contains, ofSeq } from "../../fable_modules/fable-library-js.5.21.0/Set.js";
|
|
3
|
+
import { safeHash, equals, comparePrimitives } from "../../fable_modules/fable-library-js.5.21.0/Util.js";
|
|
4
4
|
import { FSharpModule, FSharpTypeAlias, FSharpMapped, FSharpInterface, FSharpMember, FSharpMemberInfo, FSharpParameter, FSharpAttribute, FSharpPrimitive, FSharpLiteral, FSharpType, FSharpUnion } from "../FsharpAST.js";
|
|
5
|
-
import { singleton as singleton_1, ofArray, isEmpty, empty, tryPick, collect, map, exists, contains, forAll } from "../../fable_modules/fable-library-js.5.
|
|
5
|
+
import { singleton as singleton_1, ofArray, isEmpty, empty, tryPick, collect, map, exists, contains, forAll } from "../../fable_modules/fable-library-js.5.21.0/List.js";
|
|
6
6
|
import { GlueTypeUnion, GlueTypeReference, GlueType, GluePrimitive } from "../GlueAST.js";
|
|
7
|
-
import { concat } from "../../fable_modules/fable-library-js.5.
|
|
8
|
-
import { empty as empty_1, singleton, append, delay, toList } from "../../fable_modules/fable-library-js.5.
|
|
9
|
-
import { toArray } from "../../fable_modules/fable-library-js.5.
|
|
7
|
+
import { concat } from "../../fable_modules/fable-library-js.5.21.0/String.js";
|
|
8
|
+
import { empty as empty_1, singleton, append, delay, toList } from "../../fable_modules/fable-library-js.5.21.0/Seq.js";
|
|
9
|
+
import { toArray } from "../../fable_modules/fable-library-js.5.21.0/Option.js";
|
|
10
10
|
|
|
11
11
|
export const typedArrayNames = ofSeq(["Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array", "BigInt64Array", "BigUint64Array"], {
|
|
12
12
|
Compare: (x, y) => (comparePrimitives(x, y) | 0),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import { ofList } from "../../fable_modules/fable-library-js.5.
|
|
3
|
-
import { ofArray } from "../../fable_modules/fable-library-js.5.
|
|
4
|
-
import { comparePrimitives } from "../../fable_modules/fable-library-js.5.
|
|
2
|
+
import { ofList } from "../../fable_modules/fable-library-js.5.21.0/Set.js";
|
|
3
|
+
import { ofArray } from "../../fable_modules/fable-library-js.5.21.0/List.js";
|
|
4
|
+
import { comparePrimitives } from "../../fable_modules/fable-library-js.5.21.0/Util.js";
|
|
5
5
|
|
|
6
6
|
export const fsharp = ofList(ofArray(["abstract", "and", "as", "assert", "base", "begin", "class", "default", "delegate", "do", "done", "downcast", "downto", "elif", "else", "end", "exception", "extern", "false", "finally", "for", "fun", "function", "global", "if", "in", "inherit", "inline", "interface", "internal", "lazy", "let", "match", "member", "module", "mutable", "namespace", "new", "null", "of", "open", "or", "override", "private", "public", "rec", "return", "sig", "static", "struct", "then", "to", "true", "try", "type", "upcast", "use", "val", "void", "when", "while", "with", "yield", "atomic", "break", "checked", "component", "const", "constraint", "constructor", "continue", "eager", "fixed", "fori", "functor", "include", "measure", "method", "mixin", "object", "parallel", "params", "process", "protected", "pure", "recursive", "sealed", "tailcall", "trait", "virtual", "volatile", "mod", "land", "lor", "lxor", "lsl", "lsr", "asr"]), {
|
|
7
7
|
Compare: (x, y) => (comparePrimitives(x, y) | 0),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { skipWhile, empty, tail, head, isEmpty, cons, reverse } from "../../fable_modules/fable-library-js.5.
|
|
3
|
-
import { isNullOrEmpty } from "../../fable_modules/fable-library-js.5.
|
|
2
|
+
import { skipWhile, empty, tail, head, isEmpty, cons, reverse } from "../../fable_modules/fable-library-js.5.21.0/List.js";
|
|
3
|
+
import { isNullOrEmpty } from "../../fable_modules/fable-library-js.5.21.0/String.js";
|
|
4
4
|
|
|
5
5
|
export function removeConsecutiveEmptyLines(list) {
|
|
6
6
|
const loop = (acc_mut, _arg_mut) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
import { isLetterOrDigit, isDigit } from "../../fable_modules/fable-library-js.5.
|
|
3
|
-
import { exists } from "../../fable_modules/fable-library-js.5.
|
|
4
|
-
import { FSharpSet__Contains } from "../../fable_modules/fable-library-js.5.
|
|
2
|
+
import { isLetterOrDigit, isDigit } from "../../fable_modules/fable-library-js.5.21.0/Char.js";
|
|
3
|
+
import { exists } from "../../fable_modules/fable-library-js.5.21.0/Seq.js";
|
|
4
|
+
import { FSharpSet__Contains } from "../../fable_modules/fable-library-js.5.21.0/Set.js";
|
|
5
5
|
import { fsharp } from "./Keywords.js";
|
|
6
|
-
import { isNullOrWhiteSpace, replace, substring, isNullOrEmpty, concat } from "../../fable_modules/fable-library-js.5.
|
|
7
|
-
import { Record } from "../../fable_modules/fable-library-js.5.
|
|
8
|
-
import { record_type, bool_type, string_type } from "../../fable_modules/fable-library-js.5.
|
|
6
|
+
import { isNullOrWhiteSpace, replace, substring, isNullOrEmpty, concat } from "../../fable_modules/fable-library-js.5.21.0/String.js";
|
|
7
|
+
import { Record } from "../../fable_modules/fable-library-js.5.21.0/Types.js";
|
|
8
|
+
import { record_type, bool_type, string_type } from "../../fable_modules/fable-library-js.5.21.0/Reflection.js";
|
|
9
9
|
|
|
10
10
|
function startWithDigit(name) {
|
|
11
11
|
if (name.length > 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import { split, trim, replace as replace_1 } from "../../fable_modules/fable-library-js.5.
|
|
3
|
-
import { replace as replace_2 } from "../../fable_modules/fable-library-js.5.
|
|
4
|
-
import { ofArray } from "../../fable_modules/fable-library-js.5.
|
|
2
|
+
import { split, trim, replace as replace_1 } from "../../fable_modules/fable-library-js.5.21.0/String.js";
|
|
3
|
+
import { replace as replace_2 } from "../../fable_modules/fable-library-js.5.21.0/RegExp.js";
|
|
4
|
+
import { ofArray } from "../../fable_modules/fable-library-js.5.21.0/List.js";
|
|
5
5
|
|
|
6
6
|
export function replace(oldValue, newValue, input) {
|
|
7
7
|
return replace_1(input, oldValue, newValue);
|
package/dist/Program.js
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { fileURLToPath } from "url";
|
|
4
4
|
import { writeFileSync, mkdirSync, readFileSync } from "fs";
|
|
5
|
-
import { collect, map, toList } from "./fable_modules/fable-library-js.5.
|
|
6
|
-
import { join, concat, split } from "./fable_modules/fable-library-js.5.
|
|
7
|
-
import { item, equalsWith } from "./fable_modules/fable-library-js.5.
|
|
8
|
-
import { defaultOf } from "./fable_modules/fable-library-js.5.
|
|
9
|
-
import { defaultArg } from "./fable_modules/fable-library-js.5.
|
|
10
|
-
import { parse } from "./fable_modules/fable-library-js.5.
|
|
5
|
+
import { collect, map, toList } from "./fable_modules/fable-library-js.5.21.0/Seq.js";
|
|
6
|
+
import { join, concat, split } from "./fable_modules/fable-library-js.5.21.0/String.js";
|
|
7
|
+
import { item, equalsWith } from "./fable_modules/fable-library-js.5.21.0/Array.js";
|
|
8
|
+
import { defaultOf } from "./fable_modules/fable-library-js.5.21.0/Util.js";
|
|
9
|
+
import { defaultArg } from "./fable_modules/fable-library-js.5.21.0/Option.js";
|
|
10
|
+
import { parse } from "./fable_modules/fable-library-js.5.21.0/Int32.js";
|
|
11
11
|
import { defaultMaxOverloads } from "./Glutinum.Converter/Transformer/UnionOverloads.js";
|
|
12
12
|
import { GenerateOptions } from "./Glutinum.Converter/Packages.js";
|
|
13
13
|
import { generateBindingFileWithOptions, generatePackagesFromDisk } from "./Glutinum.Converter/Generate.js";
|
|
14
|
-
import { exists, length, head, tail, isEmpty, empty } from "./fable_modules/fable-library-js.5.
|
|
14
|
+
import { exists, length, head, tail, isEmpty, empty } from "./fable_modules/fable-library-js.5.21.0/List.js";
|
|
15
15
|
import { success, error, info } from "./Glutinum.Converter/Log.js";
|
|
16
16
|
import { program as program_1 } from "commander";
|
|
17
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { value as value_1 } from "../fable-library-js.5.
|
|
3
|
-
import { class_type } from "../fable-library-js.5.
|
|
2
|
+
import { value as value_1 } from "../fable-library-js.5.21.0/Option.js";
|
|
3
|
+
import { class_type } from "../fable-library-js.5.21.0/Reflection.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Creates AsyncIterable. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of#specifications
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { Result_MapError, Result_Map, FSharpResult$2 } from "../fable-library-js.5.
|
|
3
|
-
import { class_type } from "../fable-library-js.5.
|
|
4
|
-
import { disposeSafe, getEnumerator } from "../fable-library-js.5.
|
|
5
|
-
import { Operators_IsNull } from "../fable-library-js.5.
|
|
2
|
+
import { Result_MapError, Result_Map, FSharpResult$2 } from "../fable-library-js.5.21.0/Result.js";
|
|
3
|
+
import { class_type } from "../fable-library-js.5.21.0/Reflection.js";
|
|
4
|
+
import { disposeSafe, getEnumerator } from "../fable-library-js.5.21.0/Util.js";
|
|
5
|
+
import { Operators_IsNull } from "../fable-library-js.5.21.0/FSharp.Core.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* This is an identity function, it calls the given function and return the promise value untouched.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { PromiseBuilder_$ctor } from "./Promise.fs.js";
|
|
3
|
-
import { value } from "../fable-library-js.5.
|
|
4
|
-
import { FSharpResult$2 } from "../fable-library-js.5.
|
|
3
|
+
import { value } from "../fable-library-js.5.21.0/Option.js";
|
|
4
|
+
import { FSharpResult$2 } from "../fable-library-js.5.21.0/Result.js";
|
|
5
5
|
|
|
6
6
|
export const promise = PromiseBuilder_$ctor();
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
import { append, skip, head, reverse, equalsWith } from "../fable-library-js.5.
|
|
3
|
-
import { defaultOf, equals } from "../fable-library-js.5.
|
|
4
|
-
import { FSharpResult$2 } from "../fable-library-js.5.
|
|
5
|
-
import { singleton } from "../fable-library-js.5.
|
|
6
|
-
import { some, value as value_10 } from "../fable-library-js.5.
|
|
2
|
+
import { append, skip, head, reverse, equalsWith } from "../fable-library-js.5.21.0/Array.js";
|
|
3
|
+
import { defaultOf, equals } from "../fable-library-js.5.21.0/Util.js";
|
|
4
|
+
import { FSharpResult$2 } from "../fable-library-js.5.21.0/Result.js";
|
|
5
|
+
import { singleton } from "../fable-library-js.5.21.0/AsyncBuilder.js";
|
|
6
|
+
import { some, value as value_10 } from "../fable-library-js.5.21.0/Option.js";
|
|
7
7
|
|
|
8
8
|
function traverseResultM$0027(state_mut, f_mut, xs_mut) {
|
|
9
9
|
traverseResultM$0027:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { Exception } from "../fable-library-js.5.
|
|
3
|
-
import { fromContinuations, cancellationToken, startWithContinuations } from "../fable-library-js.5.
|
|
4
|
-
import { FSharpChoice$3 } from "../fable-library-js.5.
|
|
5
|
-
import { singleton } from "../fable-library-js.5.
|
|
2
|
+
import { Exception } from "../fable-library-js.5.21.0/Util.js";
|
|
3
|
+
import { fromContinuations, cancellationToken, startWithContinuations } from "../fable-library-js.5.21.0/Async.js";
|
|
4
|
+
import { FSharpChoice$3 } from "../fable-library-js.5.21.0/Choice.js";
|
|
5
|
+
import { singleton } from "../fable-library-js.5.21.0/AsyncBuilder.js";
|
|
6
6
|
|
|
7
7
|
export function Microsoft_FSharp_Control_FSharpAsync__Async_TryFinallyAsync_Static_Z753D11A1(comp, deferred) {
|
|
8
8
|
const finish = (tupledArg, tupledArg_1) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import { class_type } from "../fable-library-js.5.
|
|
3
|
-
import { singleton } from "../fable-library-js.5.
|
|
4
|
-
import { value as value_2, some } from "../fable-library-js.5.
|
|
2
|
+
import { class_type } from "../fable-library-js.5.21.0/Reflection.js";
|
|
3
|
+
import { singleton } from "../fable-library-js.5.21.0/AsyncBuilder.js";
|
|
4
|
+
import { value as value_2, some } from "../fable-library-js.5.21.0/Option.js";
|
|
5
5
|
|
|
6
6
|
export class AsyncOptionCE_AsyncOptionBuilder {
|
|
7
7
|
constructor() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import { singleton } from "../fable-library-js.5.
|
|
3
|
-
import { FSharpResult$2 } from "../fable-library-js.5.
|
|
4
|
-
import { some, value as value_4 } from "../fable-library-js.5.
|
|
2
|
+
import { singleton } from "../fable-library-js.5.21.0/AsyncBuilder.js";
|
|
3
|
+
import { FSharpResult$2 } from "../fable-library-js.5.21.0/Result.js";
|
|
4
|
+
import { some, value as value_4 } from "../fable-library-js.5.21.0/Option.js";
|
|
5
5
|
|
|
6
6
|
export function AsyncResultOption_apply(applier, input) {
|
|
7
7
|
return singleton.Bind(applier, (x_3) => singleton.Bind(input, (y_2) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
import { append, singleton as singleton_1, empty, reverse, tail, cons, head, isEmpty } from "../fable-library-js.5.
|
|
3
|
-
import { FSharpResult$2 } from "../fable-library-js.5.
|
|
4
|
-
import { singleton } from "../fable-library-js.5.
|
|
5
|
-
import { some, value as value_10 } from "../fable-library-js.5.
|
|
2
|
+
import { append, singleton as singleton_1, empty, reverse, tail, cons, head, isEmpty } from "../fable-library-js.5.21.0/List.js";
|
|
3
|
+
import { FSharpResult$2 } from "../fable-library-js.5.21.0/Result.js";
|
|
4
|
+
import { singleton } from "../fable-library-js.5.21.0/AsyncBuilder.js";
|
|
5
|
+
import { some, value as value_10 } from "../fable-library-js.5.21.0/Option.js";
|
|
6
6
|
|
|
7
7
|
function traverseResultM$0027(state_mut, f_mut, xs_mut) {
|
|
8
8
|
traverseResultM$0027:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
import { Exception } from "../fable-library-js.5.
|
|
3
|
-
import { class_type } from "../fable-library-js.5.
|
|
4
|
-
import { singleton } from "../fable-library-js.5.
|
|
2
|
+
import { Exception } from "../fable-library-js.5.21.0/Util.js";
|
|
3
|
+
import { class_type } from "../fable-library-js.5.21.0/Reflection.js";
|
|
4
|
+
import { singleton } from "../fable-library-js.5.21.0/AsyncBuilder.js";
|
|
5
5
|
|
|
6
6
|
export class InternalHelpers_AsyncResultErrorException$1 extends Exception {
|
|
7
7
|
constructor(value) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { class_type } from "../fable-library-js.5.
|
|
3
|
-
import { FSharpResult$2 } from "../fable-library-js.5.
|
|
2
|
+
import { class_type } from "../fable-library-js.5.21.0/Reflection.js";
|
|
3
|
+
import { FSharpResult$2 } from "../fable-library-js.5.21.0/Result.js";
|
|
4
4
|
|
|
5
5
|
export class ResultCE_ResultBuilder {
|
|
6
6
|
constructor() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { FSharpResult$2 } from "../fable-library-js.5.
|
|
3
|
-
import { value } from "../fable-library-js.5.
|
|
2
|
+
import { FSharpResult$2 } from "../fable-library-js.5.21.0/Result.js";
|
|
3
|
+
import { value } from "../fable-library-js.5.21.0/Option.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Combines two <c>Result</c> values that contain <c>Option</c> values into a single <c>Result</c> value that contains the tuple of the two values wrapped in an <c>Option</c>, if they are both <c>Some</c>.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
import { empty } from "../fable-library-js.5.
|
|
3
|
-
import { FSharpResult$2 } from "../fable-library-js.5.
|
|
4
|
-
import { Operators_NullArg, Operators_IsNull } from "../fable-library-js.5.
|
|
5
|
-
import { disposeSafe, getEnumerator, defaultOf } from "../fable-library-js.5.
|
|
6
|
-
import { singleton } from "../fable-library-js.5.
|
|
7
|
-
import { ArgumentNullException_$ctor_Z721C83C5 } from "../fable-library-js.5.
|
|
8
|
-
import { value as value_1 } from "../fable-library-js.5.
|
|
2
|
+
import { empty } from "../fable-library-js.5.21.0/Seq.js";
|
|
3
|
+
import { FSharpResult$2 } from "../fable-library-js.5.21.0/Result.js";
|
|
4
|
+
import { Operators_NullArg, Operators_IsNull } from "../fable-library-js.5.21.0/FSharp.Core.js";
|
|
5
|
+
import { disposeSafe, getEnumerator, defaultOf } from "../fable-library-js.5.21.0/Util.js";
|
|
6
|
+
import { singleton } from "../fable-library-js.5.21.0/AsyncBuilder.js";
|
|
7
|
+
import { ArgumentNullException_$ctor_Z721C83C5 } from "../fable-library-js.5.21.0/System.js";
|
|
8
|
+
import { value as value_1 } from "../fable-library-js.5.21.0/Option.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Applies a function to each element of a sequence and returns a single result
|
|
@@ -86,6 +86,9 @@ export function awaitEvent(event, cancelAction) {
|
|
|
86
86
|
}
|
|
87
87
|
ctx.onCancel(new OperationCanceledException());
|
|
88
88
|
});
|
|
89
|
+
if (ctx.cancelToken.isCancelled) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
89
92
|
event.AddHandler(handler);
|
|
90
93
|
});
|
|
91
94
|
}
|
|
@@ -127,15 +130,26 @@ export function sequential(computations) {
|
|
|
127
130
|
}
|
|
128
131
|
export function sleep(millisecondsDueTime) {
|
|
129
132
|
return protectedCont((ctx) => {
|
|
133
|
+
let completed = false;
|
|
130
134
|
let tokenId;
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
const settle = (cancelled) => {
|
|
136
|
+
if (completed) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
completed = true;
|
|
136
140
|
clearTimeout(timeoutId);
|
|
137
|
-
|
|
138
|
-
|
|
141
|
+
if (tokenId !== undefined) {
|
|
142
|
+
ctx.cancelToken.removeListener(tokenId);
|
|
143
|
+
}
|
|
144
|
+
if (cancelled) {
|
|
145
|
+
ctx.onCancel(new OperationCanceledException());
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
ctx.onSuccess(void 0);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const timeoutId = setTimeout(() => settle(false), millisecondsDueTime);
|
|
152
|
+
tokenId = ctx.cancelToken.addListener(() => settle(true));
|
|
139
153
|
});
|
|
140
154
|
}
|
|
141
155
|
export function start(computation, cancellationToken) {
|
package/dist/fable_modules/{fable-library-js.5.17.2 → fable-library-js.5.21.0}/AsyncBuilder.js
RENAMED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { Exception, ensureErrorOrException } from "./Util.js";
|
|
2
|
+
// AggregateError requires ES2021; the runtime also supports ES2020 hosts.
|
|
3
|
+
export class CancellationCallbackError extends Exception {
|
|
4
|
+
constructor(errors) {
|
|
5
|
+
// invariant: F# InnerException exposes the first failure without discarding the remaining errors
|
|
6
|
+
super("Cancellation callbacks failed", errors[0]);
|
|
7
|
+
this.errors = errors;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
2
10
|
export class CancellationToken {
|
|
3
11
|
constructor(cancelled = false) {
|
|
4
12
|
this._id = 0;
|
|
@@ -11,14 +19,35 @@ export class CancellationToken {
|
|
|
11
19
|
cancel() {
|
|
12
20
|
if (!this._cancelled) {
|
|
13
21
|
this._cancelled = true;
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
// decision: visit newest registrations first, matching .NET; disposal can skip pending callbacks
|
|
23
|
+
const pending = Array.from(this._listeners.keys()).reverse();
|
|
24
|
+
const errors = [];
|
|
25
|
+
for (const id of pending) {
|
|
26
|
+
const listener = this._listeners.get(id);
|
|
27
|
+
this._listeners.delete(id);
|
|
28
|
+
if (listener) {
|
|
29
|
+
try {
|
|
30
|
+
listener();
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
errors.push(error);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (errors.length > 0) {
|
|
38
|
+
throw new CancellationCallbackError(errors);
|
|
16
39
|
}
|
|
17
40
|
}
|
|
18
41
|
}
|
|
19
42
|
addListener(f) {
|
|
20
43
|
const id = this._id;
|
|
21
|
-
this.
|
|
44
|
+
this._id++;
|
|
45
|
+
if (this._cancelled) {
|
|
46
|
+
f();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
this._listeners.set(id, f);
|
|
50
|
+
}
|
|
22
51
|
return id;
|
|
23
52
|
}
|
|
24
53
|
removeListener(id) {
|
|
@@ -148,15 +177,31 @@ export class AsyncBuilder {
|
|
|
148
177
|
return protectedCont((ctx) => {
|
|
149
178
|
computation({
|
|
150
179
|
onSuccess: (x) => {
|
|
151
|
-
|
|
180
|
+
try {
|
|
181
|
+
compensation();
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
ctx.onError(ensureErrorOrException(error));
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
152
187
|
ctx.onSuccess(x);
|
|
153
188
|
},
|
|
154
189
|
onError: (x) => {
|
|
155
|
-
|
|
190
|
+
try {
|
|
191
|
+
compensation();
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
ctx.onError(ensureErrorOrException(error));
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
156
197
|
ctx.onError(x);
|
|
157
198
|
},
|
|
158
199
|
onCancel: (x) => {
|
|
159
|
-
compensation
|
|
200
|
+
// decision: cancellation remains terminal when compensation throws, matching .NET Async.TryFinally
|
|
201
|
+
try {
|
|
202
|
+
compensation();
|
|
203
|
+
}
|
|
204
|
+
catch { /* Cancellation takes precedence. */ }
|
|
160
205
|
ctx.onCancel(x);
|
|
161
206
|
},
|
|
162
207
|
cancelToken: ctx.cancelToken,
|