{"size": 2143, "ext": "js", "max_stars_repo_path": "defaults/meta3d-commonlib/lib/es6_global/src/structure/OptionSt.bs.js", "max_stars_repo_name": "Wonder-Technology/Meta3D", "max_stars_repo_stars_event_min_datetime": "2022-02-17T23:55:30.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T10:55:03.000Z", "max_issues_repo_path": "defaults/meta3d-commonlib/lib/es6_global/src/structure/OptionSt.bs.js", "max_issues_repo_name": "Wonder-Technology/Meta3D", "max_issues_repo_issues_event_min_datetime": "2022-03-10T06:58:55.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-10T07:20:47.000Z", "max_forks_repo_path": "defaults/meta3d-commonlib/lib/es6_global/src/structure/OptionSt.bs.js", "max_forks_repo_name": "Wonder-Technology/Meta3D", "max_forks_repo_forks_event_min_datetime": "2022-03-10T07:59:29.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-10T07:59:29.000Z"}
{"max_stars_count": 28, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 22.3229166667, "max_line_length": 92, "alphanum_fraction": 0.6794213719}


import * as Curry from "./../../../../../rescript/lib/es6/curry.js";
import * as Belt_Option from "./../../../../../rescript/lib/es6/belt_Option.js";
import * as Caml_option from "./../../../../../rescript/lib/es6/caml_option.js";
import * as Js_null_undefined from "./../../../../../rescript/lib/es6/js_null_undefined.js";
import * as Result$Meta3dCommonlib from "./Result.bs.js";

function unsafeGet(prim) {
  return prim;
}

var _getExn = ((nullableData) => {
  if (nullableData !== undefined) {
    return nullableData;
  }

  throw new Error("Not_found")
});

var getExn = _getExn;

function buildFailResult(param) {
  return Result$Meta3dCommonlib.failWith("data not exist in option data");
}

function get(optionData) {
  if (optionData !== undefined) {
    return Result$Meta3dCommonlib.succeed(Caml_option.valFromOption(optionData));
  } else {
    return Result$Meta3dCommonlib.failWith("data not exist in option data");
  }
}

function fromNullable(optionData) {
  if (optionData == null) {
    return ;
  } else {
    return Caml_option.some(optionData);
  }
}

var toNullable = Js_null_undefined.from_opt;

function forEachResult(optionData, func) {
  if (optionData !== undefined) {
    return Curry._1(func, Caml_option.valFromOption(optionData));
  } else {
    return Result$Meta3dCommonlib.succeed(undefined);
  }
}

function sequenceResultM(optionData) {
  if (optionData !== undefined) {
    return Result$Meta3dCommonlib.mapSuccess(optionData, (function (value) {
                  return Caml_option.some(value);
                }));
  } else {
    return Result$Meta3dCommonlib.succeed(undefined);
  }
}

function open_(optionOptionData) {
  if (optionOptionData !== undefined) {
    return Caml_option.valFromOption(optionOptionData);
  }
  
}

var getWithDefault = Belt_Option.getWithDefault;

var isSome = Belt_Option.isSome;

var map = Belt_Option.map;

var bind = Belt_Option.flatMap;

export {
  unsafeGet ,
  _getExn ,
  getExn ,
  buildFailResult ,
  get ,
  getWithDefault ,
  isSome ,
  map ,
  bind ,
  fromNullable ,
  toNullable ,
  forEachResult ,
  sequenceResultM ,
  open_ ,
  
}
/* No side effect */
