@f1studio/form-spec 5.0.0-alpha.130 → 5.0.0-alpha.132
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/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts.map +1 -1
- package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
- package/FormSpec.FS/Interop/FormSpec.Api.Option.d.ts.map +1 -1
- package/FormSpec.FS/Interop/FormSpec.Values.Api.Option.d.ts.map +1 -1
- package/FormSpec.FS/Migrator.d.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/FormSpecHelpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js +6 -16
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js +3 -7
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js +7 -9
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js +6 -13
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Api.Option.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.js +10 -16
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Interop/FormSpec.Values.Api.Option.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Migrator.js +1 -3
- package/FormSpec.TS/FormSpec.FS/Migrator.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Migrator.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/PathwayExecutor.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/PathwayExecutor.ts.map +1 -1
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.js +69 -62
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.js.map +1 -1
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.ts.map +1 -1
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.js +14 -2
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.js.map +1 -1
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.ts.map +1 -1
- package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
- package/README.md +7 -7
- package/Thoth.Json/packages/Thoth.Json/Decode.d.ts +2 -2
- package/Thoth.Json/packages/Thoth.Json/Decode.d.ts.map +1 -1
- package/Thoth.Json/packages/Thoth.Json/Encode.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts +8 -18
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts +5 -5
- package/src/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts +3 -7
- package/src/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts +8 -10
- package/src/FormSpec.FS/Interop/FormSpec.Api.Option.ts +6 -13
- package/src/FormSpec.FS/Interop/FormSpec.Values.Api.Option.ts +10 -16
- package/src/FormSpec.FS/Migrator.ts +1 -3
- package/src/Thoth.Json/packages/Thoth.Json/Decode.ts +55 -38
- package/src/Thoth.Json/packages/Thoth.Json/Encode.ts +20 -6
|
@@ -320,15 +320,11 @@ export function TemplateManifest_$reflection(): TypeInfo {
|
|
|
320
320
|
const extraWithInt64: ExtraCoders = new ExtraCoders((() => {
|
|
321
321
|
let copyOfStruct: string = newGuid();
|
|
322
322
|
return copyOfStruct;
|
|
323
|
-
})(), add<string, [((arg0: any) => any), ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))]>("System.Int64", [int64_1, int64_2] as [((arg0: any) => any), ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))], empty.Coders));
|
|
323
|
+
})(), add<string, [((arg0: any) => any), ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))]>("System.Int64", [int64_1, (path: string): ((arg0: any) => FSharpResult$2_$union<int64, [string, ErrorReason_$union]>) => ((value_1: any): FSharpResult$2_$union<int64, [string, ErrorReason_$union]> => int64_2(path, value_1))] as [((arg0: any) => any), ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))], empty.Coders));
|
|
324
324
|
|
|
325
|
-
const int64Decoder: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<int64, [string, ErrorReason_$union]>)) = (
|
|
326
|
-
throw new Error("🚀 LIBERATION FORK CONFIRMED: generateDecoder entry point reached!");
|
|
327
|
-
})(), Auto_generateBoxedDecoder_Z6670B51(int64_type, undefined, extraWithInt64));
|
|
325
|
+
const int64Decoder: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<int64, [string, ErrorReason_$union]>)) = Auto_generateBoxedDecoder_Z6670B51(int64_type, undefined, extraWithInt64);
|
|
328
326
|
|
|
329
|
-
const liberatedInt64Decoder: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<int64, [string, ErrorReason_$union]>)) = (
|
|
330
|
-
throw new Error("🚀 LIBERATION FORK CONFIRMED: generateDecoder entry point reached!");
|
|
331
|
-
})(), Auto_generateBoxedDecoder_Z6670B51(int64_type, undefined, undefined));
|
|
327
|
+
const liberatedInt64Decoder: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<int64, [string, ErrorReason_$union]>)) = Auto_generateBoxedDecoder_Z6670B51(int64_type, undefined, undefined);
|
|
332
328
|
|
|
333
329
|
function scoreSurveillanceLog(score: int64): void {
|
|
334
330
|
try {
|
|
@@ -8,7 +8,7 @@ import { comparePrimitives, defaultOf, equals, createObj, stringHash, compare, I
|
|
|
8
8
|
import { FSharpResult$2_Ok, FSharpResult$2_Error, FSharpResult$2_$union } from "@fable-org/fable-library-js/Result.js";
|
|
9
9
|
import { newGuid, parse, tryParse } from "@fable-org/fable-library-js/Guid.js";
|
|
10
10
|
import { Union, FSharpRef } from "@fable-org/fable-library-js/Types.js";
|
|
11
|
-
import { array_type,
|
|
11
|
+
import { array_type, string_type, obj_type, union_type, TypeInfo } from "@fable-org/fable-library-js/Reflection.js";
|
|
12
12
|
import { array as array_7, at, IOptionalGetter, IGetters, dict as dict_1, string, IRequiredGetter, object, fromString as fromString_1 } from "../../Thoth.Json/packages/Thoth.Json/Decode.js";
|
|
13
13
|
import { ErrorReason_$union } from "../../Thoth.Json/packages/Thoth.Json/Types.js";
|
|
14
14
|
import { tryFind as tryFind_1, empty as empty_2, count, ofSeq as ofSeq_1, toList, FSharpMap } from "@fable-org/fable-library-js/Map.js";
|
|
@@ -82,9 +82,7 @@ export function serializeFormSpec(formSpec: Spec_FormSpec$1<Spec_FieldType_$unio
|
|
|
82
82
|
|
|
83
83
|
export function deserializeFormSpec(json: string): Option<Spec_FormSpec$1<Spec_FieldType_$union>> {
|
|
84
84
|
toConsole(printf("[API.Helpers] Deserializing FormSpec"));
|
|
85
|
-
const matchValue: FSharpResult$2_$union<Spec_FormSpec$1<Spec_FieldType_$union>, string> = fromString<Spec_FormSpec$1<Spec_FieldType_$union>>(uncurry2(((()
|
|
86
|
-
throw new Error("🚀 LIBERATION FORK CONFIRMED: generateDecoder entry point reached!");
|
|
87
|
-
})(), Auto_generateBoxedDecoder_Z6670B51(Spec_FormSpec$1_$reflection(Spec_FieldType_$reflection()), undefined, undefined))), json);
|
|
85
|
+
const matchValue: FSharpResult$2_$union<Spec_FormSpec$1<Spec_FieldType_$union>, string> = fromString<Spec_FormSpec$1<Spec_FieldType_$union>>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(Spec_FormSpec$1_$reflection(Spec_FieldType_$reflection()), undefined, undefined)), json);
|
|
88
86
|
if (matchValue.tag === /* Error */ 1) {
|
|
89
87
|
throw new Error(`[API.Helpers] Deserialization failed: ${matchValue.fields[0]}`);
|
|
90
88
|
}
|
|
@@ -206,9 +204,9 @@ export function getExpectedFieldValueType(fieldType: Spec_FieldType_$union): Exp
|
|
|
206
204
|
}
|
|
207
205
|
|
|
208
206
|
export function decodeAsString(fieldKey: string, obj: any): string {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
207
|
+
let matchValue: FSharpResult$2_$union<string, string>;
|
|
208
|
+
const json: string = toString(0, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(obj));
|
|
209
|
+
matchValue = fromString<string>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(string_type, undefined, undefined)), json);
|
|
212
210
|
if (matchValue.tag === /* Error */ 1) {
|
|
213
211
|
if (typeof obj === "string") {
|
|
214
212
|
const str = obj as string;
|
|
@@ -236,9 +234,9 @@ export function decodeAsStringArray(fieldKey: string, obj: any): string[] {
|
|
|
236
234
|
}
|
|
237
235
|
else {
|
|
238
236
|
try {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
237
|
+
let matchValue: FSharpResult$2_$union<string[], string>;
|
|
238
|
+
const json: string = toString(0, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(obj));
|
|
239
|
+
matchValue = fromString<string[]>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(array_type(string_type), undefined, undefined)), json);
|
|
242
240
|
if (matchValue.tag === /* Error */ 1) {
|
|
243
241
|
throw new Error(`Field ${fieldKey}: Expected string array, got ${"Object"}`);
|
|
244
242
|
}
|
|
@@ -7,9 +7,9 @@ import { Spec_FormSpec$1_$reflection, Spec_FieldType_$reflection, Spec_FormClass
|
|
|
7
7
|
import { tryParse } from "@fable-org/fable-library-js/Guid.js";
|
|
8
8
|
import { ofArray, reverse, empty, FSharpList, cons, map, toArray } from "@fable-org/fable-library-js/List.js";
|
|
9
9
|
import { sumBy, tryFind, collect, map as map_1, fold } from "@fable-org/fable-library-js/Array.js";
|
|
10
|
+
import { Auto_generateBoxedEncoder_437914C6, toString } from "../../Thoth.Json/packages/Thoth.Json/Encode.js";
|
|
10
11
|
import { FSharpResult$2_$union, Result_ToOption } from "@fable-org/fable-library-js/Result.js";
|
|
11
12
|
import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../../Thoth.Json/packages/Thoth.Json/Decode.js";
|
|
12
|
-
import { Auto_generateBoxedEncoder_437914C6, toString } from "../../Thoth.Json/packages/Thoth.Json/Encode.js";
|
|
13
13
|
import { printf, toConsole } from "@fable-org/fable-library-js/String.js";
|
|
14
14
|
|
|
15
15
|
export class Types_FieldKeyTS extends Record implements IEquatable<Types_FieldKeyTS>, IComparable<Types_FieldKeyTS> {
|
|
@@ -1469,9 +1469,8 @@ export function Converters_formSpecFromTS(spec: Types_FormSpecTS): Option<Spec_F
|
|
|
1469
1469
|
* Validate a TypeScript FormSpec object from JavaScript/TypeScript
|
|
1470
1470
|
*/
|
|
1471
1471
|
export function Validators_validateFormSpec(input: any): Option<Types_FormSpecTS> {
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
})(), Auto_generateBoxedDecoder_Z6670B51(Types_FormSpecTS_$reflection(), undefined, undefined))), toString(4, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(input))));
|
|
1472
|
+
const stringified: string = toString(4, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(input));
|
|
1473
|
+
return Result_ToOption<Types_FormSpecTS, string>(fromString<Types_FormSpecTS>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(Types_FormSpecTS_$reflection(), undefined, undefined)), stringified));
|
|
1475
1474
|
}
|
|
1476
1475
|
|
|
1477
1476
|
/**
|
|
@@ -1525,9 +1524,7 @@ export function Api_formSpecFromTypeScript(spec: Types_FormSpecTS): Option<Spec_
|
|
|
1525
1524
|
* - FieldType: ["Text", {}] → { Type: "Text", TextInfo: {...}, ... }
|
|
1526
1525
|
*/
|
|
1527
1526
|
export function Api_getFormSpecTSfromFormSpecFSjsonString(formSpecFSstring: string): Option<Types_FormSpecTS> {
|
|
1528
|
-
const matchValue: FSharpResult$2_$union<Spec_FormSpec$1<Spec_FieldType_$union>, string> = fromString<Spec_FormSpec$1<Spec_FieldType_$union>>(uncurry2(((()
|
|
1529
|
-
throw new Error("🚀 LIBERATION FORK CONFIRMED: generateDecoder entry point reached!");
|
|
1530
|
-
})(), Auto_generateBoxedDecoder_Z6670B51(Spec_FormSpec$1_$reflection(Spec_FieldType_$reflection()), undefined, undefined))), formSpecFSstring);
|
|
1527
|
+
const matchValue: FSharpResult$2_$union<Spec_FormSpec$1<Spec_FieldType_$union>, string> = fromString<Spec_FormSpec$1<Spec_FieldType_$union>>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(Spec_FormSpec$1_$reflection(Spec_FieldType_$reflection()), undefined, undefined)), formSpecFSstring);
|
|
1531
1528
|
if (matchValue.tag === /* Error */ 1) {
|
|
1532
1529
|
return undefined;
|
|
1533
1530
|
}
|
|
@@ -1546,9 +1543,7 @@ export function Api_getFormSpecTSfromFormSpecFSjsonString(formSpecFSstring: stri
|
|
|
1546
1543
|
* - { Type: "Text", ... } → FieldType: ["Text", {...}]
|
|
1547
1544
|
*/
|
|
1548
1545
|
export function Api_getFormSpecFSfromFormSpecTSjsonString(formSpecTSstring: string): Option<Spec_FormSpec$1<Spec_FieldType_$union>> {
|
|
1549
|
-
const matchValue: FSharpResult$2_$union<Types_FormSpecTS, string> = fromString<Types_FormSpecTS>(uncurry2(((
|
|
1550
|
-
throw new Error("🚀 LIBERATION FORK CONFIRMED: generateDecoder entry point reached!");
|
|
1551
|
-
})(), Auto_generateBoxedDecoder_Z6670B51(Types_FormSpecTS_$reflection(), undefined, undefined))), formSpecTSstring);
|
|
1546
|
+
const matchValue: FSharpResult$2_$union<Types_FormSpecTS, string> = fromString<Types_FormSpecTS>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(Types_FormSpecTS_$reflection(), undefined, undefined)), formSpecTSstring);
|
|
1552
1547
|
if (matchValue.tag === /* Error */ 1) {
|
|
1553
1548
|
return undefined;
|
|
1554
1549
|
}
|
|
@@ -1569,9 +1564,7 @@ export function Api_serializeFormSpec(spec: Types_FormSpecTS): string {
|
|
|
1569
1564
|
*/
|
|
1570
1565
|
export function Api_deserializeFormSpecTS(jsonTS: string): Option<Types_FormSpecTS> {
|
|
1571
1566
|
toConsole(printf("API.Option: Deserializing FormSpecTS!"));
|
|
1572
|
-
const matchValue: FSharpResult$2_$union<Types_FormSpecTS, string> = fromString<Types_FormSpecTS>(uncurry2(((
|
|
1573
|
-
throw new Error("🚀 LIBERATION FORK CONFIRMED: generateDecoder entry point reached!");
|
|
1574
|
-
})(), Auto_generateBoxedDecoder_Z6670B51(Types_FormSpecTS_$reflection(), undefined, undefined))), jsonTS);
|
|
1567
|
+
const matchValue: FSharpResult$2_$union<Types_FormSpecTS, string> = fromString<Types_FormSpecTS>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(Types_FormSpecTS_$reflection(), undefined, undefined)), jsonTS);
|
|
1575
1568
|
if (matchValue.tag === /* Error */ 1) {
|
|
1576
1569
|
return undefined;
|
|
1577
1570
|
}
|
|
@@ -13,9 +13,9 @@ import { ofArray, empty as empty_1, add as add_1, FSharpSet, toList as toList_1
|
|
|
13
13
|
import { resultStepsMapToFormSpec, formSpecToResultStepsMap, formSpecToMetadata, FormSpecMetadata, FieldDetails$1 } from "../FormSpecValues.js";
|
|
14
14
|
import { tryParse as tryParse_1, minValue, toString } from "@fable-org/fable-library-js/Date.js";
|
|
15
15
|
import { buildFormSpecFromResultStepsMap } from "../FormSpecHelpers.js";
|
|
16
|
+
import { Auto_generateBoxedEncoder_437914C6, toString as toString_1 } from "../../Thoth.Json/packages/Thoth.Json/Encode.js";
|
|
16
17
|
import { FSharpResult$2_$union, Result_ToOption } from "@fable-org/fable-library-js/Result.js";
|
|
17
18
|
import { Auto_generateBoxedDecoder_Z6670B51, fromString } from "../../Thoth.Json/packages/Thoth.Json/Decode.js";
|
|
18
|
-
import { Auto_generateBoxedEncoder_437914C6, toString as toString_1 } from "../../Thoth.Json/packages/Thoth.Json/Encode.js";
|
|
19
19
|
|
|
20
20
|
export class ValuesTypes_FieldAnswerTS extends Record implements IEquatable<ValuesTypes_FieldAnswerTS>, IComparable<ValuesTypes_FieldAnswerTS> {
|
|
21
21
|
readonly FieldKey: Types_FieldKeyTS;
|
|
@@ -1042,9 +1042,8 @@ export function ValuesConverters_dynamicFormResultDataFromTSWithoutFormSpec(data
|
|
|
1042
1042
|
* Validate a TypeScript DynamicFormResultData object from JavaScript/TypeScript
|
|
1043
1043
|
*/
|
|
1044
1044
|
export function ValuesValidators_validateDynamicFormResultData(input: any): Option<ValuesTypes_DynamicFormResultDataTS> {
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
})(), Auto_generateBoxedDecoder_Z6670B51(ValuesTypes_DynamicFormResultDataTS_$reflection(), undefined, undefined))), toString_1(4, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(input))));
|
|
1045
|
+
const stringified: string = toString_1(4, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(input));
|
|
1046
|
+
return Result_ToOption<ValuesTypes_DynamicFormResultDataTS, string>(fromString<ValuesTypes_DynamicFormResultDataTS>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(ValuesTypes_DynamicFormResultDataTS_$reflection(), undefined, undefined)), stringified));
|
|
1048
1047
|
}
|
|
1049
1048
|
|
|
1050
1049
|
/**
|
|
@@ -1064,27 +1063,24 @@ export function ValuesValidators_validateAndConvertDynamicFormResultData(input:
|
|
|
1064
1063
|
* Validate a TypeScript DynamicForm object
|
|
1065
1064
|
*/
|
|
1066
1065
|
export function ValuesValidators_validateDynamicForm(input: any): Option<ValuesTypes_DynamicFormTS> {
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
})(), Auto_generateBoxedDecoder_Z6670B51(ValuesTypes_DynamicFormTS_$reflection(), undefined, undefined))), toString_1(4, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(input))));
|
|
1066
|
+
const stringified: string = toString_1(4, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(input));
|
|
1067
|
+
return Result_ToOption<ValuesTypes_DynamicFormTS, string>(fromString<ValuesTypes_DynamicFormTS>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(ValuesTypes_DynamicFormTS_$reflection(), undefined, undefined)), stringified));
|
|
1070
1068
|
}
|
|
1071
1069
|
|
|
1072
1070
|
/**
|
|
1073
1071
|
* Validate a TypeScript FieldAnswer object
|
|
1074
1072
|
*/
|
|
1075
1073
|
export function ValuesValidators_validateFieldAnswer(input: any): Option<ValuesTypes_FieldAnswerTS> {
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
})(), Auto_generateBoxedDecoder_Z6670B51(ValuesTypes_FieldAnswerTS_$reflection(), undefined, undefined))), toString_1(4, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(input))));
|
|
1074
|
+
const stringified: string = toString_1(4, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(input));
|
|
1075
|
+
return Result_ToOption<ValuesTypes_FieldAnswerTS, string>(fromString<ValuesTypes_FieldAnswerTS>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(ValuesTypes_FieldAnswerTS_$reflection(), undefined, undefined)), stringified));
|
|
1079
1076
|
}
|
|
1080
1077
|
|
|
1081
1078
|
/**
|
|
1082
1079
|
* Validate a TypeScript FieldValue object
|
|
1083
1080
|
*/
|
|
1084
1081
|
export function ValuesValidators_validateFieldValue(input: any): Option<ValuesTypes_FieldValueTS> {
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
})(), Auto_generateBoxedDecoder_Z6670B51(ValuesTypes_FieldValueTS_$reflection(), undefined, undefined))), toString_1(4, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(input))));
|
|
1082
|
+
const stringified: string = toString_1(4, Auto_generateBoxedEncoder_437914C6(obj_type, undefined, undefined, undefined)(input));
|
|
1083
|
+
return Result_ToOption<ValuesTypes_FieldValueTS, string>(fromString<ValuesTypes_FieldValueTS>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(ValuesTypes_FieldValueTS_$reflection(), undefined, undefined)), stringified));
|
|
1088
1084
|
}
|
|
1089
1085
|
|
|
1090
1086
|
/**
|
|
@@ -1233,9 +1229,7 @@ export function ValuesApi_serializeDynamicFormResultData(data: ValuesTypes_Dynam
|
|
|
1233
1229
|
* Deserialize a DynamicFormResultData from JSON string
|
|
1234
1230
|
*/
|
|
1235
1231
|
export function ValuesApi_deserializeDynamicFormResultData(json: string): Option<ValuesTypes_DynamicFormResultDataTS> {
|
|
1236
|
-
const matchValue: FSharpResult$2_$union<ValuesTypes_DynamicFormResultDataTS, string> = fromString<ValuesTypes_DynamicFormResultDataTS>(uncurry2(((
|
|
1237
|
-
throw new Error("🚀 LIBERATION FORK CONFIRMED: generateDecoder entry point reached!");
|
|
1238
|
-
})(), Auto_generateBoxedDecoder_Z6670B51(ValuesTypes_DynamicFormResultDataTS_$reflection(), undefined, undefined))), json);
|
|
1232
|
+
const matchValue: FSharpResult$2_$union<ValuesTypes_DynamicFormResultDataTS, string> = fromString<ValuesTypes_DynamicFormResultDataTS>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(ValuesTypes_DynamicFormResultDataTS_$reflection(), undefined, undefined)), json);
|
|
1239
1233
|
if (matchValue.tag === /* Error */ 1) {
|
|
1240
1234
|
return undefined;
|
|
1241
1235
|
}
|
|
@@ -84,9 +84,7 @@ export function FormSpec_migrateTo<FieldType>(outputVersion: FormSpec_FormSpecOu
|
|
|
84
84
|
export function FormSpec_decodeFormSpec<FieldType>(inputVersion: FormSpec_FormSpecInput_$union, formSpecJson: string): FormSpec_FormSpecVersion$1<FieldType> {
|
|
85
85
|
if (inputVersion.tag === /* Latest */ 0) {
|
|
86
86
|
}
|
|
87
|
-
const matchValue: FSharpResult$2_$union<Spec_FormSpec$1<Spec_FieldType_$union>, string> = fromString<Spec_FormSpec$1<Spec_FieldType_$union>>(uncurry2(((()
|
|
88
|
-
throw new Error("🚀 LIBERATION FORK CONFIRMED: generateDecoder entry point reached!");
|
|
89
|
-
})(), Auto_generateBoxedDecoder_Z6670B51(Spec_FormSpec$1_$reflection(Spec_FieldType_$reflection()), undefined, undefined))), formSpecJson);
|
|
87
|
+
const matchValue: FSharpResult$2_$union<Spec_FormSpec$1<Spec_FieldType_$union>, string> = fromString<Spec_FormSpec$1<Spec_FieldType_$union>>(uncurry2(Auto_generateBoxedDecoder_Z6670B51(Spec_FormSpec$1_$reflection(Spec_FieldType_$reflection()), undefined, undefined)), formSpecJson);
|
|
90
88
|
if (matchValue.tag === /* Error */ 1) {
|
|
91
89
|
const err: string = matchValue.fields[0];
|
|
92
90
|
throw new Error("The input format does not match 3.0.0");
|
|
@@ -4,14 +4,14 @@ import { Result_Bind, Result_Map, FSharpResult$2_Ok, FSharpResult$2_Error, FShar
|
|
|
4
4
|
import { tryParse as tryParse_2 } from "@fable-org/fable-library-js/Guid.js";
|
|
5
5
|
import { toString as toString_12, FSharpRef } from "@fable-org/fable-library-js/Types.js";
|
|
6
6
|
import { float32 as float32_1, uint32 as uint32_1, int32, uint16 as uint16_1, int16 as int16_1, uint8, tryParse as tryParse_3, int8, float64 } from "@fable-org/fable-library-js/Int32.js";
|
|
7
|
-
import { parse, fromInt32, uint64 as uint64_1,
|
|
7
|
+
import { parse, fromInt32, toUInt64, uint64 as uint64_1, int64 as int64_1, fromFloat64, toInt64, toFloat64 } from "@fable-org/fable-library-js/BigInt.js";
|
|
8
8
|
import { tryParse as tryParse_4 } from "@fable-org/fable-library-js/Long.js";
|
|
9
9
|
import { tryParse as tryParse_5, decimal as decimal_1 } from "@fable-org/fable-library-js/Decimal.js";
|
|
10
10
|
import Decimal from "@fable-org/fable-library-js/Decimal.js";
|
|
11
11
|
import { toUniversalTime, tryParse as tryParse_6, minValue } from "@fable-org/fable-library-js/Date.js";
|
|
12
12
|
import { tryParse as tryParse_7, minValue as minValue_1 } from "@fable-org/fable-library-js/DateOffset.js";
|
|
13
13
|
import { tryParse as tryParse_8 } from "@fable-org/fable-library-js/TimeSpan.js";
|
|
14
|
-
import { map as map_4, value as
|
|
14
|
+
import { map as map_4, value as value_45, defaultArg, some, Option } from "@fable-org/fable-library-js/Option.js";
|
|
15
15
|
import { ofArray, toArray, map as map_1, length, singleton, append as append_1, tail as tail_1, head as head_1, isEmpty, ofSeq, empty, reverse, fold, FSharpList, tryLast, cons } from "@fable-org/fable-library-js/List.js";
|
|
16
16
|
import { IComparable, int16ToString, numberHash, compare, comparePrimitives, uncurry3, defaultOf, uncurry2, int32ToString } from "@fable-org/fable-library-js/Util.js";
|
|
17
17
|
import { map as map_2, tryFind, foldBack, fill, setItem, fold as fold_1, item } from "@fable-org/fable-library-js/Array.js";
|
|
@@ -20,8 +20,6 @@ import { getGenerics, getGenericTypeDefinition, makeTuple, getTupleElements, isT
|
|
|
20
20
|
import { empty as empty_1, map as map_3, tryFind as tryFind_1, add, ofSeq as ofSeq_1, FSharpMap, ofList } from "@fable-org/fable-library-js/Map.js";
|
|
21
21
|
import { FSharpSet, ofSeq as ofSeq_2 } from "@fable-org/fable-library-js/Set.js";
|
|
22
22
|
|
|
23
|
-
throw new Error("🚀 LIBERATION FORK CONFIRMED: Thoth.Json.Decode module loaded from liberation fork!");
|
|
24
|
-
|
|
25
23
|
export function Helpers_isUndefined(o: any): boolean {
|
|
26
24
|
return (typeof o) === "undefined";
|
|
27
25
|
}
|
|
@@ -308,45 +306,64 @@ export const uint32 = (path: string): ((arg0: any) => FSharpResult$2_$union<uint
|
|
|
308
306
|
}
|
|
309
307
|
});
|
|
310
308
|
|
|
311
|
-
export
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
309
|
+
export function int64(path: string, value_1: any): FSharpResult$2_$union<int64_1, [string, ErrorReason_$union]> {
|
|
310
|
+
if (typeof value_1 === "number") {
|
|
311
|
+
const floatVal: float64 = value_1;
|
|
312
|
+
if ((floatVal >= toFloat64(-9223372036854775808n)) && (floatVal <= toFloat64(9223372036854775807n))) {
|
|
313
|
+
return FSharpResult$2_Ok<int64_1, [string, ErrorReason_$union]>(toInt64(fromFloat64(floatVal)));
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
return FSharpResult$2_Error<int64_1, [string, ErrorReason_$union]>([path, ErrorReason_BadPrimitive("an int64", value_1)] as [string, ErrorReason_$union]);
|
|
317
|
+
}
|
|
317
318
|
}
|
|
318
|
-
else if (typeof
|
|
319
|
+
else if (typeof value_1 === "string") {
|
|
319
320
|
let matchValue: [boolean, int64_1];
|
|
320
321
|
let outArg: int64_1 = 0n;
|
|
321
|
-
matchValue = ([tryParse_4(
|
|
322
|
+
matchValue = ([tryParse_4(value_1, 511, false, 64, new FSharpRef<int64_1>((): int64_1 => outArg, (v: int64_1): void => {
|
|
322
323
|
outArg = v;
|
|
323
324
|
})), outArg] as [boolean, int64_1]);
|
|
324
|
-
|
|
325
|
+
if (matchValue[0]) {
|
|
326
|
+
return FSharpResult$2_Ok<int64_1, [string, ErrorReason_$union]>(matchValue[1]);
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
return FSharpResult$2_Error<int64_1, [string, ErrorReason_$union]>([path, ErrorReason_BadPrimitive("an int64", value_1)] as [string, ErrorReason_$union]);
|
|
330
|
+
}
|
|
325
331
|
}
|
|
326
332
|
else {
|
|
327
|
-
return FSharpResult$2_Error<int64_1, [string, ErrorReason_$union]>([
|
|
333
|
+
return FSharpResult$2_Error<int64_1, [string, ErrorReason_$union]>([path, ErrorReason_BadPrimitive("an int64", value_1)] as [string, ErrorReason_$union]);
|
|
328
334
|
}
|
|
329
|
-
}
|
|
335
|
+
}
|
|
330
336
|
|
|
331
|
-
export
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
if ((typeof value_3) === "number") {
|
|
335
|
-
const value_1_1: float64 = value_3;
|
|
336
|
-
return (isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1) ? (((toFloat64(0n) <= value_1_1) && (value_1_1 <= toFloat64(18446744073709551615n))) ? FSharpResult$2_Ok<uint64_1, [string, ErrorReason_$union]>(toUInt64(fromFloat64(value_1_1))) : FSharpResult$2_Error<uint64_1, [string, ErrorReason_$union]>([path_1, ErrorReason_BadPrimitiveExtra("an uint64", value_1_1, "Value was either too large or too small for an uint64")] as [string, ErrorReason_$union])) : FSharpResult$2_Error<uint64_1, [string, ErrorReason_$union]>([path_1, ErrorReason_BadPrimitiveExtra("an uint64", value_1_1, "Value is not an integral value")] as [string, ErrorReason_$union]);
|
|
337
|
+
export function uint64(path: string, value_1: any): FSharpResult$2_$union<uint64_1, [string, ErrorReason_$union]> {
|
|
338
|
+
if (typeof value_1 === "bigint") {
|
|
339
|
+
return FSharpResult$2_Ok<uint64_1, [string, ErrorReason_$union]>(value_1);
|
|
337
340
|
}
|
|
338
|
-
else if (typeof
|
|
341
|
+
else if (typeof value_1 === "number") {
|
|
342
|
+
const floatVal: float64 = value_1;
|
|
343
|
+
if (((floatVal >= 0) && (floatVal <= toFloat64(18446744073709551615n))) && (floatVal === Math.floor(floatVal))) {
|
|
344
|
+
return FSharpResult$2_Ok<uint64_1, [string, ErrorReason_$union]>(toUInt64(fromFloat64(floatVal)));
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
return FSharpResult$2_Error<uint64_1, [string, ErrorReason_$union]>([path, ErrorReason_BadPrimitive("an uint64", value_1)] as [string, ErrorReason_$union]);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
else if (typeof value_1 === "string") {
|
|
339
351
|
let matchValue: [boolean, uint64_1];
|
|
340
352
|
let outArg: uint64_1 = 0n;
|
|
341
|
-
matchValue = ([tryParse_4(
|
|
353
|
+
matchValue = ([tryParse_4(value_1, 511, true, 64, new FSharpRef<uint64_1>((): uint64_1 => outArg, (v: uint64_1): void => {
|
|
342
354
|
outArg = v;
|
|
343
355
|
})), outArg] as [boolean, uint64_1]);
|
|
344
|
-
|
|
356
|
+
if (matchValue[0]) {
|
|
357
|
+
return FSharpResult$2_Ok<uint64_1, [string, ErrorReason_$union]>(matchValue[1]);
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
return FSharpResult$2_Error<uint64_1, [string, ErrorReason_$union]>([path, ErrorReason_BadPrimitive("an uint64", value_1)] as [string, ErrorReason_$union]);
|
|
361
|
+
}
|
|
345
362
|
}
|
|
346
363
|
else {
|
|
347
|
-
return FSharpResult$2_Error<uint64_1, [string, ErrorReason_$union]>([
|
|
364
|
+
return FSharpResult$2_Error<uint64_1, [string, ErrorReason_$union]>([path, ErrorReason_BadPrimitive("an uint64", value_1)] as [string, ErrorReason_$union]);
|
|
348
365
|
}
|
|
349
|
-
}
|
|
366
|
+
}
|
|
350
367
|
|
|
351
368
|
export function bigint(path: string, value_1: any): FSharpResult$2_$union<bigint, [string, ErrorReason_$union]> {
|
|
352
369
|
if ((typeof value_1) === "number") {
|
|
@@ -579,7 +596,7 @@ export function optionalAt<value>(fieldNames: FSharpList<string>, decoder: ((arg
|
|
|
579
596
|
}
|
|
580
597
|
}
|
|
581
598
|
else {
|
|
582
|
-
return
|
|
599
|
+
return value_45(_arg[2]);
|
|
583
600
|
}
|
|
584
601
|
}
|
|
585
602
|
|
|
@@ -628,7 +645,7 @@ export function at<value>(fieldNames: FSharpList<string>, decoder: ((arg0: strin
|
|
|
628
645
|
return decoder(_arg[0], _arg[1]);
|
|
629
646
|
}
|
|
630
647
|
else {
|
|
631
|
-
return
|
|
648
|
+
return value_45(_arg[2]);
|
|
632
649
|
}
|
|
633
650
|
}
|
|
634
651
|
|
|
@@ -1651,7 +1668,7 @@ function mixedArray(offset: int32, decoders: ((arg0: string) => ((arg0: any) =>
|
|
|
1651
1668
|
function makeUnion(extra: FSharpMap<string, FSharpRef<((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))>>, caseStrategy: CaseStrategy_$union, t: any, name: string, path: string, values: any[]): FSharpResult$2_$union<any, [string, ErrorReason_$union]> {
|
|
1652
1669
|
const uci: Option<any> = tryFind<any>((x: any): boolean => (name_3(x) === name), getUnionCases(t, true));
|
|
1653
1670
|
if (uci != null) {
|
|
1654
|
-
const uci_1: any =
|
|
1671
|
+
const uci_1: any = value_45(uci);
|
|
1655
1672
|
const decoders: ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))[] = map_2<any, ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))>((fi: any): ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>)) => autoDecoder(extra, caseStrategy, false, fi[1]), getUnionCaseFields(uci_1));
|
|
1656
1673
|
return Result_Map<FSharpList<any>, any, [string, ErrorReason_$union]>((values_2: FSharpList<any>): any => makeUnion_1(uci_1, toArray<any>(values_2), true), ((decoders.length === 0) && (values.length <= 1)) ? FSharpResult$2_Ok<FSharpList<any>, [string, ErrorReason_$union]>(empty<any>()) : mixedArray(1, decoders, path, values));
|
|
1657
1674
|
}
|
|
@@ -1880,19 +1897,19 @@ function autoDecoder(extra: FSharpMap<string, FSharpRef<((arg0: string) => ((arg
|
|
|
1880
1897
|
case "System.Single":
|
|
1881
1898
|
return (path_28: string): ((arg0: any) => FSharpResult$2_$union<float32_1, [string, ErrorReason_$union]>) => ((value_37: any): FSharpResult$2_$union<float32_1, [string, ErrorReason_$union]> => float32(path_28, value_37));
|
|
1882
1899
|
case "System.Int64":
|
|
1883
|
-
return int64;
|
|
1900
|
+
return (path_29: string): ((arg0: any) => FSharpResult$2_$union<int64_1, [string, ErrorReason_$union]>) => ((value_38: any): FSharpResult$2_$union<int64_1, [string, ErrorReason_$union]> => int64(path_29, value_38));
|
|
1884
1901
|
case "System.UInt64":
|
|
1885
|
-
return uint64;
|
|
1902
|
+
return (path_30: string): ((arg0: any) => FSharpResult$2_$union<uint64_1, [string, ErrorReason_$union]>) => ((value_39: any): FSharpResult$2_$union<uint64_1, [string, ErrorReason_$union]> => uint64(path_30, value_39));
|
|
1886
1903
|
case "System.Numerics.BigInteger":
|
|
1887
|
-
return (
|
|
1904
|
+
return (path_31: string): ((arg0: any) => FSharpResult$2_$union<bigint, [string, ErrorReason_$union]>) => ((value_40: any): FSharpResult$2_$union<bigint, [string, ErrorReason_$union]> => bigint(path_31, value_40));
|
|
1888
1905
|
case "System.DateTime":
|
|
1889
|
-
return (
|
|
1906
|
+
return (path_32: string): ((arg0: any) => FSharpResult$2_$union<Date, [string, ErrorReason_$union]>) => ((value_41: any): FSharpResult$2_$union<Date, [string, ErrorReason_$union]> => datetimeUtc(path_32, value_41));
|
|
1890
1907
|
case "System.DateTimeOffset":
|
|
1891
|
-
return (
|
|
1908
|
+
return (path_33: string): ((arg0: any) => FSharpResult$2_$union<Date, [string, ErrorReason_$union]>) => ((value_42: any): FSharpResult$2_$union<Date, [string, ErrorReason_$union]> => datetimeOffset(path_33, value_42));
|
|
1892
1909
|
case "System.TimeSpan":
|
|
1893
|
-
return (
|
|
1910
|
+
return (path_34: string): ((arg0: any) => FSharpResult$2_$union<number, [string, ErrorReason_$union]>) => ((value_43: any): FSharpResult$2_$union<number, [string, ErrorReason_$union]> => timespan(path_34, value_43));
|
|
1894
1911
|
case "System.Guid":
|
|
1895
|
-
return (
|
|
1912
|
+
return (path_35: string): ((arg0: any) => FSharpResult$2_$union<string, [string, ErrorReason_$union]>) => ((value_44: any): FSharpResult$2_$union<string, [string, ErrorReason_$union]> => guid(path_35, value_44));
|
|
1896
1913
|
case "System.Object":
|
|
1897
1914
|
return (_arg_6: string): ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>) => (FSharpResult$2_Ok);
|
|
1898
1915
|
default:
|
|
@@ -1901,14 +1918,14 @@ function autoDecoder(extra: FSharpMap<string, FSharpRef<((arg0: string) => ((arg
|
|
|
1901
1918
|
}
|
|
1902
1919
|
}
|
|
1903
1920
|
else {
|
|
1904
|
-
const decoderRef: FSharpRef<((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))> =
|
|
1921
|
+
const decoderRef: FSharpRef<((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))> = value_45(matchValue);
|
|
1905
1922
|
return (path: string): ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>) => ((value_1: any): FSharpResult$2_$union<any, [string, ErrorReason_$union]> => decoderRef.contents(path)(value_1));
|
|
1906
1923
|
}
|
|
1907
1924
|
}
|
|
1908
1925
|
|
|
1909
1926
|
function makeExtra(extra: Option<ExtraCoders>): FSharpMap<string, FSharpRef<((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))>> {
|
|
1910
1927
|
if (extra != null) {
|
|
1911
|
-
return map_3<string, [((arg0: any) => any), ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))], FSharpRef<((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))>>((_arg: string, tupledArg: [((arg0: any) => any), ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))]): FSharpRef<((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))> => (new FSharpRef<((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))>(tupledArg[1])),
|
|
1928
|
+
return map_3<string, [((arg0: any) => any), ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))], FSharpRef<((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))>>((_arg: string, tupledArg: [((arg0: any) => any), ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))]): FSharpRef<((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))> => (new FSharpRef<((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))>(tupledArg[1])), value_45(extra).Coders);
|
|
1912
1929
|
}
|
|
1913
1930
|
else {
|
|
1914
1931
|
return empty_1<string, FSharpRef<((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))>>({
|
|
@@ -2,10 +2,10 @@ import { decimal as decimal_1, toString as toString_1 } from "@fable-org/fable-l
|
|
|
2
2
|
import { comparePrimitives, Lazy, IDisposable, disposeSafe, IEnumerator, getEnumerator, defaultOf } from "@fable-org/fable-library-js/Util.js";
|
|
3
3
|
import { map as map_1, FSharpList } from "@fable-org/fable-library-js/List.js";
|
|
4
4
|
import { empty, map as map_5, tryFind, add, FSharpMap, toList } from "@fable-org/fable-library-js/Map.js";
|
|
5
|
-
import { uint64 as uint64_1, int64 as int64_1, toString as toString_2 } from "@fable-org/fable-library-js/BigInt.js";
|
|
5
|
+
import { uint64 as uint64_1, int64 as int64_1, toFloat64, compare, toString as toString_2 } from "@fable-org/fable-library-js/BigInt.js";
|
|
6
6
|
import { toString as toString_3 } from "@fable-org/fable-library-js/Date.js";
|
|
7
7
|
import { toString as toString_4 } from "@fable-org/fable-library-js/TimeSpan.js";
|
|
8
|
-
import { defaultArg, value as
|
|
8
|
+
import { defaultArg, value as value_46, Option, map as map_2, defaultArgWith, some } from "@fable-org/fable-library-js/Option.js";
|
|
9
9
|
import { float32, float64, uint32, uint16, int16, uint8, int8, int32 } from "@fable-org/fable-library-js/Int32.js";
|
|
10
10
|
import { toString as toString_5, FSharpRef } from "@fable-org/fable-library-js/Types.js";
|
|
11
11
|
import { class_type, TypeInfo, getGenerics, getGenericTypeDefinition, getTupleFields, getTupleElements, isTuple, isGenericType, getEnumUnderlyingType, isEnum, getElementType, isArray, getUnionCaseFields, getUnionFields, isUnion, getRecordElements, getRecordField, name, isRecord, fullName as fullName_1 } from "@fable-org/fable-library-js/Reflection.js";
|
|
@@ -134,11 +134,21 @@ export function timespan(value: number): any {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
export function int64(value: int64_1): any {
|
|
137
|
-
|
|
137
|
+
if ((compare(value, -9007199254740991n) >= 0) && (compare(value, 9007199254740991n) <= 0)) {
|
|
138
|
+
return toFloat64(value);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
return String(value);
|
|
142
|
+
}
|
|
138
143
|
}
|
|
139
144
|
|
|
140
145
|
export function uint64(value: uint64_1): any {
|
|
141
|
-
|
|
146
|
+
if (compare(value, 9007199254740991n) <= 0) {
|
|
147
|
+
return toFloat64(value);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
return String(value);
|
|
151
|
+
}
|
|
142
152
|
}
|
|
143
153
|
|
|
144
154
|
export function unit(): any {
|
|
@@ -402,6 +412,10 @@ function autoEncoder(extra: FSharpMap<string, FSharpRef<((arg0: any) => any)>>,
|
|
|
402
412
|
return (value_36: float64): any => value_36;
|
|
403
413
|
case "System.Single":
|
|
404
414
|
return (value_38: float32): any => value_38;
|
|
415
|
+
case "System.Int64":
|
|
416
|
+
return int64;
|
|
417
|
+
case "System.UInt64":
|
|
418
|
+
return uint64;
|
|
405
419
|
case "System.DateTime":
|
|
406
420
|
return datetime;
|
|
407
421
|
case "System.DateTimeOffset":
|
|
@@ -418,14 +432,14 @@ function autoEncoder(extra: FSharpMap<string, FSharpRef<((arg0: any) => any)>>,
|
|
|
418
432
|
}
|
|
419
433
|
}
|
|
420
434
|
else {
|
|
421
|
-
const encoderRef: FSharpRef<((arg0: any) => any)> =
|
|
435
|
+
const encoderRef: FSharpRef<((arg0: any) => any)> = value_46(matchValue);
|
|
422
436
|
return (v: any): any => encoderRef.contents(v);
|
|
423
437
|
}
|
|
424
438
|
}
|
|
425
439
|
|
|
426
440
|
function makeExtra(extra: Option<ExtraCoders>): FSharpMap<string, FSharpRef<((arg0: any) => any)>> {
|
|
427
441
|
if (extra != null) {
|
|
428
|
-
return map_5<string, [((arg0: any) => any), ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))], FSharpRef<((arg0: any) => any)>>((_arg: string, tupledArg: [((arg0: any) => any), ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))]): FSharpRef<((arg0: any) => any)> => (new FSharpRef<((arg0: any) => any)>(tupledArg[0])),
|
|
442
|
+
return map_5<string, [((arg0: any) => any), ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))], FSharpRef<((arg0: any) => any)>>((_arg: string, tupledArg: [((arg0: any) => any), ((arg0: string) => ((arg0: any) => FSharpResult$2_$union<any, [string, ErrorReason_$union]>))]): FSharpRef<((arg0: any) => any)> => (new FSharpRef<((arg0: any) => any)>(tupledArg[0])), value_46(extra).Coders);
|
|
429
443
|
}
|
|
430
444
|
else {
|
|
431
445
|
return empty<string, FSharpRef<((arg0: any) => any)>>({
|