How to use the bs-platform/lib/js/array.js.to_list 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
}), json), 0),
                  /* hex */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(colorsDir + ("/" + file), "utf8");
                }), List.filter((function (file) {
                        if (file !== "page.json") {
                          return +file.includes(".json");
                        } else {
                          return /* false */0;
                        }
                      }))($$Array.to_list(Fs.readdirSync(colorsDir))))));
  return /* Colors */Block.__(0, [clrs]);
}
github mpaiva / tokenizer / src / CLI.bs.js View on Github external
/* 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 nars-dev / nars / packages / nars / src / JsValue.bs.js View on Github external
function dictToStruct(dict) {
  return $$Array.to_list(Js_dict.entries(dict).map((function (param) {
                    return /* tuple */[
                            param[0],
                            toValue(param[1])
                          ];
                  })));
}
github nars-dev / nars / packages / nars / src / FlatList.bs.js View on Github external
function encoder(key, param, bridge, children) {
  var props = param[0];
  var children$1 = $$Array.to_list(props.keys.map((function (key, i) {
              var init = Caml_array.caml_array_get(children, i);
              return {
                      key: key,
                      value: init.value
                    };
            })));
  return {
          key: key,
          value: /* `FlatList */[
            -193011497,
            {
              style: ProtoEncoders.encodeStyleOptional(props),
              onEndReached: ProtoEncoders.encodeArityZeroCallbackOptional(bridge.registerCallback, props.onEndReached),
              onEndReachedThreshold: Js_option.map((function (threshold) {
                      return threshold | 0;
                    }), props.onEndReachedThreshold),
github nars-dev / nars / packages / nars / src / JsValue.bs.js View on Github external
return /* `Undefined_value */[
              629889314,
              /* UNDEFINED_VALUE */0
            ];
    }
  } else {
    switch (match.tag | 0) {
      case /* Object */0 :
          return /* `Struct_value */[
                  -483181849,
                  dictToStruct(match[0])
                ];
      case /* Array */1 :
          return /* `List_value */[
                  -769490512,
                  $$Array.to_list(match[0].map(toValue))
                ];
      case /* String */2 :
          return /* `String_value */[
                  -663343517,
                  match[0]
                ];
      case /* Boolean */3 :
          return /* `Bool_value */[
                  258787964,
                  match[0]
                ];
      case /* Number */4 :
          return /* `Number_value */[
                  -785426853,
                  match[0]
                ];
github nars-dev / nars / packages / nars / src / TouchableOpacity.bs.js View on Github external
function encoder(key, param, bridge, children) {
  var props = param[0];
  var onPress = ProtoEncoders.encodeArityZeroCallbackOptional(bridge.registerCallback, props.onPress);
  return {
          key: key,
          value: /* `TouchableOpacity */[
            -711832046,
            {
              onPress: onPress,
              children: $$Array.to_list(children),
              localProps: ProtoEncoders.encodeOptionalLocalProps(props.localProps)
            }
          ]
        };
}
github nars-dev / nars / packages / nars / src / AnimatedText.bs.js View on Github external
function encoder(key, param, param$1, children) {
  return {
          key: key,
          value: /* `AnimatedText */[
            -230079216,
            {
              style: ProtoEncoders.encodeAnimatedStyleOptional(param$1.updateAnimatedValue, param[0]),
              children: $$Array.to_list(children)
            }
          ]
        };
}
github nars-dev / nars / packages / nars / src / AnimatedView.bs.js View on Github external
function encoder(key, param, param$1, children) {
  return {
          key: key,
          value: /* `AnimatedView */[
            -207705400,
            {
              style: ProtoEncoders.encodeAnimatedStyleOptional(param$1.updateAnimatedValue, param[0]),
              children: $$Array.to_list(children)
            }
          ]
        };
}