-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathToRecordInlines-snapshot.js
43 lines (43 loc) · 3.36 KB
/
ToRecordInlines-snapshot.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// @inline export decoder arity=1
import * as $runtime from "../runtime.js";
import * as Codec$dJson$dUnidirectional$dValue from "../Codec.Json.Unidirectional.Value/index.js";
import * as Data$dEither from "../Data.Either/index.js";
import * as Type$dProxy from "../Type.Proxy/index.js";
const decoder = /* #__PURE__ */ (() => {
const $0 = Codec$dJson$dUnidirectional$dValue.toRecordObjCons(Codec$dJson$dUnidirectional$dValue.toRecordObjCons(Codec$dJson$dUnidirectional$dValue.toRecordObjCons(Codec$dJson$dUnidirectional$dValue.toRecordObjCons(Codec$dJson$dUnidirectional$dValue.toRecordObjCons(Codec$dJson$dUnidirectional$dValue.toRecordObjCons(Codec$dJson$dUnidirectional$dValue.toRecordObjCons(Codec$dJson$dUnidirectional$dValue.toRecordObjCons(Codec$dJson$dUnidirectional$dValue.toRecordObjCons(Codec$dJson$dUnidirectional$dValue.toRecordObjCons(Codec$dJson$dUnidirectional$dValue.toRecordObjNil)({
reflectSymbol: () => "static"
})()()())({reflectSymbol: () => "reqRen"})()()())({reflectSymbol: () => "req"})()()())({reflectSymbol: () => "optRen"})()()())({reflectSymbol: () => "optDefRen"})()()())({
reflectSymbol: () => "optDef"
})()()())({reflectSymbol: () => "optAssocArr"})()()())({reflectSymbol: () => "optArr"})()()())({reflectSymbol: () => "opt"})()()())({reflectSymbol: () => "nested"})()()().toRecordObj(Type$dProxy.Proxy)({
static: (v, v1) => Data$dEither.$Either("Right", 1),
req: Codec$dJson$dUnidirectional$dValue.toRequired(Codec$dJson$dUnidirectional$dValue.toInt),
reqRen: Codec$dJson$dUnidirectional$dValue.toRequiredRename("otherName")(Codec$dJson$dUnidirectional$dValue.toString),
opt: Codec$dJson$dUnidirectional$dValue.toOption(Codec$dJson$dUnidirectional$dValue.toString),
optRen: Codec$dJson$dUnidirectional$dValue.toOptionRename("otherName2")(Codec$dJson$dUnidirectional$dValue.toString),
optDef: Codec$dJson$dUnidirectional$dValue.toOptionDefault(1)(Codec$dJson$dUnidirectional$dValue.toInt),
optDefRen: Codec$dJson$dUnidirectional$dValue.toOptionDefaultRename("otherName3")(2)(Codec$dJson$dUnidirectional$dValue.toInt),
optArr: Codec$dJson$dUnidirectional$dValue.toOptionArray(Codec$dJson$dUnidirectional$dValue.toString),
optAssocArr: Codec$dJson$dUnidirectional$dValue.toOptionAssocArray(Data$dEither.Right)(Codec$dJson$dUnidirectional$dValue.toString),
nested: Codec$dJson$dUnidirectional$dValue.toRequired((() => {
const $0 = Codec$dJson$dUnidirectional$dValue.toRecordObjCons(Codec$dJson$dUnidirectional$dValue.toRecordObjCons(Codec$dJson$dUnidirectional$dValue.toRecordObjNil)({
reflectSymbol: () => "other"
})()()())({reflectSymbol: () => "foo"})()()().toRecordObj(Type$dProxy.Proxy)({
other: Codec$dJson$dUnidirectional$dValue.toRequired(Codec$dJson$dUnidirectional$dValue.toBoolean),
foo: Codec$dJson$dUnidirectional$dValue.toOption(Codec$dJson$dUnidirectional$dValue.toBoolean)
});
return a => {
const $1 = Codec$dJson$dUnidirectional$dValue.toJObject(a);
if ($1.tag === "Right") { return $0($1._1); }
if ($1.tag === "Left") { return Data$dEither.$Either("Left", $1._1); }
$runtime.fail();
};
})())
});
return a => {
const $1 = Codec$dJson$dUnidirectional$dValue.toJObject(a);
if ($1.tag === "Right") { return $0($1._1); }
if ($1.tag === "Left") { return Data$dEither.$Either("Left", $1._1); }
$runtime.fail();
};
})();
export {decoder};