@f1studio/form-spec 5.0.0-alpha.101
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/Designer.d.ts +89 -0
- package/FormSpec.TS/Components/HelloComponent.js +68 -0
- package/FormSpec.TS/Components/HelloComponent.js.map +1 -0
- package/FormSpec.TS/Components/HelloComponent.ts.map +1 -0
- package/FormSpec.TS/Designer.js +526 -0
- package/FormSpec.TS/Designer.js.map +1 -0
- package/FormSpec.TS/Designer.ts.map +1 -0
- package/FormSpec.TS/FormSpec.js +5400 -0
- package/FormSpec.TS/FormSpec.js.map +1 -0
- package/FormSpec.TS/FormSpec.ts.map +1 -0
- package/FormSpec.TS/FormSpecHelpers.js +382 -0
- package/FormSpec.TS/FormSpecHelpers.js.map +1 -0
- package/FormSpec.TS/FormSpecHelpers.ts.map +1 -0
- package/FormSpec.TS/Helpers.js +732 -0
- package/FormSpec.TS/Helpers.js.map +1 -0
- package/FormSpec.TS/Helpers.ts.map +1 -0
- package/FormSpec.TS/Interfaces.js +257 -0
- package/FormSpec.TS/Interfaces.js.map +1 -0
- package/FormSpec.TS/Interfaces.ts.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js +854 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Helpers.js.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Helpers.ts.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Option.js +1961 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Option.js.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Api.Option.ts.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js +1367 -0
- package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.js.map +1 -0
- package/FormSpec.TS/Interop/FormSpec.Values.Api.Option.ts.map +1 -0
- package/FormSpec.TS/Logging/LogTypes.js +347 -0
- package/FormSpec.TS/Logging/LogTypes.js.map +1 -0
- package/FormSpec.TS/Logging/LogTypes.ts.map +1 -0
- package/FormSpec.TS/Migrator.js +230 -0
- package/FormSpec.TS/Migrator.js.map +1 -0
- package/FormSpec.TS/Migrator.ts.map +1 -0
- package/FormSpec.TS/PathwayDataExtractor.js +361 -0
- package/FormSpec.TS/PathwayDataExtractor.js.map +1 -0
- package/FormSpec.TS/PathwayDataExtractor.ts.map +1 -0
- package/FormSpec.TS/PathwayExecutor.js +1321 -0
- package/FormSpec.TS/PathwayExecutor.js.map +1 -0
- package/FormSpec.TS/PathwayExecutor.ts.map +1 -0
- package/FormSpec.TS/PathwayValidator.js +346 -0
- package/FormSpec.TS/PathwayValidator.js.map +1 -0
- package/FormSpec.TS/PathwayValidator.ts.map +1 -0
- package/FormSpec.TS/PluginInterface.js +171 -0
- package/FormSpec.TS/PluginInterface.js.map +1 -0
- package/FormSpec.TS/PluginInterface.ts.map +1 -0
- package/FormSpec.TS/Prelude.js +59 -0
- package/FormSpec.TS/Prelude.js.map +1 -0
- package/FormSpec.TS/Prelude.ts.map +1 -0
- package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.js +958 -0
- package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.js.map +1 -0
- package/FormSpec.TS/Renderers/FormSpecMarkdownRenderer.ts.map +1 -0
- package/FormSpec.TS/Renderers/MermaidRenderer.js +228 -0
- package/FormSpec.TS/Renderers/MermaidRenderer.js.map +1 -0
- package/FormSpec.TS/Renderers/MermaidRenderer.ts.map +1 -0
- package/FormSpec.TS/Renderers/PathwayRenderers.js +190 -0
- package/FormSpec.TS/Renderers/PathwayRenderers.js.map +1 -0
- package/FormSpec.TS/Renderers/PathwayRenderers.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs +511 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.js +437 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Base.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs +16 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.js +73 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Error.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs +50 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.js +72 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Extensions.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Fable.Form.fableproj +28 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs +24 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.js +56 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.3.0.0/Field.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Fable.Form.Simple.fableproj +31 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs +178 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.js +464 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.Form.Simple.5.0.1/Form.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Extensions.fs +17 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs +152 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.js +25 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Hooks.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.Types.fableproj +28 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs +218 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.js +37 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.React.Types.18.3.0/Fable.React.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.Types.fableproj +27 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs +82 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.js +7 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Fable.ReactDom.Types.18.2.0/Fable.ReactDom.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/BorderStyle.fs +59 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs +154 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.js +32 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Colors.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Feliz.fableproj +42 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Fonts.fs +240 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/GridTypes.fs +24 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Html.fs +826 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs +83 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.js +292 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Interop.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs +65 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.js +229 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Key.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Length.fs +91 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Locale.fs +876 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs +4080 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.js +133 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Properties.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs +656 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.js +561 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/React.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs +25 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.js +46 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactDOM.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js +63 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactInterop.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs +41 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.js +7 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/ReactTypes.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs +53 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.js +7 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/StyleTypes.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Styles.fs +5740 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs +1455 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.js +39 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Svg.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationLine.fs +13 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TextDecorationStyle.fs +33 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Transform.fs +181 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransformOrigin.fs +17 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/TransitionProperty.fs +162 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs +13 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.js +7 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Feliz.2.7.0/Types.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs +1768 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.js +2337 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Decode.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs +811 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js +465 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs +47 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.js +18 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Thoth.Json.fableproj +34 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs +68 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.js +355 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.js.map +1 -0
- package/FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Types.fs.ts.map +1 -0
- package/FormSpec.TS/fable_modules/project_cracked.json +1 -0
- package/FormSpec.d.ts +1257 -0
- package/FormSpecHelpers.d.ts +50 -0
- package/Helpers.d.ts +147 -0
- package/Interfaces.d.ts +70 -0
- package/Interop/FormSpec.Api.Helpers.d.ts +247 -0
- package/Interop/FormSpec.Api.Helpers.d.ts.map +1 -0
- package/Interop/FormSpec.Api.Option.d.ts +384 -0
- package/Interop/FormSpec.Api.Option.d.ts.map +1 -0
- package/Interop/FormSpec.Values.Api.Option.d.ts +324 -0
- package/Interop/FormSpec.Values.Api.Option.d.ts.map +1 -0
- package/Migrator.d.ts +59 -0
- package/PathwayDataExtractor.d.ts +19 -0
- package/PathwayExecutor.d.ts +210 -0
- package/PathwayValidator.d.ts +52 -0
- package/PluginInterface.d.ts +36 -0
- package/Prelude.d.ts +11 -0
- package/README.TS.md +622 -0
- package/README.md +85 -0
- package/package.json +39 -0
- package/src/Components/HelloComponent.ts +48 -0
- package/src/Components/HelloComponent.ts.map +1 -0
- package/src/Designer.ts +389 -0
- package/src/Designer.ts.map +1 -0
- package/src/FormSpec.ts +3114 -0
- package/src/FormSpec.ts.map +1 -0
- package/src/FormSpecHelpers.ts +374 -0
- package/src/FormSpecHelpers.ts.map +1 -0
- package/src/Helpers.ts +765 -0
- package/src/Helpers.ts.map +1 -0
- package/src/Interfaces.ts +166 -0
- package/src/Interfaces.ts.map +1 -0
- package/src/Interop/FormSpec.Api.Helpers.ts +872 -0
- package/src/Interop/FormSpec.Api.Helpers.ts.map +1 -0
- package/src/Interop/FormSpec.Api.Option.ts +1618 -0
- package/src/Interop/FormSpec.Api.Option.ts.map +1 -0
- package/src/Interop/FormSpec.Values.Api.Option.ts +1214 -0
- package/src/Interop/FormSpec.Values.Api.Option.ts.map +1 -0
- package/src/Logging/LogTypes.ts +212 -0
- package/src/Logging/LogTypes.ts.map +1 -0
- package/src/Migrator.ts +156 -0
- package/src/Migrator.ts.map +1 -0
- package/src/PathwayDataExtractor.ts +290 -0
- package/src/PathwayDataExtractor.ts.map +1 -0
- package/src/PathwayExecutor.ts +1102 -0
- package/src/PathwayExecutor.ts.map +1 -0
- package/src/PathwayValidator.ts +244 -0
- package/src/PathwayValidator.ts.map +1 -0
- package/src/PluginInterface.ts +79 -0
- package/src/PluginInterface.ts.map +1 -0
- package/src/Prelude.ts +21 -0
- package/src/Prelude.ts.map +1 -0
- package/src/Renderers/FormSpecMarkdownRenderer.ts +874 -0
- package/src/Renderers/FormSpecMarkdownRenderer.ts.map +1 -0
- package/src/Renderers/MermaidRenderer.ts +218 -0
- package/src/Renderers/MermaidRenderer.ts.map +1 -0
- package/src/Renderers/PathwayRenderers.ts +200 -0
- package/src/Renderers/PathwayRenderers.ts.map +1 -0
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get Auto () {
|
|
13
|
+
return Auto;
|
|
14
|
+
},
|
|
15
|
+
get Auto_$reflection () {
|
|
16
|
+
return Auto_$reflection;
|
|
17
|
+
},
|
|
18
|
+
get Auto_generateBoxedEncoderCached_437914C6 () {
|
|
19
|
+
return Auto_generateBoxedEncoderCached_437914C6;
|
|
20
|
+
},
|
|
21
|
+
get Auto_generateBoxedEncoder_437914C6 () {
|
|
22
|
+
return Auto_generateBoxedEncoder_437914C6;
|
|
23
|
+
},
|
|
24
|
+
get Enum_byte () {
|
|
25
|
+
return Enum_byte;
|
|
26
|
+
},
|
|
27
|
+
get Enum_int () {
|
|
28
|
+
return Enum_int;
|
|
29
|
+
},
|
|
30
|
+
get Enum_int16 () {
|
|
31
|
+
return Enum_int16;
|
|
32
|
+
},
|
|
33
|
+
get Enum_sbyte () {
|
|
34
|
+
return Enum_sbyte;
|
|
35
|
+
},
|
|
36
|
+
get Enum_uint16 () {
|
|
37
|
+
return Enum_uint16;
|
|
38
|
+
},
|
|
39
|
+
get Enum_uint32 () {
|
|
40
|
+
return Enum_uint32;
|
|
41
|
+
},
|
|
42
|
+
get bigint () {
|
|
43
|
+
return bigint;
|
|
44
|
+
},
|
|
45
|
+
get datetime () {
|
|
46
|
+
return datetime;
|
|
47
|
+
},
|
|
48
|
+
get datetimeOffset () {
|
|
49
|
+
return datetimeOffset;
|
|
50
|
+
},
|
|
51
|
+
get decimal () {
|
|
52
|
+
return decimal;
|
|
53
|
+
},
|
|
54
|
+
get dict () {
|
|
55
|
+
return dict;
|
|
56
|
+
},
|
|
57
|
+
get encode () {
|
|
58
|
+
return encode;
|
|
59
|
+
},
|
|
60
|
+
get guid () {
|
|
61
|
+
return guid;
|
|
62
|
+
},
|
|
63
|
+
get int64 () {
|
|
64
|
+
return int64;
|
|
65
|
+
},
|
|
66
|
+
get list () {
|
|
67
|
+
return list;
|
|
68
|
+
},
|
|
69
|
+
get map () {
|
|
70
|
+
return map;
|
|
71
|
+
},
|
|
72
|
+
get nil () {
|
|
73
|
+
return nil;
|
|
74
|
+
},
|
|
75
|
+
get object () {
|
|
76
|
+
return object;
|
|
77
|
+
},
|
|
78
|
+
get option () {
|
|
79
|
+
return option;
|
|
80
|
+
},
|
|
81
|
+
get seq () {
|
|
82
|
+
return seq;
|
|
83
|
+
},
|
|
84
|
+
get timespan () {
|
|
85
|
+
return timespan;
|
|
86
|
+
},
|
|
87
|
+
get toString () {
|
|
88
|
+
return toString;
|
|
89
|
+
},
|
|
90
|
+
get tuple2 () {
|
|
91
|
+
return tuple2;
|
|
92
|
+
},
|
|
93
|
+
get tuple3 () {
|
|
94
|
+
return tuple3;
|
|
95
|
+
},
|
|
96
|
+
get tuple4 () {
|
|
97
|
+
return tuple4;
|
|
98
|
+
},
|
|
99
|
+
get tuple5 () {
|
|
100
|
+
return tuple5;
|
|
101
|
+
},
|
|
102
|
+
get tuple6 () {
|
|
103
|
+
return tuple6;
|
|
104
|
+
},
|
|
105
|
+
get tuple7 () {
|
|
106
|
+
return tuple7;
|
|
107
|
+
},
|
|
108
|
+
get tuple8 () {
|
|
109
|
+
return tuple8;
|
|
110
|
+
},
|
|
111
|
+
get uint64 () {
|
|
112
|
+
return uint64;
|
|
113
|
+
},
|
|
114
|
+
get unit () {
|
|
115
|
+
return unit;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const _Decimal = require("@fable-org/fable-library-js/Decimal.js");
|
|
119
|
+
const _Util = require("@fable-org/fable-library-js/Util.js");
|
|
120
|
+
const _List = require("@fable-org/fable-library-js/List.js");
|
|
121
|
+
const _Map = require("@fable-org/fable-library-js/Map.js");
|
|
122
|
+
const _BigInt = require("@fable-org/fable-library-js/BigInt.js");
|
|
123
|
+
const _Date = require("@fable-org/fable-library-js/Date.js");
|
|
124
|
+
const _TimeSpan = require("@fable-org/fable-library-js/TimeSpan.js");
|
|
125
|
+
const _Option = require("@fable-org/fable-library-js/Option.js");
|
|
126
|
+
const _Types = require("@fable-org/fable-library-js/Types.js");
|
|
127
|
+
const _Reflection = require("@fable-org/fable-library-js/Reflection.js");
|
|
128
|
+
const _Array = require("@fable-org/fable-library-js/Array.js");
|
|
129
|
+
const _Typesfs = require("./Types.fs.js");
|
|
130
|
+
const _Seq = require("@fable-org/fable-library-js/Seq.js");
|
|
131
|
+
const _String = require("@fable-org/fable-library-js/String.js");
|
|
132
|
+
function guid(value) {
|
|
133
|
+
return value;
|
|
134
|
+
}
|
|
135
|
+
function decimal(value) {
|
|
136
|
+
return (0, _Decimal.toString)(value);
|
|
137
|
+
}
|
|
138
|
+
const nil = (0, _Util.defaultOf)();
|
|
139
|
+
function object(values) {
|
|
140
|
+
const o = {};
|
|
141
|
+
const enumerator = (0, _Util.getEnumerator)(values);
|
|
142
|
+
try {
|
|
143
|
+
while(enumerator["System.Collections.IEnumerator.MoveNext"]()){
|
|
144
|
+
const forLoopVar = enumerator["System.Collections.Generic.IEnumerator`1.get_Current"]();
|
|
145
|
+
o[forLoopVar[0]] = forLoopVar[1];
|
|
146
|
+
}
|
|
147
|
+
} finally{
|
|
148
|
+
(0, _Util.disposeSafe)(enumerator);
|
|
149
|
+
}
|
|
150
|
+
return o;
|
|
151
|
+
}
|
|
152
|
+
function list(values) {
|
|
153
|
+
return Array.from(values);
|
|
154
|
+
}
|
|
155
|
+
function seq(values) {
|
|
156
|
+
return Array.from(values);
|
|
157
|
+
}
|
|
158
|
+
function dict(values) {
|
|
159
|
+
return object((0, _Map.toList)(values));
|
|
160
|
+
}
|
|
161
|
+
function bigint(value) {
|
|
162
|
+
return (0, _BigInt.toString)(value);
|
|
163
|
+
}
|
|
164
|
+
function datetimeOffset(value) {
|
|
165
|
+
return (0, _Date.toString)(value, "O", {});
|
|
166
|
+
}
|
|
167
|
+
function timespan(value) {
|
|
168
|
+
return (0, _TimeSpan.toString)(value);
|
|
169
|
+
}
|
|
170
|
+
function int64(value) {
|
|
171
|
+
return String(value);
|
|
172
|
+
}
|
|
173
|
+
function uint64(value) {
|
|
174
|
+
return String(value);
|
|
175
|
+
}
|
|
176
|
+
function unit() {
|
|
177
|
+
return (0, _Util.defaultOf)();
|
|
178
|
+
}
|
|
179
|
+
function tuple2(enc1, enc2, v1, v2) {
|
|
180
|
+
return [
|
|
181
|
+
enc1(v1),
|
|
182
|
+
enc2(v2)
|
|
183
|
+
];
|
|
184
|
+
}
|
|
185
|
+
function tuple3(enc1, enc2, enc3, v1, v2, v3) {
|
|
186
|
+
return [
|
|
187
|
+
enc1(v1),
|
|
188
|
+
enc2(v2),
|
|
189
|
+
enc3(v3)
|
|
190
|
+
];
|
|
191
|
+
}
|
|
192
|
+
function tuple4(enc1, enc2, enc3, enc4, v1, v2, v3, v4) {
|
|
193
|
+
return [
|
|
194
|
+
enc1(v1),
|
|
195
|
+
enc2(v2),
|
|
196
|
+
enc3(v3),
|
|
197
|
+
enc4(v4)
|
|
198
|
+
];
|
|
199
|
+
}
|
|
200
|
+
function tuple5(enc1, enc2, enc3, enc4, enc5, v1, v2, v3, v4, v5) {
|
|
201
|
+
return [
|
|
202
|
+
enc1(v1),
|
|
203
|
+
enc2(v2),
|
|
204
|
+
enc3(v3),
|
|
205
|
+
enc4(v4),
|
|
206
|
+
enc5(v5)
|
|
207
|
+
];
|
|
208
|
+
}
|
|
209
|
+
function tuple6(enc1, enc2, enc3, enc4, enc5, enc6, v1, v2, v3, v4, v5, v6) {
|
|
210
|
+
return [
|
|
211
|
+
enc1(v1),
|
|
212
|
+
enc2(v2),
|
|
213
|
+
enc3(v3),
|
|
214
|
+
enc4(v4),
|
|
215
|
+
enc5(v5),
|
|
216
|
+
enc6(v6)
|
|
217
|
+
];
|
|
218
|
+
}
|
|
219
|
+
function tuple7(enc1, enc2, enc3, enc4, enc5, enc6, enc7, v1, v2, v3, v4, v5, v6, v7) {
|
|
220
|
+
return [
|
|
221
|
+
enc1(v1),
|
|
222
|
+
enc2(v2),
|
|
223
|
+
enc3(v3),
|
|
224
|
+
enc4(v4),
|
|
225
|
+
enc5(v5),
|
|
226
|
+
enc6(v6),
|
|
227
|
+
enc7(v7)
|
|
228
|
+
];
|
|
229
|
+
}
|
|
230
|
+
function tuple8(enc1, enc2, enc3, enc4, enc5, enc6, enc7, enc8, v1, v2, v3, v4, v5, v6, v7, v8) {
|
|
231
|
+
return [
|
|
232
|
+
enc1(v1),
|
|
233
|
+
enc2(v2),
|
|
234
|
+
enc3(v3),
|
|
235
|
+
enc4(v4),
|
|
236
|
+
enc5(v5),
|
|
237
|
+
enc6(v6),
|
|
238
|
+
enc7(v7),
|
|
239
|
+
enc8(v8)
|
|
240
|
+
];
|
|
241
|
+
}
|
|
242
|
+
function map(keyEncoder, valueEncoder, values) {
|
|
243
|
+
return list((0, _List.map)((tupledArg)=>tuple2(keyEncoder, valueEncoder, tupledArg[0], tupledArg[1]), (0, _Map.toList)(values)));
|
|
244
|
+
}
|
|
245
|
+
function Enum_byte(value) {
|
|
246
|
+
return value;
|
|
247
|
+
}
|
|
248
|
+
function Enum_sbyte(value) {
|
|
249
|
+
return value;
|
|
250
|
+
}
|
|
251
|
+
function Enum_int16(value) {
|
|
252
|
+
return value;
|
|
253
|
+
}
|
|
254
|
+
function Enum_uint16(value) {
|
|
255
|
+
return value;
|
|
256
|
+
}
|
|
257
|
+
function Enum_int(value) {
|
|
258
|
+
return value;
|
|
259
|
+
}
|
|
260
|
+
function Enum_uint32(value) {
|
|
261
|
+
return value;
|
|
262
|
+
}
|
|
263
|
+
function datetime(value) {
|
|
264
|
+
return (0, _Date.toString)(value, "O", {});
|
|
265
|
+
}
|
|
266
|
+
function toString(space, value) {
|
|
267
|
+
return JSON.stringify(value, undefined, (0, _Option.some)(space));
|
|
268
|
+
}
|
|
269
|
+
function option(encoder) {
|
|
270
|
+
return (arg)=>(0, _Option.defaultArgWith)((0, _Option.map)(encoder, arg), ()=>nil);
|
|
271
|
+
}
|
|
272
|
+
function autoEncodeRecordsAndUnions(extra, caseStrategy, skipNullField, t) {
|
|
273
|
+
let arg;
|
|
274
|
+
const encoderRef = new _Types.FSharpRef((0, _Util.defaultOf)());
|
|
275
|
+
let extra_1;
|
|
276
|
+
const matchValue = (0, _Reflection.fullName)(t);
|
|
277
|
+
extra_1 = matchValue === "" ? extra : (0, _Map.add)(matchValue, encoderRef, extra);
|
|
278
|
+
let encoder;
|
|
279
|
+
if ((0, _Reflection.isRecord)(t, true)) {
|
|
280
|
+
const setters = (0, _Array.map)((fi)=>{
|
|
281
|
+
const targetKey = (0, _Typesfs.Util_Casing_convert)(caseStrategy, (0, _Reflection.name)(fi));
|
|
282
|
+
const encode_1 = autoEncoder(extra_1, caseStrategy, skipNullField, fi[1]);
|
|
283
|
+
return (source)=>(target)=>{
|
|
284
|
+
const value = (0, _Reflection.getRecordField)(source, fi);
|
|
285
|
+
if (!skipNullField ? true : skipNullField && !(value == null)) {
|
|
286
|
+
target[targetKey] = encode_1(value);
|
|
287
|
+
}
|
|
288
|
+
return target;
|
|
289
|
+
};
|
|
290
|
+
}, (0, _Reflection.getRecordElements)(t, true));
|
|
291
|
+
encoder = (source_1)=>(0, _Seq.fold)((target_1, set$)=>set$(source_1)(target_1), {}, setters);
|
|
292
|
+
} else if ((0, _Reflection.isUnion)(t, true)) {
|
|
293
|
+
encoder = (value_1)=>{
|
|
294
|
+
const patternInput = (0, _Reflection.getUnionFields)(value_1, t, true);
|
|
295
|
+
const info = patternInput[0];
|
|
296
|
+
const fields = patternInput[1];
|
|
297
|
+
const matchValue_1 = fields.length | 0;
|
|
298
|
+
if (matchValue_1 === 0) {
|
|
299
|
+
return (0, _Reflection.name)(info);
|
|
300
|
+
} else {
|
|
301
|
+
const len = matchValue_1 | 0;
|
|
302
|
+
const fieldTypes = (0, _Reflection.getUnionCaseFields)(info);
|
|
303
|
+
const target_2 = (0, _Array.fill)(new Array(len + 1), 0, len + 1, null);
|
|
304
|
+
(0, _Array.setItem)(target_2, 0, (0, _Reflection.name)(info));
|
|
305
|
+
for(let i = 1; i <= len; i++){
|
|
306
|
+
const encode_2 = autoEncoder(extra_1, caseStrategy, skipNullField, (0, _Array.item)(i - 1, fieldTypes)[1]);
|
|
307
|
+
(0, _Array.setItem)(target_2, i, encode_2((0, _Array.item)(i - 1, fields)));
|
|
308
|
+
}
|
|
309
|
+
return target_2;
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
} else {
|
|
313
|
+
throw new Error((arg = (0, _Reflection.fullName)(t), (0, _String.toText)((0, _String.printf)("Cannot generate auto encoder for %s. Please pass an extra encoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders"))(arg)));
|
|
314
|
+
}
|
|
315
|
+
encoderRef.contents = encoder;
|
|
316
|
+
return encoder;
|
|
317
|
+
}
|
|
318
|
+
function autoEncoder(extra, caseStrategy, skipNullField, t) {
|
|
319
|
+
const fullname = (0, _Reflection.fullName)(t);
|
|
320
|
+
const matchValue = (0, _Map.tryFind)(fullname, extra);
|
|
321
|
+
if (matchValue == null) {
|
|
322
|
+
if ((0, _Reflection.isArray)(t)) {
|
|
323
|
+
const encoder = autoEncoder(extra, caseStrategy, skipNullField, (0, _Reflection.getElementType)(t));
|
|
324
|
+
return (value)=>seq((0, _Seq.map)(encoder, value));
|
|
325
|
+
} else if ((0, _Reflection.isEnum)(t)) {
|
|
326
|
+
const enumType = (0, _Reflection.fullName)((0, _Reflection.getEnumUnderlyingType)(t));
|
|
327
|
+
switch(enumType){
|
|
328
|
+
case "System.SByte":
|
|
329
|
+
return (value_1)=>value_1;
|
|
330
|
+
case "System.Byte":
|
|
331
|
+
return (value_3)=>value_3;
|
|
332
|
+
case "System.Int16":
|
|
333
|
+
return (value_5)=>value_5;
|
|
334
|
+
case "System.UInt16":
|
|
335
|
+
return (value_7)=>value_7;
|
|
336
|
+
case "System.Int32":
|
|
337
|
+
return (value_9)=>value_9;
|
|
338
|
+
case "System.UInt32":
|
|
339
|
+
return (value_11)=>value_11;
|
|
340
|
+
default:
|
|
341
|
+
{
|
|
342
|
+
const arg = (0, _Reflection.fullName)(t);
|
|
343
|
+
const clo_1 = (0, _String.toFail)((0, _String.printf)("Cannot generate auto encoder for %s.\nThoth.Json.Net only support the following enum types:\n- sbyte\n- byte\n- int16\n- uint16\n- int\n- uint32\n\nIf you can\'t use one of these types, please pass an extra encoder.\n\nDocumentation available at: https://thoth-org.github.io/Thoth.Json/documentation/auto/extra-coders.html#ready-to-use-extra-coders\n "))(arg);
|
|
344
|
+
return clo_1;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
} else if ((0, _Reflection.isGenericType)(t)) {
|
|
348
|
+
if ((0, _Reflection.isTuple)(t)) {
|
|
349
|
+
const encoders = (0, _Array.map)((t_2)=>autoEncoder(extra, caseStrategy, skipNullField, t_2), (0, _Reflection.getTupleElements)(t));
|
|
350
|
+
return (value_13)=>seq((0, _Seq.mapIndexed)((i, x)=>(0, _Array.item)(i, encoders)(x), (0, _Reflection.getTupleFields)(value_13)));
|
|
351
|
+
} else {
|
|
352
|
+
const fullname_1 = (0, _Reflection.fullName)((0, _Reflection.getGenericTypeDefinition)(t));
|
|
353
|
+
if (fullname_1 === "Microsoft.FSharp.Core.FSharpOption`1[System.Object]") {
|
|
354
|
+
const encoder_2 = new _Util.Lazy(()=>option(autoEncoder(extra, caseStrategy, skipNullField, (0, _Array.item)(0, (0, _Reflection.getGenerics)(t)))));
|
|
355
|
+
return (value_14)=>{
|
|
356
|
+
if (value_14 == null) {
|
|
357
|
+
return nil;
|
|
358
|
+
} else {
|
|
359
|
+
return encoder_2.Value(value_14);
|
|
360
|
+
}
|
|
361
|
+
};
|
|
362
|
+
} else if ((fullname_1 === "Microsoft.FSharp.Collections.FSharpList`1[System.Object]" ? true : fullname_1 === "Microsoft.FSharp.Collections.FSharpSet`1[System.Object]") ? true : fullname_1 === "System.Collections.Generic.IEnumerable`1[System.Object]") {
|
|
363
|
+
const encoder_3 = autoEncoder(extra, caseStrategy, skipNullField, (0, _Array.item)(0, (0, _Reflection.getGenerics)(t)));
|
|
364
|
+
return (value_15)=>seq((0, _Seq.map)(encoder_3, value_15));
|
|
365
|
+
} else if (fullname_1 === "Microsoft.FSharp.Collections.FSharpMap`2[System.Object,System.Object]") {
|
|
366
|
+
const keyType = (0, _Array.item)(0, (0, _Reflection.getGenerics)(t));
|
|
367
|
+
const valueEncoder = autoEncoder(extra, caseStrategy, skipNullField, (0, _Array.item)(1, (0, _Reflection.getGenerics)(t)));
|
|
368
|
+
if ((0, _Reflection.fullName)(keyType) === "System.String" ? true : (0, _Reflection.fullName)(keyType) === "System.Guid") {
|
|
369
|
+
return (value_16)=>(0, _Seq.fold)((target, _arg)=>{
|
|
370
|
+
const activePatternResult = _arg;
|
|
371
|
+
target[activePatternResult[0]] = valueEncoder(activePatternResult[1]);
|
|
372
|
+
return target;
|
|
373
|
+
}, {}, value_16);
|
|
374
|
+
} else {
|
|
375
|
+
let keyEncoder;
|
|
376
|
+
const clo_2 = autoEncoder(extra, caseStrategy, skipNullField, keyType);
|
|
377
|
+
keyEncoder = clo_2;
|
|
378
|
+
return (value_17)=>seq((0, _Seq.map)((_arg_1)=>{
|
|
379
|
+
const activePatternResult_1 = _arg_1;
|
|
380
|
+
return [
|
|
381
|
+
keyEncoder(activePatternResult_1[0]),
|
|
382
|
+
valueEncoder(activePatternResult_1[1])
|
|
383
|
+
];
|
|
384
|
+
}, value_17));
|
|
385
|
+
}
|
|
386
|
+
} else {
|
|
387
|
+
return autoEncodeRecordsAndUnions(extra, caseStrategy, skipNullField, t);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
} else {
|
|
391
|
+
switch(fullname){
|
|
392
|
+
case "System.Boolean":
|
|
393
|
+
return (value_18)=>value_18;
|
|
394
|
+
case "Microsoft.FSharp.Core.Unit":
|
|
395
|
+
return unit;
|
|
396
|
+
case "System.String":
|
|
397
|
+
return (value_20)=>value_20;
|
|
398
|
+
case "System.Char":
|
|
399
|
+
return (value_22)=>value_22;
|
|
400
|
+
case "System.SByte":
|
|
401
|
+
return (value_24)=>value_24;
|
|
402
|
+
case "System.Byte":
|
|
403
|
+
return (value_26)=>value_26;
|
|
404
|
+
case "System.Int16":
|
|
405
|
+
return (value_28)=>value_28;
|
|
406
|
+
case "System.UInt16":
|
|
407
|
+
return (value_30)=>value_30;
|
|
408
|
+
case "System.Int32":
|
|
409
|
+
return (value_32)=>value_32;
|
|
410
|
+
case "System.UInt32":
|
|
411
|
+
return (value_34)=>value_34;
|
|
412
|
+
case "System.Double":
|
|
413
|
+
return (value_36)=>value_36;
|
|
414
|
+
case "System.Single":
|
|
415
|
+
return (value_38)=>value_38;
|
|
416
|
+
case "System.DateTime":
|
|
417
|
+
return datetime;
|
|
418
|
+
case "System.DateTimeOffset":
|
|
419
|
+
return datetimeOffset;
|
|
420
|
+
case "System.TimeSpan":
|
|
421
|
+
return timespan;
|
|
422
|
+
case "System.Guid":
|
|
423
|
+
return guid;
|
|
424
|
+
case "System.Object":
|
|
425
|
+
return (x_1)=>x_1;
|
|
426
|
+
default:
|
|
427
|
+
return autoEncodeRecordsAndUnions(extra, caseStrategy, skipNullField, t);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
} else {
|
|
431
|
+
const encoderRef = (0, _Option.value)(matchValue);
|
|
432
|
+
return (v)=>encoderRef.contents(v);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
function makeExtra(extra) {
|
|
436
|
+
if (extra != null) {
|
|
437
|
+
return (0, _Map.map)((_arg, tupledArg)=>new _Types.FSharpRef(tupledArg[0]), (0, _Option.value)(extra).Coders);
|
|
438
|
+
} else {
|
|
439
|
+
return (0, _Map.empty)({
|
|
440
|
+
Compare: _Util.comparePrimitives
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
class Auto {
|
|
445
|
+
constructor(){}
|
|
446
|
+
}
|
|
447
|
+
function Auto_$reflection() {
|
|
448
|
+
return (0, _Reflection.class_type)("Thoth.Json.Encode.Auto", undefined, Auto);
|
|
449
|
+
}
|
|
450
|
+
function Auto_generateBoxedEncoderCached_437914C6(t, caseStrategy, extra, skipNullField) {
|
|
451
|
+
let y_1, y;
|
|
452
|
+
const caseStrategy_1 = (0, _Option.defaultArg)(caseStrategy, (0, _Typesfs.CaseStrategy_PascalCase)());
|
|
453
|
+
const skipNullField_1 = (0, _Option.defaultArg)(skipNullField, true);
|
|
454
|
+
return (0, _Typesfs.Util_Cache$1__GetOrAdd_43981464)(_Typesfs.Util_CachedEncoders, (y_1 = (y = (0, _Reflection.fullName)(t), (0, _Types.toString)(caseStrategy_1) + y), (0, _Option.defaultArg)((0, _Option.map)((e)=>e.Hash, extra), "") + y_1), ()=>autoEncoder(makeExtra(extra), caseStrategy_1, skipNullField_1, t));
|
|
455
|
+
}
|
|
456
|
+
function Auto_generateBoxedEncoder_437914C6(t, caseStrategy, extra, skipNullField) {
|
|
457
|
+
const caseStrategy_1 = (0, _Option.defaultArg)(caseStrategy, (0, _Typesfs.CaseStrategy_PascalCase)());
|
|
458
|
+
const skipNullField_1 = (0, _Option.defaultArg)(skipNullField, true);
|
|
459
|
+
return autoEncoder(makeExtra(extra), caseStrategy_1, skipNullField_1, t);
|
|
460
|
+
}
|
|
461
|
+
function encode(space, value) {
|
|
462
|
+
return toString(space, value);
|
|
463
|
+
} //# sourceMappingURL=Encode.fs.ts.map
|
|
464
|
+
|
|
465
|
+
//# sourceMappingURL=Encode.fs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Encode.fs.ts"],"names":["value","o","enumerator","values","forLoopVar","object","enc1","v1","enc2","v2","enc3","v3","enc4","v4","enc5","v5","enc6","v6","enc7","v7","enc8","v8","list","tuple2","keyEncoder","valueEncoder","tupledArg","space","encoder","nil","arg10","encoderRef","extra","matchValue","t","setters","targetKey","caseStrategy","fi","encode","autoEncoder","skipNullField","source","target","set","patternInput","info","fields","len","fieldTypes","i","fullname","seq","enumType","clo2","encoders","x","option","keyType","activePatternResult9193","_arg1","clo4","activePatternResult9217","_arg2","autoEncodeRecordsAndUnions","unit","datetime","datetimeOffset","timespan","guid","v","y","e","makeExtra","toString"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAyCqDA;;;kCA4BNA;;gBAYlB,eAAA;;IA0BjBC,MAAAA,IAAAA,CAAAA;IAEgBC,MAAAA,iBAAA,mBAAA,EAAAC;IAApB,IAAA;QAAA,MAAoBD,UAAAA,CAAAA,0CAAAA,GAAAA;YAAfE,MAAAA,aAAeF,UAAAA,CAAAA,uDAAAA;YAChBD,CAAAA,CADCG,UAAAA,CAAAA,EAAAA,CAAAA,GAAAA,UAAAA,CAAAA,EAAAA;;;QAAL,IAAA,iBAAA,EAAoBF;;WAGhBD;;;WA2BJ,MAAA,IAAA,CAAUE;;;WAEgC,MAAA,IAAA,CAAUA;;;WAa5BE,WAAd,WAAA,EAAVF;;;iCAE0CH;;;eAG1C,cAAA,EAAAA,OAAe,KAAA,CAAA;;;mCAafA;;;WAeK,OAAAA;;;WAGA,OAAAA;;;eAEqB,eAAA;;;;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CAAXN,SAAAA,CAAAA,EAAAA,OAAoB,aAAA,EAApCM,OAAAA,MAAAA;;QADF,OAAA,cAAA,EAAA;;;;;;;;;;;;QAmBCuC,KADAA;IALHlC,MAAAA,iBAAe,sBAAA,EAAWA,cAAAA,IAAAA,gCAAAA;IAC1BI,MAAAA,sBAAgB,kBAAA,EAAWA,eAAc;IAW7C,WAAA,wCAAA,EAAA,4BAAA,GANO8B,OADAA,QADH,oBAAA,EAAArC,QACQ,eAAA,EAAiBG,mBAAtBkC,OAII,kBAAA,MADA,WAAA,EAAA,CAAA,IAAqBC,EAAAA,IAAAA,EADxBxC,QAEuB,MAHxBuC,GAAAA,GAAAA,IASC/B,YAAaiC,UAAUzC,QAAOK,gBAAaI,iBAAcP;;;IA2B7DG,MAAAA,qBAAe,kBAAA,EAAWA,cAAAA,IAAAA,gCAAAA;IAC1BI,MAAAA,sBAAgB,kBAAA,EAAWA,eAAc;IAC7C,OAAAD,YAAaiC,UAAUzC,QAAOK,gBAAaI,iBAAcP;;;WAkEXwC,SAAS/C,OAAM3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["./Encode.fs"],"names":["value","o","enumerator","values","forLoopVar","object","enc1","v1","enc2","v2","enc3","v3","enc4","v4","enc5","v5","enc6","v6","enc7","v7","enc8","v8","list","tuple2","keyEncoder","valueEncoder","tupledArg","space","encoder","nil","arg10","encoderRef","extra","matchValue","t","setters","targetKey","caseStrategy","fi","encode","autoEncoder","skipNullField","source","target","set","patternInput","info","fields","len","fieldTypes","i","fullname","seq","enumType","clo2","encoders","x","option","keyType","activePatternResult9193","_arg1","clo4","activePatternResult9217","_arg2","autoEncodeRecordsAndUnions","unit","datetime","datetimeOffset","timespan","guid","v","y","e","makeExtra","toString"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAyCqDA;;;;;;;;;;;;;;;;sBA4BNA;;;wBAYlB;;;;;;;;;;;;;;;AA0BjBC;AAEgBC,mDAAA,cAAAC;A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1,47 @@
|
|
|
1
|
+
[<RequireQualifiedAccess>]
|
|
2
|
+
module Thoth.Json.Extra
|
|
3
|
+
|
|
4
|
+
open Fable.Core
|
|
5
|
+
|
|
6
|
+
#if !FABLE_REPL_LIB
|
|
7
|
+
let empty: ExtraCoders =
|
|
8
|
+
{
|
|
9
|
+
Hash = ""
|
|
10
|
+
Coders = Map.empty
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let inline internal withCustomAndKey
|
|
14
|
+
(encoder: Encoder<'Value>)
|
|
15
|
+
(decoder: Decoder<'Value>)
|
|
16
|
+
(extra: ExtraCoders)
|
|
17
|
+
: ExtraCoders
|
|
18
|
+
=
|
|
19
|
+
{ extra with
|
|
20
|
+
Hash = System.Guid.NewGuid().ToString()
|
|
21
|
+
Coders =
|
|
22
|
+
extra.Coders
|
|
23
|
+
|> Map.add
|
|
24
|
+
typeof<'Value>.FullName
|
|
25
|
+
(Encode.boxEncoder encoder, Decode.boxDecoder decoder)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let inline withCustom
|
|
29
|
+
(encoder: Encoder<'Value>)
|
|
30
|
+
(decoder: Decoder<'Value>)
|
|
31
|
+
(extra: ExtraCoders)
|
|
32
|
+
: ExtraCoders
|
|
33
|
+
=
|
|
34
|
+
withCustomAndKey encoder decoder extra
|
|
35
|
+
|
|
36
|
+
let inline withInt64 (extra: ExtraCoders) : ExtraCoders =
|
|
37
|
+
withCustomAndKey Encode.int64 Decode.int64 extra
|
|
38
|
+
|
|
39
|
+
let inline withUInt64 (extra: ExtraCoders) : ExtraCoders =
|
|
40
|
+
withCustomAndKey Encode.uint64 Decode.uint64 extra
|
|
41
|
+
|
|
42
|
+
let inline withDecimal (extra: ExtraCoders) : ExtraCoders =
|
|
43
|
+
withCustomAndKey Encode.decimal Decode.decimal extra
|
|
44
|
+
|
|
45
|
+
let inline withBigInt (extra: ExtraCoders) : ExtraCoders =
|
|
46
|
+
withCustomAndKey Encode.bigint Decode.bigint extra
|
|
47
|
+
#endif
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "empty", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return empty;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _Map = require("@fable-org/fable-library-js/Map.js");
|
|
12
|
+
const _Util = require("@fable-org/fable-library-js/Util.js");
|
|
13
|
+
const _Typesfs = require("./Types.fs.js");
|
|
14
|
+
const empty = new _Typesfs.ExtraCoders("", (0, _Map.empty)({
|
|
15
|
+
Compare: _Util.comparePrimitives
|
|
16
|
+
})); //# sourceMappingURL=Extra.fs.ts.map
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=Extra.fs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../FormSpec.TS/fable_modules/Thoth.Json.10.4.1/Extra.fs.ts"],"names":[],"mappings":";;;;;;;;;;;;;cAOI,IAAA,oBAAA,CACW,QACE,UAAA,EAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["./Extra.fs"],"names":[],"mappings":";;;;;;kCAOI,gBACW,IACE","file":null,"sourcesContent":null,"sourceRoot":null}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
|
3
|
+
<PropertyGroup>
|
|
4
|
+
<Description>
|
|
5
|
+
Elm-inspired encoder and decoder for JSON, this package is intended to be use on Fable
|
|
6
|
+
side only.
|
|
7
|
+
|
|
8
|
+
If you are interested on using it against .NET Core or .NET Framework, please use
|
|
9
|
+
Thoth.Json.Net.
|
|
10
|
+
</Description>
|
|
11
|
+
<FablePackageType>library</FablePackageType>
|
|
12
|
+
<PackageTags>fable-javascript;fsharp;json</PackageTags>
|
|
13
|
+
</PropertyGroup>
|
|
14
|
+
<PropertyGroup>
|
|
15
|
+
<TargetFramework>netstandard2.0</TargetFramework>
|
|
16
|
+
</PropertyGroup>
|
|
17
|
+
<ItemGroup>
|
|
18
|
+
<Compile Include="Types.fs" />
|
|
19
|
+
<Compile Include="Decode.fs" />
|
|
20
|
+
<Compile Include="Encode.fs" />
|
|
21
|
+
<Compile Include="Extra.fs" />
|
|
22
|
+
</ItemGroup>
|
|
23
|
+
<ItemGroup>
|
|
24
|
+
<PackageReference Include="EasyBuild.PackageReleaseNotes.Tasks">
|
|
25
|
+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
26
|
+
<PrivateAssets>all</PrivateAssets>
|
|
27
|
+
</PackageReference>
|
|
28
|
+
<PackageReference Include="Fable.Core" />
|
|
29
|
+
<PackageReference Include="Fable.Package.SDK">
|
|
30
|
+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
31
|
+
<PrivateAssets>all</PrivateAssets>
|
|
32
|
+
</PackageReference>
|
|
33
|
+
</ItemGroup>
|
|
34
|
+
</Project>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
namespace Thoth.Json
|
|
2
|
+
|
|
3
|
+
open System.Text.RegularExpressions
|
|
4
|
+
|
|
5
|
+
type JsonValue = obj
|
|
6
|
+
|
|
7
|
+
type ErrorReason =
|
|
8
|
+
| BadPrimitive of string * JsonValue
|
|
9
|
+
| BadPrimitiveExtra of string * JsonValue * string
|
|
10
|
+
| BadType of string * JsonValue
|
|
11
|
+
| BadField of string * JsonValue
|
|
12
|
+
| BadPath of string * JsonValue * string
|
|
13
|
+
| TooSmallArray of string * JsonValue
|
|
14
|
+
| FailMessage of string
|
|
15
|
+
| BadOneOf of string list
|
|
16
|
+
|
|
17
|
+
type CaseStrategy =
|
|
18
|
+
| PascalCase
|
|
19
|
+
| CamelCase
|
|
20
|
+
| SnakeCase
|
|
21
|
+
|
|
22
|
+
type DecoderError = string * ErrorReason
|
|
23
|
+
|
|
24
|
+
type Decoder<'T> = string -> JsonValue -> Result<'T, DecoderError>
|
|
25
|
+
|
|
26
|
+
type Encoder<'T> = 'T -> JsonValue
|
|
27
|
+
|
|
28
|
+
type BoxedDecoder = Decoder<obj>
|
|
29
|
+
|
|
30
|
+
type BoxedEncoder = Encoder<obj>
|
|
31
|
+
|
|
32
|
+
type ExtraCoders =
|
|
33
|
+
{
|
|
34
|
+
Hash: string
|
|
35
|
+
Coders: Map<string, BoxedEncoder * BoxedDecoder>
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
module internal Util =
|
|
39
|
+
open System.Collections.Generic
|
|
40
|
+
|
|
41
|
+
type Cache<'Value>() =
|
|
42
|
+
let cache = Dictionary<string, 'Value>()
|
|
43
|
+
|
|
44
|
+
member __.GetOrAdd(key, factory) =
|
|
45
|
+
match cache.TryGetValue(key) with
|
|
46
|
+
| true, x -> x
|
|
47
|
+
| false, _ ->
|
|
48
|
+
let x = factory ()
|
|
49
|
+
cache.Add(key, x)
|
|
50
|
+
x
|
|
51
|
+
|
|
52
|
+
// Tree shaking will remove this if not used
|
|
53
|
+
// so no need to make them lazy in Fable
|
|
54
|
+
let CachedEncoders = Cache<BoxedEncoder>()
|
|
55
|
+
let CachedDecoders = Cache<BoxedDecoder>()
|
|
56
|
+
|
|
57
|
+
module Casing =
|
|
58
|
+
let lowerFirst (str: string) =
|
|
59
|
+
str.[..0].ToLowerInvariant() + str.[1..]
|
|
60
|
+
|
|
61
|
+
let convert caseStrategy fieldName =
|
|
62
|
+
match caseStrategy with
|
|
63
|
+
| CamelCase -> lowerFirst fieldName
|
|
64
|
+
| SnakeCase ->
|
|
65
|
+
Regex
|
|
66
|
+
.Replace(lowerFirst fieldName, "[A-Z]", "_$0")
|
|
67
|
+
.ToLowerInvariant()
|
|
68
|
+
| PascalCase -> fieldName
|