Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function encode(filter) {
var query;
if (filter) {
var text = filter[0];
if (isSymbol(text)) {
console.log("is symbol");
query = Json_encode.object_(/* :: */[
/* tuple */[
"symbol",
text
],
/* [] */0
]);
} else {
query = Json_encode.object_(/* :: */[
/* tuple */[
"title",
text
],
/* :: */[
/* tuple */[
"subtitle",
text
function decoder(json) {
return /* record */[/* thumbnail */Json_decode.field("thumbnail", Json_decode.string, json)];
}
function decoder(json) {
return /* record */[
/* symbol */Json_decode.field("symbol", Symbol$Mxdbmobile.decoder, json),
/* text */Json_decode.optional((function (param) {
return Json_decode.field("text", Json_decode.string, param);
}), json)
];
}
function decoder(json) {
return /* record */[
/* uid */Json_decode.field("uid", Json_decode.string, json),
/* title */Json_decode.field("title", Json_decode.string, json),
/* subtitle */Json_decode.field("subtitle", Json_decode.string, json),
/* trait */Json_decode.field("trait", (function (param) {
return Json_decode.field("name", Json_decode.string, param);
}), json),
/* mp */Json_decode.field("mp", MP$Mxdbmobile.decoder, json),
/* stats */Json_decode.field("stats", StatList$Mxdbmobile.decoder, json),
/* effect */Json_decode.field("effect", Effect$Mxdbmobile.decoder, json),
/* image */Json_decode.field("image", CardImage$Mxdbmobile.decoder, json)
];
}
function decoder(json) {
return /* record */[
/* uid */Json_decode.field("uid", Json_decode.string, json),
/* title */Json_decode.field("title", Json_decode.string, json),
/* mp */Json_decode.field("mp", MP$Mxdbmobile.decoder, json),
/* stat */Json_decode.field("stats", BattleStat$Mxdbmobile.decoder, json),
/* effect */Json_decode.field("effect", Effect$Mxdbmobile.decoder, json),
/* image */Json_decode.field("image", CardImage$Mxdbmobile.decoder, json)
];
}
function decoder(json) {
return /* record */[
/* uid */Json_decode.field("uid", Json_decode.string, json),
/* title */Json_decode.field("title", Json_decode.string, json),
/* mp */Json_decode.field("mp", MP$Mxdbmobile.decoder, json),
/* effect */Json_decode.field("effect", Effect$Mxdbmobile.decoder, json),
/* image */Json_decode.field("image", CardImage$Mxdbmobile.decoder, json)
];
}
function decoder(json) {
return /* record */[
/* uid */Json_decode.field("uid", Json_decode.string, json),
/* title */Json_decode.field("title", Json_decode.string, json),
/* mp */Json_decode.field("mp", MP$Mxdbmobile.decoder, json),
/* stat */Json_decode.field("stats", BattleStat$Mxdbmobile.decoder, json),
/* effect */Json_decode.field("effect", Effect$Mxdbmobile.decoder, json),
/* image */Json_decode.field("image", CardImage$Mxdbmobile.decoder, json)
];
}
function decoder(json) {
return /* record */[
/* uid */Json_decode.field("uid", Json_decode.string, json),
/* title */Json_decode.field("title", Json_decode.string, json),
/* subtitle */Json_decode.field("subtitle", Json_decode.string, json),
/* trait */Json_decode.field("trait", (function (param) {
return Json_decode.field("name", Json_decode.string, param);
}), json),
/* mp */Json_decode.field("mp", MP$Mxdbmobile.decoder, json),
/* stats */Json_decode.field("stats", StatList$Mxdbmobile.decoder, json),
/* effect */Json_decode.field("effect", Effect$Mxdbmobile.decoder, json),
/* image */Json_decode.field("image", CardImage$Mxdbmobile.decoder, json)
];
}
function decode(json) {
return /* record */[
/* characters */Json_decode.field("characters", (function (param) {
return Json_decode.array(Character$Mxdbmobile.decoder, param);
}), json),
/* events */Json_decode.field("events", (function (param) {
return Json_decode.array(Event$Mxdbmobile.decoder, param);
}), json),
/* battles */Json_decode.field("battles", (function (param) {
return Json_decode.array(Battle$Mxdbmobile.decoder, param);
}), json)
];
}
return Json_decode.map(fromRecord, (function (json) {
return /* record */[
/* type_ */Json_decode.field("type", Json_decode.string, json),
/* rank */Json_decode.field("rank", Json_decode.$$int, json)
];
}), json);
}