Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function valueOrCompute(opt, fn) {
if (opt !== undefined) {
return Caml_option.valFromOption(opt);
} else {
return Curry._1(fn, /* () */0);
}
}
if (match$33 !== undefined) {
var value$14 = Caml_option.valFromOption(match$33);
var match$34 = Js_json.decodeNull(value$14);
if (match$34 !== undefined) {
tmp$14 = undefined;
} else {
var match$35 = Js_json.decodeString(value$14);
tmp$14 = match$35 !== undefined ? match$35 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$14));
}
} else {
tmp$14 = undefined;
}
var match$36 = Js_dict.get(value$9, "album");
var tmp$15;
if (match$36 !== undefined) {
var value$15 = Caml_option.valFromOption(match$36);
var match$37 = Js_json.decodeNull(value$15);
if (match$37 !== undefined) {
tmp$15 = undefined;
} else {
var match$38 = Js_json.decodeObject(value$15);
var tmp$16;
if (match$38 !== undefined) {
var match$39 = Js_dict.get(Caml_option.valFromOption(match$38), "images");
var tmp$17;
if (match$39 !== undefined) {
var value$16 = Caml_option.valFromOption(match$39);
var match$40 = Js_json.decodeNull(value$16);
if (match$40 !== undefined) {
tmp$17 = undefined;
} else {
var match$41 = Js_json.decodeArray(value$16);
var match$3 = Js_dict.get(Caml_option.valFromOption(match$2), "me");
var tmp$1;
if (match$3 !== undefined) {
var value$1 = Caml_option.valFromOption(match$3);
var match$4 = Js_json.decodeNull(value$1);
if (match$4 !== undefined) {
tmp$1 = undefined;
} else {
var match$5 = Js_json.decodeObject(value$1);
var tmp$2;
if (match$5 !== undefined) {
var value$2 = Caml_option.valFromOption(match$5);
var match$6 = Js_dict.get(value$2, "id");
var tmp$3;
if (match$6 !== undefined) {
var value$3 = Caml_option.valFromOption(match$6);
var match$7 = Js_json.decodeNull(value$3);
if (match$7 !== undefined) {
tmp$3 = undefined;
} else {
var match$8 = Js_json.decodeString(value$3);
tmp$3 = match$8 !== undefined ? match$8 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$3));
}
} else {
tmp$3 = undefined;
}
var match$9 = Js_dict.get(value$2, "player");
var tmp$4;
if (match$9 !== undefined) {
var value$4 = Caml_option.valFromOption(match$9);
var match$10 = Js_json.decodeNull(value$4);
if (match$10 !== undefined) {
}
return {
name: tmp
};
} else {
return Js_exn.raiseError("graphql_ppx: Object is not a value");
}
})) : Js_exn.raiseError("graphql_ppx: Expected array, got " + JSON.stringify(value$12));
}
} else {
tmp$12 = undefined;
}
var match$30 = Js_dict.get(value$9, "durationMs");
var tmp$13;
if (match$30 !== undefined) {
var value$13 = Caml_option.valFromOption(match$30);
var match$31 = Js_json.decodeNull(value$13);
if (match$31 !== undefined) {
tmp$13 = undefined;
} else {
var match$32 = Js_json.decodeNumber(value$13);
tmp$13 = match$32 !== undefined ? match$32 | 0 : Js_exn.raiseError("graphql_ppx: Expected int, got " + JSON.stringify(value$13));
}
} else {
tmp$13 = undefined;
}
var match$33 = Js_dict.get(value$9, "href");
var tmp$14;
if (match$33 !== undefined) {
var value$14 = Caml_option.valFromOption(match$33);
var match$34 = Js_json.decodeNull(value$14);
if (match$34 !== undefined) {
tmp$17 = match$41 !== undefined ? match$41.map((function (value) {
var match = Js_json.decodeObject(value);
if (match !== undefined) {
var match$1 = Js_dict.get(Caml_option.valFromOption(match), "url");
var tmp;
if (match$1 !== undefined) {
var value$1 = Caml_option.valFromOption(match$1);
var match$2 = Js_json.decodeNull(value$1);
if (match$2 !== undefined) {
tmp = undefined;
} else {
var match$3 = Js_json.decodeString(value$1);
tmp = match$3 !== undefined ? match$3 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$1));
}
} else {
tmp = undefined;
}
return {
url: tmp
};
} else {
return Js_exn.raiseError("graphql_ppx: Object is not a value");
}
if (match$6 !== undefined) {
var value$3 = Caml_option.valFromOption(match$6);
var match$7 = Js_json.decodeNull(value$3);
if (match$7 !== undefined) {
tmp$3 = undefined;
} else {
var match$8 = Js_json.decodeString(value$3);
tmp$3 = match$8 !== undefined ? match$8 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$3));
}
} else {
tmp$3 = undefined;
}
var match$9 = Js_dict.get(value$2, "displayName");
var tmp$4;
if (match$9 !== undefined) {
var value$4 = Caml_option.valFromOption(match$9);
var match$10 = Js_json.decodeNull(value$4);
if (match$10 !== undefined) {
tmp$4 = undefined;
} else {
var match$11 = Js_json.decodeString(value$4);
tmp$4 = match$11 !== undefined ? match$11 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$4));
}
} else {
tmp$4 = undefined;
}
tmp$2 = {
id: tmp$3,
displayName: tmp$4
};
} else {
tmp$2 = Js_exn.raiseError("graphql_ppx: Object is not a value");
if (match$24 !== undefined) {
var value$11 = Caml_option.valFromOption(match$24);
var match$25 = Js_json.decodeNull(value$11);
if (match$25 !== undefined) {
tmp$11 = undefined;
} else {
var match$26 = Js_json.decodeString(value$11);
tmp$11 = match$26 !== undefined ? match$26 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$11));
}
} else {
tmp$11 = undefined;
}
var match$27 = Js_dict.get(value$9, "artists");
var tmp$12;
if (match$27 !== undefined) {
var value$12 = Caml_option.valFromOption(match$27);
var match$28 = Js_json.decodeNull(value$12);
if (match$28 !== undefined) {
tmp$12 = undefined;
} else {
var match$29 = Js_json.decodeArray(value$12);
tmp$12 = match$29 !== undefined ? match$29.map((function (value) {
var match = Js_json.decodeObject(value);
if (match !== undefined) {
var match$1 = Js_dict.get(Caml_option.valFromOption(match), "name");
var tmp;
if (match$1 !== undefined) {
var value$1 = Caml_option.valFromOption(match$1);
var match$2 = Js_json.decodeNull(value$1);
if (match$2 !== undefined) {
tmp = undefined;
} else {
if (match$15 !== undefined) {
var value$7 = Caml_option.valFromOption(match$15);
var match$16 = Js_json.decodeNull(value$7);
if (match$16 !== undefined) {
tmp$7 = undefined;
} else {
var match$17 = Js_json.decodeString(value$7);
tmp$7 = match$17 !== undefined ? match$17 : Js_exn.raiseError("graphql_ppx: Expected string, got " + JSON.stringify(value$7));
}
} else {
tmp$7 = undefined;
}
var match$18 = Js_dict.get(value$5, "item");
var tmp$8;
if (match$18 !== undefined) {
var value$8 = Caml_option.valFromOption(match$18);
var match$19 = Js_json.decodeNull(value$8);
if (match$19 !== undefined) {
tmp$8 = undefined;
} else {
var match$20 = Js_json.decodeObject(value$8);
var tmp$9;
if (match$20 !== undefined) {
var value$9 = Caml_option.valFromOption(match$20);
var match$21 = Js_dict.get(value$9, "id");
var tmp$10;
if (match$21 !== undefined) {
var value$10 = Caml_option.valFromOption(match$21);
var match$22 = Js_json.decodeNull(value$10);
if (match$22 !== undefined) {
tmp$10 = undefined;
} else {
}
var match$36 = Js_dict.get(value$9, "album");
var tmp$15;
if (match$36 !== undefined) {
var value$15 = Caml_option.valFromOption(match$36);
var match$37 = Js_json.decodeNull(value$15);
if (match$37 !== undefined) {
tmp$15 = undefined;
} else {
var match$38 = Js_json.decodeObject(value$15);
var tmp$16;
if (match$38 !== undefined) {
var match$39 = Js_dict.get(Caml_option.valFromOption(match$38), "images");
var tmp$17;
if (match$39 !== undefined) {
var value$16 = Caml_option.valFromOption(match$39);
var match$40 = Js_json.decodeNull(value$16);
if (match$40 !== undefined) {
tmp$17 = undefined;
} else {
var match$41 = Js_json.decodeArray(value$16);
tmp$17 = match$41 !== undefined ? match$41.map((function (value) {
var match = Js_json.decodeObject(value);
if (match !== undefined) {
var match$1 = Js_dict.get(Caml_option.valFromOption(match), "url");
var tmp;
if (match$1 !== undefined) {
var value$1 = Caml_option.valFromOption(match$1);
var match$2 = Js_json.decodeNull(value$1);
if (match$2 !== undefined) {
tmp = undefined;
} else {