How to use the bs-platform/lib/js/list.js.filter function in bs-platform

To help you get started, we’ve selected a few bs-platform 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 mpaiva / tokenizer / src / CLI.bs.js View on Github external
function buildTypography(typographyDir) {
  console.log("Building Typography Variables");
  console.log("Reading data from " + typographyDir);
  var dir = List.hd(List.filter((function (file) {
                return +(file !== "page.json");
              }))($$Array.to_list(Fs.readdirSync(typographyDir))));
  var typos = List.map((function (json) {
          return /* record */[
                  /* name */Caml_array.caml_array_get(Json_decode.field("overrideValues", (function (param) {
                              return Json_decode.array((function (param) {
                                            return Json_decode.field("value", Json_decode.string, param);
                                          }), param);
                            }), json), 0),
                  /* value */Caml_array.caml_array_get(Json_decode.field("overrideValues", (function (param) {
                              return Json_decode.array((function (param) {
                                            return Json_decode.field("value", Json_decode.string, param);
                                          }), param);
                            }), json), 1)
                ];
        }), List.map(Json.parseOrRaise, List.map((function (file) {
github mpaiva / tokenizer / src / CLI.bs.js View on Github external
var typos = List.map((function (json) {
          return /* record */[
                  /* name */Caml_array.caml_array_get(Json_decode.field("overrideValues", (function (param) {
                              return Json_decode.array((function (param) {
                                            return Json_decode.field("value", Json_decode.string, param);
                                          }), param);
                            }), json), 0),
                  /* value */Caml_array.caml_array_get(Json_decode.field("overrideValues", (function (param) {
                              return Json_decode.array((function (param) {
                                            return Json_decode.field("value", Json_decode.string, param);
                                          }), param);
                            }), json), 1)
                ];
        }), List.map(Json.parseOrRaise, List.map((function (file) {
                  return Fs.readFileSync(typographyDir + ("/" + (dir + ("/" + file))), "utf8");
                }), List.filter((function (file) {
                        return +(file !== "artboard.json");
                      }))($$Array.to_list(Fs.readdirSync(typographyDir + ("/" + dir)))))));
  return /* Typography */Block.__(1, [typos]);
}
github GuillaumeSalles / resuggest / src / generated / functions.js View on Github external
function suggest_2(funcs, input1, input2, output) {
  return $$Array.of_list(List.map((function (prim) {
                    return prim[1];
                  }), List.filter((function (param) {
                          return +(Curry._2(param[0], input1, input2) === output);
                        }))(funcs)));
}
github Simon-Initiative / authoring-client / src / styles / reason / StyleUtils.bs.js View on Github external
function classNames(names) {
  return List.fold_left((function (a, b) {
                return a + (" " + b);
              }), "", List.filter((function (name) {
                      return name !== "";
                    }))(names));
}
github GuillaumeSalles / resuggest / src / generated / functions.js View on Github external
function suggest_3(funcs, input1, input2, input3, output) {
  return $$Array.of_list(List.map((function (prim) {
                    return prim[1];
                  }), List.filter((function (param) {
                          return +(Curry._3(param[0], input1, input2, input3) === output);
                        }))(funcs)));
}
github GuillaumeSalles / resuggest / src / generated / functions.js View on Github external
function suggest_1(funcs, input, output) {
  return $$Array.of_list(List.map((function (prim) {
                    return prim[1];
                  }), List.filter((function (param) {
                          return +(Curry._1(param[0], input) === output);
                        }))(funcs)));
}