Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

mapSecond

import { mapSecond } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/these.ts";

Apply a function to the Left value of a These.

@example
import { mapSecond, left, both } from "./these.ts";
import { pipe } from "./fn.ts";

const result1 = pipe(left("Error"), mapSecond(e => `Error: ${e}`));
console.log(result1); // { tag: "Left", left: "Error: Error" }

const result2 = pipe(both("Warning", 5), mapSecond(w => `Warning: ${w}`));
console.log(result2); // { tag: "Both", left: "Warning: Warning", right: 5 }
function mapSecond<B, J>(fbj: (b: B) => J): <A>(ta: These<B, A>) => These<J, A>;
§
mapSecond<B, J>(fbj: (b: B) => J): <A>(ta: These<B, A>) => These<J, A>
[src]

§Type Parameters

§Parameters

§
fbj: (b: B) => J
[src]

§Return Type

§
<A>(ta: These<B, A>) => These<J, A>
[src]