@f1studio/form-spec 5.0.0-alpha.128 → 5.0.0-alpha.129
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 +1 -1
- package/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.d.ts.map +1 -1
- package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts +1 -1
- package/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.d.ts.map +1 -1
- package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts +3 -3
- package/FormSpec.FS/Interop/FormSpec.Api.Helpers.d.ts.map +1 -1
- package/FormSpec.TS/FormSpec.FS/BlueprintValidation.js +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +21 -20
- 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 +20 -20
- 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/Adapters/CorEMR/FormSpecToCoreMRInsert.js +21 -21
- package/FormSpec.TS/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.js +105 -41
- 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 +214 -51
- 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 +8 -8
- 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 +12 -12
- 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 +2 -2
- 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 +4 -4
- package/FormSpec.TS/FormSpec.FS/PathwayExecutor.js.map +1 -1
- package/FormSpec.TS/FormSpec.FS/PathwayExecutor.ts.map +1 -1
- package/FormSpec.TS/{fable_modules/Thoth.Json.10.4.1/Decode.fs.js → Thoth.Json/packages/Thoth.Json/Decode.js} +119 -113
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.js.map +1 -0
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Decode.ts.map +1 -0
- package/FormSpec.TS/{fable_modules/Thoth.Json.10.4.1/Encode.fs.js → Thoth.Json/packages/Thoth.Json/Encode.js} +7 -7
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.js.map +1 -0
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Encode.ts.map +1 -0
- package/FormSpec.TS/{fable_modules/Thoth.Json.10.4.1/Extra.fs.js → Thoth.Json/packages/Thoth.Json/Extra.js} +4 -4
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Extra.js.map +1 -0
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Extra.ts.map +1 -0
- package/FormSpec.TS/{fable_modules/Thoth.Json.10.4.1/Types.fs.js → Thoth.Json/packages/Thoth.Json/Types.js} +2 -2
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Types.js.map +1 -0
- package/FormSpec.TS/Thoth.Json/packages/Thoth.Json/Types.ts.map +1 -0
- package/FormSpec.TS/fable_modules/project_cracked.json +1 -1
- package/README.md +7 -7
- package/{fable_modules/Thoth.Json.10.4.1/Decode.fs.d.ts → Thoth.Json/packages/Thoth.Json/Decode.d.ts} +2 -2
- package/Thoth.Json/packages/Thoth.Json/Decode.d.ts.map +1 -0
- package/{fable_modules/Thoth.Json.10.4.1/Encode.fs.d.ts → Thoth.Json/packages/Thoth.Json/Encode.d.ts} +2 -2
- package/Thoth.Json/packages/Thoth.Json/Encode.d.ts.map +1 -0
- package/Thoth.Json/packages/Thoth.Json/Extra.d.ts +3 -0
- package/Thoth.Json/packages/Thoth.Json/Extra.d.ts.map +1 -0
- package/{fable_modules/Thoth.Json.10.4.1/Types.fs.d.ts → Thoth.Json/packages/Thoth.Json/Types.d.ts} +1 -1
- package/Thoth.Json/packages/Thoth.Json/Types.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/FormSpec.FS/BlueprintValidation.ts +1 -1
- package/src/FormSpec.FS/FormSpecHelpers.ts +1 -1
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CorEMRTemplateToFormSpec.ts +1 -1
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMREncoder.ts +12 -11
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/CoreMRSourceMap.ts +4 -4
- package/src/FormSpec.FS/Integrations/Adapters/CorEMR/FormSpecToCoreMRInsert.ts +3 -3
- package/src/FormSpec.FS/Integrations/CorEMR/TemplateManifestDecoder.ts +95 -16
- package/src/FormSpec.FS/Interop/FormSpec.Api.Helpers.ts +182 -57
- package/src/FormSpec.FS/Interop/FormSpec.Api.Option.ts +2 -2
- package/src/FormSpec.FS/Interop/FormSpec.Values.Api.Option.ts +2 -2
- package/src/FormSpec.FS/Migrator.ts +1 -1
- package/src/FormSpec.FS/PathwayExecutor.ts +1 -1
- package/src/Thoth.Json/packages/Thoth.Json/Decode.ts +1938 -0
- package/src/Thoth.Json/packages/Thoth.Json/Encode.ts +475 -0
- package/src/Thoth.Json/packages/Thoth.Json/Extra.ts +11 -0
- package/src/Thoth.Json/packages/Thoth.Json/Types.ts +176 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs +0 -1768
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.js.map +0 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.ts.map +0 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs +0 -811
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +0 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +0 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs +0 -47
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.js.map +0 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.ts.map +0 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Thoth.Json.fableproj +0 -34
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs +0 -68
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.js.map +0 -1
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.ts.map +0 -1
- package/fable_modules/Thoth.Json.10.4.1/Decode.fs.d.ts.map +0 -1
- package/fable_modules/Thoth.Json.10.4.1/Encode.fs.d.ts.map +0 -1
- package/fable_modules/Thoth.Json.10.4.1/Extra.fs.d.ts +0 -3
- package/fable_modules/Thoth.Json.10.4.1/Extra.fs.d.ts.map +0 -1
- package/fable_modules/Thoth.Json.10.4.1/Types.fs.d.ts.map +0 -1
|
@@ -230,10 +230,10 @@ _export(exports, {
|
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
232
|
const _String = require("@fable-org/fable-library-js/String.js");
|
|
233
|
-
const
|
|
233
|
+
const _Types = require("./Types.js");
|
|
234
234
|
const _Result = require("@fable-org/fable-library-js/Result.js");
|
|
235
235
|
const _Guid = require("@fable-org/fable-library-js/Guid.js");
|
|
236
|
-
const
|
|
236
|
+
const _Types1 = require("@fable-org/fable-library-js/Types.js");
|
|
237
237
|
const _Int32 = require("@fable-org/fable-library-js/Int32.js");
|
|
238
238
|
const _BigInt = require("@fable-org/fable-library-js/BigInt.js");
|
|
239
239
|
const _Long = require("@fable-org/fable-library-js/Long.js");
|
|
@@ -392,7 +392,7 @@ function string(path, value_1) {
|
|
|
392
392
|
} else {
|
|
393
393
|
return (0, _Result.FSharpResult$2_Error)([
|
|
394
394
|
path,
|
|
395
|
-
(0,
|
|
395
|
+
(0, _Types.ErrorReason_BadPrimitive)("a string", value_1)
|
|
396
396
|
]);
|
|
397
397
|
}
|
|
398
398
|
}
|
|
@@ -404,13 +404,13 @@ function char(path, value_1) {
|
|
|
404
404
|
} else {
|
|
405
405
|
return (0, _Result.FSharpResult$2_Error)([
|
|
406
406
|
path,
|
|
407
|
-
(0,
|
|
407
|
+
(0, _Types.ErrorReason_BadPrimitive)("a single character string", value_1)
|
|
408
408
|
]);
|
|
409
409
|
}
|
|
410
410
|
} else {
|
|
411
411
|
return (0, _Result.FSharpResult$2_Error)([
|
|
412
412
|
path,
|
|
413
|
-
(0,
|
|
413
|
+
(0, _Types.ErrorReason_BadPrimitive)("a char", value_1)
|
|
414
414
|
]);
|
|
415
415
|
}
|
|
416
416
|
}
|
|
@@ -419,7 +419,7 @@ function guid(path, value_1) {
|
|
|
419
419
|
let matchValue;
|
|
420
420
|
let outArg = "00000000-0000-0000-0000-000000000000";
|
|
421
421
|
matchValue = [
|
|
422
|
-
(0, _Guid.tryParse)(value_1, new
|
|
422
|
+
(0, _Guid.tryParse)(value_1, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
423
423
|
outArg = v;
|
|
424
424
|
})),
|
|
425
425
|
outArg
|
|
@@ -429,13 +429,13 @@ function guid(path, value_1) {
|
|
|
429
429
|
} else {
|
|
430
430
|
return (0, _Result.FSharpResult$2_Error)([
|
|
431
431
|
path,
|
|
432
|
-
(0,
|
|
432
|
+
(0, _Types.ErrorReason_BadPrimitive)("a guid", value_1)
|
|
433
433
|
]);
|
|
434
434
|
}
|
|
435
435
|
} else {
|
|
436
436
|
return (0, _Result.FSharpResult$2_Error)([
|
|
437
437
|
path,
|
|
438
|
-
(0,
|
|
438
|
+
(0, _Types.ErrorReason_BadPrimitive)("a guid", value_1)
|
|
439
439
|
]);
|
|
440
440
|
}
|
|
441
441
|
}
|
|
@@ -445,7 +445,7 @@ function unit(path, value_1) {
|
|
|
445
445
|
} else {
|
|
446
446
|
return (0, _Result.FSharpResult$2_Error)([
|
|
447
447
|
path,
|
|
448
|
-
(0,
|
|
448
|
+
(0, _Types.ErrorReason_BadPrimitive)("null", value_1)
|
|
449
449
|
]);
|
|
450
450
|
}
|
|
451
451
|
}
|
|
@@ -456,28 +456,28 @@ const sbyte = (path)=>(value_2)=>{
|
|
|
456
456
|
const value_1_1 = value_3;
|
|
457
457
|
return isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1 ? -128 <= value_1_1 && value_1_1 <= 127 ? (0, _Result.FSharpResult$2_Ok)((value_1_1 + 0x80 & 0xFF) - 0x80) : (0, _Result.FSharpResult$2_Error)([
|
|
458
458
|
path_1,
|
|
459
|
-
(0,
|
|
459
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("a sbyte", value_1_1, "Value was either too large or too small for a sbyte")
|
|
460
460
|
]) : (0, _Result.FSharpResult$2_Error)([
|
|
461
461
|
path_1,
|
|
462
|
-
(0,
|
|
462
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("a sbyte", value_1_1, "Value is not an integral value")
|
|
463
463
|
]);
|
|
464
464
|
} else if (typeof value_3 === "string") {
|
|
465
465
|
let matchValue;
|
|
466
466
|
let outArg = 0;
|
|
467
467
|
matchValue = [
|
|
468
|
-
(0, _Int32.tryParse)(value_3, 511, false, 8, new
|
|
468
|
+
(0, _Int32.tryParse)(value_3, 511, false, 8, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
469
469
|
outArg = v | 0;
|
|
470
470
|
})),
|
|
471
471
|
outArg
|
|
472
472
|
];
|
|
473
473
|
return matchValue[0] ? (0, _Result.FSharpResult$2_Ok)(matchValue[1]) : (0, _Result.FSharpResult$2_Error)([
|
|
474
474
|
path_1,
|
|
475
|
-
(0,
|
|
475
|
+
(0, _Types.ErrorReason_BadPrimitive)("a sbyte", value_3)
|
|
476
476
|
]);
|
|
477
477
|
} else {
|
|
478
478
|
return (0, _Result.FSharpResult$2_Error)([
|
|
479
479
|
path_1,
|
|
480
|
-
(0,
|
|
480
|
+
(0, _Types.ErrorReason_BadPrimitive)("a sbyte", value_3)
|
|
481
481
|
]);
|
|
482
482
|
}
|
|
483
483
|
};
|
|
@@ -488,28 +488,28 @@ const byte = (path)=>(value_2)=>{
|
|
|
488
488
|
const value_1_1 = value_3;
|
|
489
489
|
return isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1 ? 0 <= value_1_1 && value_1_1 <= 255 ? (0, _Result.FSharpResult$2_Ok)(value_1_1 & 0xFF) : (0, _Result.FSharpResult$2_Error)([
|
|
490
490
|
path_1,
|
|
491
|
-
(0,
|
|
491
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("a byte", value_1_1, "Value was either too large or too small for a byte")
|
|
492
492
|
]) : (0, _Result.FSharpResult$2_Error)([
|
|
493
493
|
path_1,
|
|
494
|
-
(0,
|
|
494
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("a byte", value_1_1, "Value is not an integral value")
|
|
495
495
|
]);
|
|
496
496
|
} else if (typeof value_3 === "string") {
|
|
497
497
|
let matchValue;
|
|
498
498
|
let outArg = 0;
|
|
499
499
|
matchValue = [
|
|
500
|
-
(0, _Int32.tryParse)(value_3, 511, true, 8, new
|
|
500
|
+
(0, _Int32.tryParse)(value_3, 511, true, 8, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
501
501
|
outArg = v;
|
|
502
502
|
})),
|
|
503
503
|
outArg
|
|
504
504
|
];
|
|
505
505
|
return matchValue[0] ? (0, _Result.FSharpResult$2_Ok)(matchValue[1]) : (0, _Result.FSharpResult$2_Error)([
|
|
506
506
|
path_1,
|
|
507
|
-
(0,
|
|
507
|
+
(0, _Types.ErrorReason_BadPrimitive)("a byte", value_3)
|
|
508
508
|
]);
|
|
509
509
|
} else {
|
|
510
510
|
return (0, _Result.FSharpResult$2_Error)([
|
|
511
511
|
path_1,
|
|
512
|
-
(0,
|
|
512
|
+
(0, _Types.ErrorReason_BadPrimitive)("a byte", value_3)
|
|
513
513
|
]);
|
|
514
514
|
}
|
|
515
515
|
};
|
|
@@ -520,28 +520,28 @@ const int16 = (path)=>(value_2)=>{
|
|
|
520
520
|
const value_1_1 = value_3;
|
|
521
521
|
return isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1 ? -32768 <= value_1_1 && value_1_1 <= 32767 ? (0, _Result.FSharpResult$2_Ok)((value_1_1 + 0x8000 & 0xFFFF) - 0x8000) : (0, _Result.FSharpResult$2_Error)([
|
|
522
522
|
path_1,
|
|
523
|
-
(0,
|
|
523
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("an int16", value_1_1, "Value was either too large or too small for an int16")
|
|
524
524
|
]) : (0, _Result.FSharpResult$2_Error)([
|
|
525
525
|
path_1,
|
|
526
|
-
(0,
|
|
526
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("an int16", value_1_1, "Value is not an integral value")
|
|
527
527
|
]);
|
|
528
528
|
} else if (typeof value_3 === "string") {
|
|
529
529
|
let matchValue;
|
|
530
530
|
let outArg = 0;
|
|
531
531
|
matchValue = [
|
|
532
|
-
(0, _Int32.tryParse)(value_3, 511, false, 16, new
|
|
532
|
+
(0, _Int32.tryParse)(value_3, 511, false, 16, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
533
533
|
outArg = v | 0;
|
|
534
534
|
})),
|
|
535
535
|
outArg
|
|
536
536
|
];
|
|
537
537
|
return matchValue[0] ? (0, _Result.FSharpResult$2_Ok)(matchValue[1]) : (0, _Result.FSharpResult$2_Error)([
|
|
538
538
|
path_1,
|
|
539
|
-
(0,
|
|
539
|
+
(0, _Types.ErrorReason_BadPrimitive)("an int16", value_3)
|
|
540
540
|
]);
|
|
541
541
|
} else {
|
|
542
542
|
return (0, _Result.FSharpResult$2_Error)([
|
|
543
543
|
path_1,
|
|
544
|
-
(0,
|
|
544
|
+
(0, _Types.ErrorReason_BadPrimitive)("an int16", value_3)
|
|
545
545
|
]);
|
|
546
546
|
}
|
|
547
547
|
};
|
|
@@ -552,28 +552,28 @@ const uint16 = (path)=>(value_2)=>{
|
|
|
552
552
|
const value_1_1 = value_3;
|
|
553
553
|
return isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1 ? 0 <= value_1_1 && value_1_1 <= 65535 ? (0, _Result.FSharpResult$2_Ok)(value_1_1 & 0xFFFF) : (0, _Result.FSharpResult$2_Error)([
|
|
554
554
|
path_1,
|
|
555
|
-
(0,
|
|
555
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("an uint16", value_1_1, "Value was either too large or too small for an uint16")
|
|
556
556
|
]) : (0, _Result.FSharpResult$2_Error)([
|
|
557
557
|
path_1,
|
|
558
|
-
(0,
|
|
558
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("an uint16", value_1_1, "Value is not an integral value")
|
|
559
559
|
]);
|
|
560
560
|
} else if (typeof value_3 === "string") {
|
|
561
561
|
let matchValue;
|
|
562
562
|
let outArg = 0;
|
|
563
563
|
matchValue = [
|
|
564
|
-
(0, _Int32.tryParse)(value_3, 511, true, 16, new
|
|
564
|
+
(0, _Int32.tryParse)(value_3, 511, true, 16, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
565
565
|
outArg = v;
|
|
566
566
|
})),
|
|
567
567
|
outArg
|
|
568
568
|
];
|
|
569
569
|
return matchValue[0] ? (0, _Result.FSharpResult$2_Ok)(matchValue[1]) : (0, _Result.FSharpResult$2_Error)([
|
|
570
570
|
path_1,
|
|
571
|
-
(0,
|
|
571
|
+
(0, _Types.ErrorReason_BadPrimitive)("an uint16", value_3)
|
|
572
572
|
]);
|
|
573
573
|
} else {
|
|
574
574
|
return (0, _Result.FSharpResult$2_Error)([
|
|
575
575
|
path_1,
|
|
576
|
-
(0,
|
|
576
|
+
(0, _Types.ErrorReason_BadPrimitive)("an uint16", value_3)
|
|
577
577
|
]);
|
|
578
578
|
}
|
|
579
579
|
};
|
|
@@ -584,28 +584,28 @@ const int = (path)=>(value_2)=>{
|
|
|
584
584
|
const value_1_1 = value_3;
|
|
585
585
|
return isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1 ? -2147483648 <= value_1_1 && value_1_1 <= 2147483647 ? (0, _Result.FSharpResult$2_Ok)(~~value_1_1) : (0, _Result.FSharpResult$2_Error)([
|
|
586
586
|
path_1,
|
|
587
|
-
(0,
|
|
587
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("an int", value_1_1, "Value was either too large or too small for an int")
|
|
588
588
|
]) : (0, _Result.FSharpResult$2_Error)([
|
|
589
589
|
path_1,
|
|
590
|
-
(0,
|
|
590
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("an int", value_1_1, "Value is not an integral value")
|
|
591
591
|
]);
|
|
592
592
|
} else if (typeof value_3 === "string") {
|
|
593
593
|
let matchValue;
|
|
594
594
|
let outArg = 0;
|
|
595
595
|
matchValue = [
|
|
596
|
-
(0, _Int32.tryParse)(value_3, 511, false, 32, new
|
|
596
|
+
(0, _Int32.tryParse)(value_3, 511, false, 32, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
597
597
|
outArg = v | 0;
|
|
598
598
|
})),
|
|
599
599
|
outArg
|
|
600
600
|
];
|
|
601
601
|
return matchValue[0] ? (0, _Result.FSharpResult$2_Ok)(matchValue[1]) : (0, _Result.FSharpResult$2_Error)([
|
|
602
602
|
path_1,
|
|
603
|
-
(0,
|
|
603
|
+
(0, _Types.ErrorReason_BadPrimitive)("an int", value_3)
|
|
604
604
|
]);
|
|
605
605
|
} else {
|
|
606
606
|
return (0, _Result.FSharpResult$2_Error)([
|
|
607
607
|
path_1,
|
|
608
|
-
(0,
|
|
608
|
+
(0, _Types.ErrorReason_BadPrimitive)("an int", value_3)
|
|
609
609
|
]);
|
|
610
610
|
}
|
|
611
611
|
};
|
|
@@ -616,28 +616,28 @@ const uint32 = (path)=>(value_2)=>{
|
|
|
616
616
|
const value_1_1 = value_3;
|
|
617
617
|
return isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1 ? 0 <= value_1_1 && value_1_1 <= 4294967295 ? (0, _Result.FSharpResult$2_Ok)(value_1_1 >>> 0) : (0, _Result.FSharpResult$2_Error)([
|
|
618
618
|
path_1,
|
|
619
|
-
(0,
|
|
619
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("an uint32", value_1_1, "Value was either too large or too small for an uint32")
|
|
620
620
|
]) : (0, _Result.FSharpResult$2_Error)([
|
|
621
621
|
path_1,
|
|
622
|
-
(0,
|
|
622
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("an uint32", value_1_1, "Value is not an integral value")
|
|
623
623
|
]);
|
|
624
624
|
} else if (typeof value_3 === "string") {
|
|
625
625
|
let matchValue;
|
|
626
626
|
let outArg = 0;
|
|
627
627
|
matchValue = [
|
|
628
|
-
(0, _Int32.tryParse)(value_3, 511, true, 32, new
|
|
628
|
+
(0, _Int32.tryParse)(value_3, 511, true, 32, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
629
629
|
outArg = v;
|
|
630
630
|
})),
|
|
631
631
|
outArg
|
|
632
632
|
];
|
|
633
633
|
return matchValue[0] ? (0, _Result.FSharpResult$2_Ok)(matchValue[1]) : (0, _Result.FSharpResult$2_Error)([
|
|
634
634
|
path_1,
|
|
635
|
-
(0,
|
|
635
|
+
(0, _Types.ErrorReason_BadPrimitive)("an uint32", value_3)
|
|
636
636
|
]);
|
|
637
637
|
} else {
|
|
638
638
|
return (0, _Result.FSharpResult$2_Error)([
|
|
639
639
|
path_1,
|
|
640
|
-
(0,
|
|
640
|
+
(0, _Types.ErrorReason_BadPrimitive)("an uint32", value_3)
|
|
641
641
|
]);
|
|
642
642
|
}
|
|
643
643
|
};
|
|
@@ -648,28 +648,28 @@ const int64 = (path)=>(value_2)=>{
|
|
|
648
648
|
const value_1_1 = value_3;
|
|
649
649
|
return isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1 ? (0, _BigInt.toFloat64)(-9223372036854775808n) <= value_1_1 && value_1_1 <= (0, _BigInt.toFloat64)(9223372036854775807n) ? (0, _Result.FSharpResult$2_Ok)((0, _BigInt.toInt64)((0, _BigInt.fromFloat64)(value_1_1))) : (0, _Result.FSharpResult$2_Error)([
|
|
650
650
|
path_1,
|
|
651
|
-
(0,
|
|
651
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("an int64", value_1_1, "Value was either too large or too small for an int64")
|
|
652
652
|
]) : (0, _Result.FSharpResult$2_Error)([
|
|
653
653
|
path_1,
|
|
654
|
-
(0,
|
|
654
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("an int64", value_1_1, "Value is not an integral value")
|
|
655
655
|
]);
|
|
656
656
|
} else if (typeof value_3 === "string") {
|
|
657
657
|
let matchValue;
|
|
658
658
|
let outArg = 0n;
|
|
659
659
|
matchValue = [
|
|
660
|
-
(0, _Long.tryParse)(value_3, 511, false, 64, new
|
|
660
|
+
(0, _Long.tryParse)(value_3, 511, false, 64, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
661
661
|
outArg = v;
|
|
662
662
|
})),
|
|
663
663
|
outArg
|
|
664
664
|
];
|
|
665
665
|
return matchValue[0] ? (0, _Result.FSharpResult$2_Ok)(matchValue[1]) : (0, _Result.FSharpResult$2_Error)([
|
|
666
666
|
path_1,
|
|
667
|
-
(0,
|
|
667
|
+
(0, _Types.ErrorReason_BadPrimitive)("an int64", value_3)
|
|
668
668
|
]);
|
|
669
669
|
} else {
|
|
670
670
|
return (0, _Result.FSharpResult$2_Error)([
|
|
671
671
|
path_1,
|
|
672
|
-
(0,
|
|
672
|
+
(0, _Types.ErrorReason_BadPrimitive)("an int64", value_3)
|
|
673
673
|
]);
|
|
674
674
|
}
|
|
675
675
|
};
|
|
@@ -680,28 +680,28 @@ const uint64 = (path)=>(value_2)=>{
|
|
|
680
680
|
const value_1_1 = value_3;
|
|
681
681
|
return isFinite(value_1_1) && Math.floor(value_1_1) === value_1_1 ? (0, _BigInt.toFloat64)(0n) <= value_1_1 && value_1_1 <= (0, _BigInt.toFloat64)(18446744073709551615n) ? (0, _Result.FSharpResult$2_Ok)((0, _BigInt.toUInt64)((0, _BigInt.fromFloat64)(value_1_1))) : (0, _Result.FSharpResult$2_Error)([
|
|
682
682
|
path_1,
|
|
683
|
-
(0,
|
|
683
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("an uint64", value_1_1, "Value was either too large or too small for an uint64")
|
|
684
684
|
]) : (0, _Result.FSharpResult$2_Error)([
|
|
685
685
|
path_1,
|
|
686
|
-
(0,
|
|
686
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)("an uint64", value_1_1, "Value is not an integral value")
|
|
687
687
|
]);
|
|
688
688
|
} else if (typeof value_3 === "string") {
|
|
689
689
|
let matchValue;
|
|
690
690
|
let outArg = 0n;
|
|
691
691
|
matchValue = [
|
|
692
|
-
(0, _Long.tryParse)(value_3, 511, true, 64, new
|
|
692
|
+
(0, _Long.tryParse)(value_3, 511, true, 64, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
693
693
|
outArg = v;
|
|
694
694
|
})),
|
|
695
695
|
outArg
|
|
696
696
|
];
|
|
697
697
|
return matchValue[0] ? (0, _Result.FSharpResult$2_Ok)(matchValue[1]) : (0, _Result.FSharpResult$2_Error)([
|
|
698
698
|
path_1,
|
|
699
|
-
(0,
|
|
699
|
+
(0, _Types.ErrorReason_BadPrimitive)("an uint64", value_3)
|
|
700
700
|
]);
|
|
701
701
|
} else {
|
|
702
702
|
return (0, _Result.FSharpResult$2_Error)([
|
|
703
703
|
path_1,
|
|
704
|
-
(0,
|
|
704
|
+
(0, _Types.ErrorReason_BadPrimitive)("an uint64", value_3)
|
|
705
705
|
]);
|
|
706
706
|
}
|
|
707
707
|
};
|
|
@@ -714,13 +714,13 @@ function bigint(path, value_1) {
|
|
|
714
714
|
} catch (matchValue) {
|
|
715
715
|
return (0, _Result.FSharpResult$2_Error)([
|
|
716
716
|
path,
|
|
717
|
-
(0,
|
|
717
|
+
(0, _Types.ErrorReason_BadPrimitive)("a bigint", value_1)
|
|
718
718
|
]);
|
|
719
719
|
}
|
|
720
720
|
} else {
|
|
721
721
|
return (0, _Result.FSharpResult$2_Error)([
|
|
722
722
|
path,
|
|
723
|
-
(0,
|
|
723
|
+
(0, _Types.ErrorReason_BadPrimitive)("a bigint", value_1)
|
|
724
724
|
]);
|
|
725
725
|
}
|
|
726
726
|
}
|
|
@@ -730,7 +730,7 @@ function bool(path, value_1) {
|
|
|
730
730
|
} else {
|
|
731
731
|
return (0, _Result.FSharpResult$2_Error)([
|
|
732
732
|
path,
|
|
733
|
-
(0,
|
|
733
|
+
(0, _Types.ErrorReason_BadPrimitive)("a boolean", value_1)
|
|
734
734
|
]);
|
|
735
735
|
}
|
|
736
736
|
}
|
|
@@ -740,7 +740,7 @@ function float(path, value_1) {
|
|
|
740
740
|
} else {
|
|
741
741
|
return (0, _Result.FSharpResult$2_Error)([
|
|
742
742
|
path,
|
|
743
|
-
(0,
|
|
743
|
+
(0, _Types.ErrorReason_BadPrimitive)("a float", value_1)
|
|
744
744
|
]);
|
|
745
745
|
}
|
|
746
746
|
}
|
|
@@ -750,7 +750,7 @@ function float32(path, value_1) {
|
|
|
750
750
|
} else {
|
|
751
751
|
return (0, _Result.FSharpResult$2_Error)([
|
|
752
752
|
path,
|
|
753
|
-
(0,
|
|
753
|
+
(0, _Types.ErrorReason_BadPrimitive)("a float32", value_1)
|
|
754
754
|
]);
|
|
755
755
|
}
|
|
756
756
|
}
|
|
@@ -761,7 +761,7 @@ function decimal(path, value_1) {
|
|
|
761
761
|
let matchValue;
|
|
762
762
|
let outArg = new _Decimal.default("0");
|
|
763
763
|
matchValue = [
|
|
764
|
-
(0, _Decimal.tryParse)(value_1, new
|
|
764
|
+
(0, _Decimal.tryParse)(value_1, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
765
765
|
outArg = v;
|
|
766
766
|
})),
|
|
767
767
|
outArg
|
|
@@ -771,13 +771,13 @@ function decimal(path, value_1) {
|
|
|
771
771
|
} else {
|
|
772
772
|
return (0, _Result.FSharpResult$2_Error)([
|
|
773
773
|
path,
|
|
774
|
-
(0,
|
|
774
|
+
(0, _Types.ErrorReason_BadPrimitive)("a decimal", value_1)
|
|
775
775
|
]);
|
|
776
776
|
}
|
|
777
777
|
} else {
|
|
778
778
|
return (0, _Result.FSharpResult$2_Error)([
|
|
779
779
|
path,
|
|
780
|
-
(0,
|
|
780
|
+
(0, _Types.ErrorReason_BadPrimitive)("a decimal", value_1)
|
|
781
781
|
]);
|
|
782
782
|
}
|
|
783
783
|
}
|
|
@@ -786,7 +786,7 @@ function datetime(path, value_1) {
|
|
|
786
786
|
let matchValue;
|
|
787
787
|
let outArg = (0, _Date.minValue)();
|
|
788
788
|
matchValue = [
|
|
789
|
-
(0, _Date.tryParse)(value_1, new
|
|
789
|
+
(0, _Date.tryParse)(value_1, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
790
790
|
outArg = v;
|
|
791
791
|
})),
|
|
792
792
|
outArg
|
|
@@ -796,13 +796,13 @@ function datetime(path, value_1) {
|
|
|
796
796
|
} else {
|
|
797
797
|
return (0, _Result.FSharpResult$2_Error)([
|
|
798
798
|
path,
|
|
799
|
-
(0,
|
|
799
|
+
(0, _Types.ErrorReason_BadPrimitive)("a datetime", value_1)
|
|
800
800
|
]);
|
|
801
801
|
}
|
|
802
802
|
} else {
|
|
803
803
|
return (0, _Result.FSharpResult$2_Error)([
|
|
804
804
|
path,
|
|
805
|
-
(0,
|
|
805
|
+
(0, _Types.ErrorReason_BadPrimitive)("a datetime", value_1)
|
|
806
806
|
]);
|
|
807
807
|
}
|
|
808
808
|
}
|
|
@@ -811,7 +811,7 @@ function datetimeUtc(path, value_1) {
|
|
|
811
811
|
let matchValue;
|
|
812
812
|
let outArg = (0, _Date.minValue)();
|
|
813
813
|
matchValue = [
|
|
814
|
-
(0, _Date.tryParse)(value_1, new
|
|
814
|
+
(0, _Date.tryParse)(value_1, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
815
815
|
outArg = v;
|
|
816
816
|
})),
|
|
817
817
|
outArg
|
|
@@ -821,13 +821,13 @@ function datetimeUtc(path, value_1) {
|
|
|
821
821
|
} else {
|
|
822
822
|
return (0, _Result.FSharpResult$2_Error)([
|
|
823
823
|
path,
|
|
824
|
-
(0,
|
|
824
|
+
(0, _Types.ErrorReason_BadPrimitive)("a datetime", value_1)
|
|
825
825
|
]);
|
|
826
826
|
}
|
|
827
827
|
} else {
|
|
828
828
|
return (0, _Result.FSharpResult$2_Error)([
|
|
829
829
|
path,
|
|
830
|
-
(0,
|
|
830
|
+
(0, _Types.ErrorReason_BadPrimitive)("a datetime", value_1)
|
|
831
831
|
]);
|
|
832
832
|
}
|
|
833
833
|
}
|
|
@@ -836,7 +836,7 @@ function datetimeLocal(path, value_1) {
|
|
|
836
836
|
let matchValue;
|
|
837
837
|
let outArg = (0, _Date.minValue)();
|
|
838
838
|
matchValue = [
|
|
839
|
-
(0, _Date.tryParse)(value_1, new
|
|
839
|
+
(0, _Date.tryParse)(value_1, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
840
840
|
outArg = v;
|
|
841
841
|
})),
|
|
842
842
|
outArg
|
|
@@ -846,13 +846,13 @@ function datetimeLocal(path, value_1) {
|
|
|
846
846
|
} else {
|
|
847
847
|
return (0, _Result.FSharpResult$2_Error)([
|
|
848
848
|
path,
|
|
849
|
-
(0,
|
|
849
|
+
(0, _Types.ErrorReason_BadPrimitive)("a datetime", value_1)
|
|
850
850
|
]);
|
|
851
851
|
}
|
|
852
852
|
} else {
|
|
853
853
|
return (0, _Result.FSharpResult$2_Error)([
|
|
854
854
|
path,
|
|
855
|
-
(0,
|
|
855
|
+
(0, _Types.ErrorReason_BadPrimitive)("a datetime", value_1)
|
|
856
856
|
]);
|
|
857
857
|
}
|
|
858
858
|
}
|
|
@@ -861,7 +861,7 @@ function datetimeOffset(path, value_1) {
|
|
|
861
861
|
let matchValue;
|
|
862
862
|
let outArg = (0, _DateOffset.minValue)();
|
|
863
863
|
matchValue = [
|
|
864
|
-
(0, _DateOffset.tryParse)(value_1, new
|
|
864
|
+
(0, _DateOffset.tryParse)(value_1, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
865
865
|
outArg = v;
|
|
866
866
|
})),
|
|
867
867
|
outArg
|
|
@@ -871,13 +871,13 @@ function datetimeOffset(path, value_1) {
|
|
|
871
871
|
} else {
|
|
872
872
|
return (0, _Result.FSharpResult$2_Error)([
|
|
873
873
|
path,
|
|
874
|
-
(0,
|
|
874
|
+
(0, _Types.ErrorReason_BadPrimitive)("a datetimeoffset", value_1)
|
|
875
875
|
]);
|
|
876
876
|
}
|
|
877
877
|
} else {
|
|
878
878
|
return (0, _Result.FSharpResult$2_Error)([
|
|
879
879
|
path,
|
|
880
|
-
(0,
|
|
880
|
+
(0, _Types.ErrorReason_BadPrimitive)("a datetime", value_1)
|
|
881
881
|
]);
|
|
882
882
|
}
|
|
883
883
|
}
|
|
@@ -886,7 +886,7 @@ function timespan(path, value_1) {
|
|
|
886
886
|
let matchValue;
|
|
887
887
|
let outArg = 0;
|
|
888
888
|
matchValue = [
|
|
889
|
-
(0, _TimeSpan.tryParse)(value_1, new
|
|
889
|
+
(0, _TimeSpan.tryParse)(value_1, new _Types1.FSharpRef(()=>outArg, (v)=>{
|
|
890
890
|
outArg = v;
|
|
891
891
|
})),
|
|
892
892
|
outArg
|
|
@@ -896,13 +896,13 @@ function timespan(path, value_1) {
|
|
|
896
896
|
} else {
|
|
897
897
|
return (0, _Result.FSharpResult$2_Error)([
|
|
898
898
|
path,
|
|
899
|
-
(0,
|
|
899
|
+
(0, _Types.ErrorReason_BadPrimitive)("a timespan", value_1)
|
|
900
900
|
]);
|
|
901
901
|
}
|
|
902
902
|
} else {
|
|
903
903
|
return (0, _Result.FSharpResult$2_Error)([
|
|
904
904
|
path,
|
|
905
|
-
(0,
|
|
905
|
+
(0, _Types.ErrorReason_BadPrimitive)("a timespan", value_1)
|
|
906
906
|
]);
|
|
907
907
|
}
|
|
908
908
|
}
|
|
@@ -929,14 +929,14 @@ function optional(fieldName, decoder, path, value_1) {
|
|
|
929
929
|
} else {
|
|
930
930
|
return (0, _Result.FSharpResult$2_Error)([
|
|
931
931
|
path,
|
|
932
|
-
(0,
|
|
932
|
+
(0, _Types.ErrorReason_BadType)("an object", value_1)
|
|
933
933
|
]);
|
|
934
934
|
}
|
|
935
935
|
}
|
|
936
936
|
function badPathError(fieldNames, currentPath, value_1) {
|
|
937
937
|
return (0, _Result.FSharpResult$2_Error)([
|
|
938
938
|
(0, _Option.defaultArg)(currentPath, (0, _String.join)(".", (0, _List.cons)("$", fieldNames))),
|
|
939
|
-
(0,
|
|
939
|
+
(0, _Types.ErrorReason_BadPath)("an object with path `" + (0, _String.join)(".", fieldNames) + "`", value_1, (0, _Option.defaultArg)((0, _List.tryLast)(fieldNames), ""))
|
|
940
940
|
]);
|
|
941
941
|
}
|
|
942
942
|
function optionalAt(fieldNames, decoder, firstPath, firstValue) {
|
|
@@ -963,7 +963,7 @@ function optionalAt(fieldNames, decoder, firstPath, firstValue) {
|
|
|
963
963
|
curValue,
|
|
964
964
|
(0, _Result.FSharpResult$2_Error)([
|
|
965
965
|
curPath,
|
|
966
|
-
(0,
|
|
966
|
+
(0, _Types.ErrorReason_BadType)("an object", curValue)
|
|
967
967
|
])
|
|
968
968
|
];
|
|
969
969
|
}
|
|
@@ -996,7 +996,7 @@ function field(fieldName, decoder, path, value_1) {
|
|
|
996
996
|
if (Helpers_isUndefined(fieldValue)) {
|
|
997
997
|
return (0, _Result.FSharpResult$2_Error)([
|
|
998
998
|
path,
|
|
999
|
-
(0,
|
|
999
|
+
(0, _Types.ErrorReason_BadField)("an object with a field named `" + fieldName + "`", value_1)
|
|
1000
1000
|
]);
|
|
1001
1001
|
} else {
|
|
1002
1002
|
return decoder(path + "." + fieldName, fieldValue);
|
|
@@ -1004,7 +1004,7 @@ function field(fieldName, decoder, path, value_1) {
|
|
|
1004
1004
|
} else {
|
|
1005
1005
|
return (0, _Result.FSharpResult$2_Error)([
|
|
1006
1006
|
path,
|
|
1007
|
-
(0,
|
|
1007
|
+
(0, _Types.ErrorReason_BadType)("an object", value_1)
|
|
1008
1008
|
]);
|
|
1009
1009
|
}
|
|
1010
1010
|
}
|
|
@@ -1041,7 +1041,7 @@ function at(fieldNames, decoder, firstPath, firstValue) {
|
|
|
1041
1041
|
curValue,
|
|
1042
1042
|
(0, _Result.FSharpResult$2_Error)([
|
|
1043
1043
|
curPath,
|
|
1044
|
-
(0,
|
|
1044
|
+
(0, _Types.ErrorReason_BadType)("an object", curValue)
|
|
1045
1045
|
])
|
|
1046
1046
|
];
|
|
1047
1047
|
}
|
|
@@ -1073,13 +1073,13 @@ function index(requestedIndex, decoder, path, value_1) {
|
|
|
1073
1073
|
} else {
|
|
1074
1074
|
return (0, _Result.FSharpResult$2_Error)([
|
|
1075
1075
|
currentPath,
|
|
1076
|
-
(0,
|
|
1076
|
+
(0, _Types.ErrorReason_TooSmallArray)("a longer array. Need index `" + (0, _Util.int32ToString)(requestedIndex) + "` but there are only `" + (copyOfStruct = vArray.length, (0, _Util.int32ToString)(copyOfStruct)) + "` entries", value_1)
|
|
1077
1077
|
]);
|
|
1078
1078
|
}
|
|
1079
1079
|
} else {
|
|
1080
1080
|
return (0, _Result.FSharpResult$2_Error)([
|
|
1081
1081
|
currentPath,
|
|
1082
|
-
(0,
|
|
1082
|
+
(0, _Types.ErrorReason_BadPrimitive)("an array", value_1)
|
|
1083
1083
|
]);
|
|
1084
1084
|
}
|
|
1085
1085
|
}
|
|
@@ -1110,7 +1110,7 @@ function list(decoder, path, value_1) {
|
|
|
1110
1110
|
} else {
|
|
1111
1111
|
return (0, _Result.FSharpResult$2_Error)([
|
|
1112
1112
|
path,
|
|
1113
|
-
(0,
|
|
1113
|
+
(0, _Types.ErrorReason_BadPrimitive)("a list", value_1)
|
|
1114
1114
|
]);
|
|
1115
1115
|
}
|
|
1116
1116
|
}
|
|
@@ -1136,7 +1136,7 @@ function seq(decoder, path, value_1) {
|
|
|
1136
1136
|
} else {
|
|
1137
1137
|
return (0, _Result.FSharpResult$2_Error)([
|
|
1138
1138
|
path,
|
|
1139
|
-
(0,
|
|
1139
|
+
(0, _Types.ErrorReason_BadPrimitive)("a seq", value_1)
|
|
1140
1140
|
]);
|
|
1141
1141
|
}
|
|
1142
1142
|
}
|
|
@@ -1163,7 +1163,7 @@ function array(decoder, path, value_1) {
|
|
|
1163
1163
|
} else {
|
|
1164
1164
|
return (0, _Result.FSharpResult$2_Error)([
|
|
1165
1165
|
path,
|
|
1166
|
-
(0,
|
|
1166
|
+
(0, _Types.ErrorReason_BadPrimitive)("an array", value_1)
|
|
1167
1167
|
]);
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
@@ -1173,7 +1173,7 @@ function keys(path, value_1) {
|
|
|
1173
1173
|
} else {
|
|
1174
1174
|
return (0, _Result.FSharpResult$2_Error)([
|
|
1175
1175
|
path,
|
|
1176
|
-
(0,
|
|
1176
|
+
(0, _Types.ErrorReason_BadPrimitive)("an object", value_1)
|
|
1177
1177
|
]);
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
@@ -1207,7 +1207,7 @@ function oneOf(decoders, path, value_1) {
|
|
|
1207
1207
|
if ((0, _List.isEmpty)(decoders_1)) {
|
|
1208
1208
|
return (0, _Result.FSharpResult$2_Error)([
|
|
1209
1209
|
path,
|
|
1210
|
-
(0,
|
|
1210
|
+
(0, _Types.ErrorReason_BadOneOf)(errors)
|
|
1211
1211
|
]);
|
|
1212
1212
|
} else {
|
|
1213
1213
|
const matchValue = fromValue(path, (0, _Util.uncurry2)((0, _List.head)(decoders_1)), value_1);
|
|
@@ -1230,7 +1230,7 @@ function nil(output, path, value_1) {
|
|
|
1230
1230
|
} else {
|
|
1231
1231
|
return (0, _Result.FSharpResult$2_Error)([
|
|
1232
1232
|
path,
|
|
1233
|
-
(0,
|
|
1233
|
+
(0, _Types.ErrorReason_BadPrimitive)("null", value_1)
|
|
1234
1234
|
]);
|
|
1235
1235
|
}
|
|
1236
1236
|
}
|
|
@@ -1243,7 +1243,7 @@ function succeed(output, _arg, _arg_1) {
|
|
|
1243
1243
|
function fail(msg, path, _arg) {
|
|
1244
1244
|
return (0, _Result.FSharpResult$2_Error)([
|
|
1245
1245
|
path,
|
|
1246
|
-
(0,
|
|
1246
|
+
(0, _Types.ErrorReason_FailMessage)(msg)
|
|
1247
1247
|
]);
|
|
1248
1248
|
}
|
|
1249
1249
|
function andThen(cb, decoder, path, value_1) {
|
|
@@ -1708,7 +1708,7 @@ function object(builder, path, v) {
|
|
|
1708
1708
|
if ((0, _List.length)(errors) > 1) {
|
|
1709
1709
|
return (0, _Result.FSharpResult$2_Error)([
|
|
1710
1710
|
path,
|
|
1711
|
-
(0,
|
|
1711
|
+
(0, _Types.ErrorReason_BadOneOf)((0, _List.map)((tupledArg)=>errorToString(tupledArg[0], tupledArg[1]), errors))
|
|
1712
1712
|
]);
|
|
1713
1713
|
} else {
|
|
1714
1714
|
return (0, _Result.FSharpResult$2_Error)((0, _List.head)(matchValue));
|
|
@@ -1971,7 +1971,7 @@ function autoObject(decoderInfos, path, value_1) {
|
|
|
1971
1971
|
if (!(value_1 === null ? false : Object.getPrototypeOf(value_1 || false) === Object.prototype)) {
|
|
1972
1972
|
return (0, _Result.FSharpResult$2_Error)([
|
|
1973
1973
|
path,
|
|
1974
|
-
(0,
|
|
1974
|
+
(0, _Types.ErrorReason_BadPrimitive)("an object", value_1)
|
|
1975
1975
|
]);
|
|
1976
1976
|
} else {
|
|
1977
1977
|
return (0, _Array.foldBack)((tupledArg, acc)=>{
|
|
@@ -1989,7 +1989,7 @@ function autoObject2(keyDecoder, valueDecoder, path, value_1) {
|
|
|
1989
1989
|
if (!(value_1 === null ? false : Object.getPrototypeOf(value_1 || false) === Object.prototype)) {
|
|
1990
1990
|
return (0, _Result.FSharpResult$2_Error)([
|
|
1991
1991
|
path,
|
|
1992
|
-
(0,
|
|
1992
|
+
(0, _Types.ErrorReason_BadPrimitive)("an object", value_1)
|
|
1993
1993
|
]);
|
|
1994
1994
|
} else {
|
|
1995
1995
|
return (0, _Seq.fold)((acc, name)=>{
|
|
@@ -2022,7 +2022,7 @@ function mixedArray(offset, decoders, path, values) {
|
|
|
2022
2022
|
if (expectedLength !== values.length) {
|
|
2023
2023
|
return (0, _Result.FSharpResult$2_Error)([
|
|
2024
2024
|
path,
|
|
2025
|
-
(0,
|
|
2025
|
+
(0, _Types.ErrorReason_FailMessage)((arg_1 = values.length | 0, (0, _String.toText)((0, _String.printf)("Expected array of length %i but got %i"))(expectedLength)(arg_1)))
|
|
2026
2026
|
]);
|
|
2027
2027
|
} else {
|
|
2028
2028
|
let result = (0, _Result.FSharpResult$2_Ok)((0, _List.empty)());
|
|
@@ -2047,20 +2047,20 @@ function makeUnion(extra, caseStrategy, t, name, path, values) {
|
|
|
2047
2047
|
} else {
|
|
2048
2048
|
return (0, _Result.FSharpResult$2_Error)([
|
|
2049
2049
|
path,
|
|
2050
|
-
(0,
|
|
2050
|
+
(0, _Types.ErrorReason_FailMessage)("Cannot find case " + name + " in " + (0, _Reflection.fullName)(t))
|
|
2051
2051
|
]);
|
|
2052
2052
|
}
|
|
2053
2053
|
}
|
|
2054
2054
|
function autoDecodeRecordsAndUnions(extra, caseStrategy, isOptional, t) {
|
|
2055
2055
|
let arg;
|
|
2056
|
-
const decoderRef = new
|
|
2056
|
+
const decoderRef = new _Types1.FSharpRef((0, _Util.defaultOf)());
|
|
2057
2057
|
let extra_1;
|
|
2058
2058
|
const matchValue = (0, _Reflection.fullName)(t);
|
|
2059
2059
|
extra_1 = matchValue === "" ? extra : (0, _Map.add)(matchValue, decoderRef, extra);
|
|
2060
2060
|
let decoder;
|
|
2061
2061
|
if ((0, _Reflection.isRecord)(t, true)) {
|
|
2062
2062
|
const decoders = (0, _Array.map)((fi)=>[
|
|
2063
|
-
(0,
|
|
2063
|
+
(0, _Types.Util_Casing_convert)(caseStrategy, (0, _Reflection.name)(fi)),
|
|
2064
2064
|
autoDecoder(extra_1, caseStrategy, false, fi[1])
|
|
2065
2065
|
], (0, _Reflection.getRecordElements)(t, true));
|
|
2066
2066
|
decoder = (path)=>(value_1)=>(0, _Result.Result_Map)((xs)=>(0, _Reflection.makeRecord)(t, (0, _List.toArray)(xs), true), autoObject(decoders, path, value_1));
|
|
@@ -2074,14 +2074,14 @@ function autoDecodeRecordsAndUnions(extra, caseStrategy, isOptional, t) {
|
|
|
2074
2074
|
} else {
|
|
2075
2075
|
return (0, _Result.FSharpResult$2_Error)([
|
|
2076
2076
|
path_1,
|
|
2077
|
-
(0,
|
|
2077
|
+
(0, _Types.ErrorReason_BadPrimitive)("a string or array", value_2)
|
|
2078
2078
|
]);
|
|
2079
2079
|
}
|
|
2080
2080
|
};
|
|
2081
2081
|
} else if (isOptional) {
|
|
2082
2082
|
decoder = (path_2)=>(value_3)=>(0, _Result.FSharpResult$2_Error)([
|
|
2083
2083
|
path_2,
|
|
2084
|
-
(0,
|
|
2084
|
+
(0, _Types.ErrorReason_BadType)("an extra coder for " + (0, _Reflection.fullName)(t), value_3)
|
|
2085
2085
|
]);
|
|
2086
2086
|
} else {
|
|
2087
2087
|
throw new Error((arg = (0, _Reflection.fullName)(t), (0, _String.toText)((0, _String.printf)("Cannot generate auto decoder for %s. Please pass an extra decoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders"))(arg)));
|
|
@@ -2115,7 +2115,7 @@ function autoDecoder(extra, caseStrategy, isOptional, t) {
|
|
|
2115
2115
|
GetHashCode: _Util.numberHash
|
|
2116
2116
|
}) ? (0, _Result.FSharpResult$2_Ok)((0, _Reflection.parseEnum)(t_2, enumValue.toString())) : (0, _Result.FSharpResult$2_Error)([
|
|
2117
2117
|
path_3,
|
|
2118
|
-
(0,
|
|
2118
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)((0, _Reflection.fullName)(t_2), value_5, "Unkown value provided for the enum")
|
|
2119
2119
|
]);
|
|
2120
2120
|
}
|
|
2121
2121
|
};
|
|
@@ -2134,7 +2134,7 @@ function autoDecoder(extra, caseStrategy, isOptional, t) {
|
|
|
2134
2134
|
GetHashCode: _Util.numberHash
|
|
2135
2135
|
}) ? (0, _Result.FSharpResult$2_Ok)((0, _Reflection.parseEnum)(t_3, enumValue_1.toString())) : (0, _Result.FSharpResult$2_Error)([
|
|
2136
2136
|
path_5,
|
|
2137
|
-
(0,
|
|
2137
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)((0, _Reflection.fullName)(t_3), value_8, "Unkown value provided for the enum")
|
|
2138
2138
|
]);
|
|
2139
2139
|
}
|
|
2140
2140
|
};
|
|
@@ -2153,7 +2153,7 @@ function autoDecoder(extra, caseStrategy, isOptional, t) {
|
|
|
2153
2153
|
GetHashCode: _Util.numberHash
|
|
2154
2154
|
}) ? (0, _Result.FSharpResult$2_Ok)((0, _Reflection.parseEnum)(t_4, (0, _Util.int16ToString)(enumValue_2))) : (0, _Result.FSharpResult$2_Error)([
|
|
2155
2155
|
path_7,
|
|
2156
|
-
(0,
|
|
2156
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)((0, _Reflection.fullName)(t_4), value_11, "Unkown value provided for the enum")
|
|
2157
2157
|
]);
|
|
2158
2158
|
}
|
|
2159
2159
|
};
|
|
@@ -2172,7 +2172,7 @@ function autoDecoder(extra, caseStrategy, isOptional, t) {
|
|
|
2172
2172
|
GetHashCode: _Util.numberHash
|
|
2173
2173
|
}) ? (0, _Result.FSharpResult$2_Ok)((0, _Reflection.parseEnum)(t_5, enumValue_3.toString())) : (0, _Result.FSharpResult$2_Error)([
|
|
2174
2174
|
path_9,
|
|
2175
|
-
(0,
|
|
2175
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)((0, _Reflection.fullName)(t_5), value_14, "Unkown value provided for the enum")
|
|
2176
2176
|
]);
|
|
2177
2177
|
}
|
|
2178
2178
|
};
|
|
@@ -2191,7 +2191,7 @@ function autoDecoder(extra, caseStrategy, isOptional, t) {
|
|
|
2191
2191
|
GetHashCode: _Util.numberHash
|
|
2192
2192
|
}) ? (0, _Result.FSharpResult$2_Ok)((0, _Reflection.parseEnum)(t_6, (0, _Util.int32ToString)(enumValue_4))) : (0, _Result.FSharpResult$2_Error)([
|
|
2193
2193
|
path_11,
|
|
2194
|
-
(0,
|
|
2194
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)((0, _Reflection.fullName)(t_6), value_17, "Unkown value provided for the enum")
|
|
2195
2195
|
]);
|
|
2196
2196
|
}
|
|
2197
2197
|
};
|
|
@@ -2210,7 +2210,7 @@ function autoDecoder(extra, caseStrategy, isOptional, t) {
|
|
|
2210
2210
|
GetHashCode: _Util.numberHash
|
|
2211
2211
|
}) ? (0, _Result.FSharpResult$2_Ok)((0, _Reflection.parseEnum)(t_7, enumValue_5.toString())) : (0, _Result.FSharpResult$2_Error)([
|
|
2212
2212
|
path_13,
|
|
2213
|
-
(0,
|
|
2213
|
+
(0, _Types.ErrorReason_BadPrimitiveExtra)((0, _Reflection.fullName)(t_7), value_20, "Unkown value provided for the enum")
|
|
2214
2214
|
]);
|
|
2215
2215
|
}
|
|
2216
2216
|
};
|
|
@@ -2229,7 +2229,7 @@ function autoDecoder(extra, caseStrategy, isOptional, t) {
|
|
|
2229
2229
|
const decoders = (0, _Array.map)((t_8)=>autoDecoder(extra, caseStrategy, false, t_8), (0, _Reflection.getTupleElements)(t));
|
|
2230
2230
|
return (path_14)=>(value_21)=>Array.isArray(value_21) ? (0, _Result.Result_Map)((xs)=>(0, _Reflection.makeTuple)((0, _List.toArray)(xs), t), mixedArray(0, decoders, path_14, value_21)) : (0, _Result.FSharpResult$2_Error)([
|
|
2231
2231
|
path_14,
|
|
2232
|
-
(0,
|
|
2232
|
+
(0, _Types.ErrorReason_BadPrimitive)("an array", value_21)
|
|
2233
2233
|
]);
|
|
2234
2234
|
} else {
|
|
2235
2235
|
const fullname_1 = (0, _Reflection.fullName)((0, _Reflection.getGenericTypeDefinition)(t));
|
|
@@ -2290,14 +2290,20 @@ function autoDecoder(extra, caseStrategy, isOptional, t) {
|
|
|
2290
2290
|
return (path_27)=>(value_36)=>float(path_27, value_36);
|
|
2291
2291
|
case "System.Single":
|
|
2292
2292
|
return (path_28)=>(value_37)=>float32(path_28, value_37);
|
|
2293
|
+
case "System.Int64":
|
|
2294
|
+
return int64;
|
|
2295
|
+
case "System.UInt64":
|
|
2296
|
+
return uint64;
|
|
2297
|
+
case "System.Numerics.BigInteger":
|
|
2298
|
+
return (path_29)=>(value_38)=>bigint(path_29, value_38);
|
|
2293
2299
|
case "System.DateTime":
|
|
2294
|
-
return (
|
|
2300
|
+
return (path_30)=>(value_39)=>datetimeUtc(path_30, value_39);
|
|
2295
2301
|
case "System.DateTimeOffset":
|
|
2296
|
-
return (
|
|
2302
|
+
return (path_31)=>(value_40)=>datetimeOffset(path_31, value_40);
|
|
2297
2303
|
case "System.TimeSpan":
|
|
2298
|
-
return (
|
|
2304
|
+
return (path_32)=>(value_41)=>timespan(path_32, value_41);
|
|
2299
2305
|
case "System.Guid":
|
|
2300
|
-
return (
|
|
2306
|
+
return (path_33)=>(value_42)=>guid(path_33, value_42);
|
|
2301
2307
|
case "System.Object":
|
|
2302
2308
|
return (_arg_6)=>_Result.FSharpResult$2_Ok;
|
|
2303
2309
|
default:
|
|
@@ -2311,7 +2317,7 @@ function autoDecoder(extra, caseStrategy, isOptional, t) {
|
|
|
2311
2317
|
}
|
|
2312
2318
|
function makeExtra(extra) {
|
|
2313
2319
|
if (extra != null) {
|
|
2314
|
-
return (0, _Map.map)((_arg, tupledArg)=>new
|
|
2320
|
+
return (0, _Map.map)((_arg, tupledArg)=>new _Types1.FSharpRef(tupledArg[1]), (0, _Option.value)(extra).Coders);
|
|
2315
2321
|
} else {
|
|
2316
2322
|
return (0, _Map.empty)({
|
|
2317
2323
|
Compare: _Util.comparePrimitives
|
|
@@ -2326,12 +2332,12 @@ function Auto_$reflection() {
|
|
|
2326
2332
|
}
|
|
2327
2333
|
function Auto_generateBoxedDecoderCached_Z6670B51(t, caseStrategy, extra) {
|
|
2328
2334
|
let y_1, y;
|
|
2329
|
-
const caseStrategy_1 = (0, _Option.defaultArg)(caseStrategy, (0,
|
|
2330
|
-
return (0,
|
|
2335
|
+
const caseStrategy_1 = (0, _Option.defaultArg)(caseStrategy, (0, _Types.CaseStrategy_PascalCase)());
|
|
2336
|
+
return (0, _Types.Util_Cache$1__GetOrAdd_43981464)(_Types.Util_CachedDecoders, (y_1 = (y = (0, _Reflection.fullName)(t), (0, _Types1.toString)(caseStrategy_1) + y), (0, _Option.defaultArg)((0, _Option.map)((e)=>e.Hash, extra), "") + y_1), ()=>autoDecoder(makeExtra(extra), caseStrategy_1, false, t));
|
|
2331
2337
|
}
|
|
2332
2338
|
function Auto_generateBoxedDecoder_Z6670B51(t, caseStrategy, extra) {
|
|
2333
|
-
const caseStrategy_1 = (0, _Option.defaultArg)(caseStrategy, (0,
|
|
2339
|
+
const caseStrategy_1 = (0, _Option.defaultArg)(caseStrategy, (0, _Types.CaseStrategy_PascalCase)());
|
|
2334
2340
|
return autoDecoder(makeExtra(extra), caseStrategy_1, false, t);
|
|
2335
|
-
} //# sourceMappingURL=Decode.
|
|
2341
|
+
} //# sourceMappingURL=Decode.ts.map
|
|
2336
2342
|
|
|
2337
|
-
//# sourceMappingURL=Decode.
|
|
2343
|
+
//# sourceMappingURL=Decode.js.map
|