How to use @glennsl/bs-json - 10 common examples

To help you get started, we’ve selected a few @glennsl/bs-json examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github phated / mxdbmobile / src / Filter.js View on Github external
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
github phated / mxdbmobile / src / card / CardImage.js View on Github external
function decoder(json) {
  return /* record */[/* thumbnail */Json_decode.field("thumbnail", Json_decode.string, json)];
}
github phated / mxdbmobile / src / card / Effect.js View on Github external
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)
        ];
}
github phated / mxdbmobile / src / card / Character.js View on Github external
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)
        ];
}
github phated / mxdbmobile / src / card / Battle.js View on Github external
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)
        ];
}
github phated / mxdbmobile / src / card / Event.js View on Github external
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)
        ];
}
github phated / mxdbmobile / src / card / Battle.js View on Github external
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)
        ];
}
github phated / mxdbmobile / src / card / Character.js View on Github external
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)
        ];
}
github phated / mxdbmobile / src / CardList.js View on Github external
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)
        ];
}
github phated / mxdbmobile / src / card / Stat.js View on Github external
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);
}