fn(url$1) =>
let schemeIdx$2 = @std.string-index-of(text: $1, target: "://", startIndex: 0);
let searchStart$3 = match @core.greater-than-or-equal(left: $2, right: 0) {
true =>
@core.plus(left: $2, right: 3),
false =>
0
};
let slashIdx$4 = @std.string-index-of(text: $1, target: "/", startIndex: $3);
let queryIdx$5 = @std.string-index-of(text: $1, target: "?", startIndex: $3);
match @core.less-than(left: $4, right: 0) {
true =>
"/",
false =>
let endIdx$6 = match @core.greater-than-or-equal(left: $5, right: 0) {
true =>
$5,
false =>
@core.string-length(value: $1)
};
match @core.less-than-or-equal(left: $6, right: $4) {
true =>
"/",
false =>
@core.string-slice(value: $1, start: $4, end: $6)
}
}