Skip to main content
Module

x/fun/record.ts>lookupAt

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function lookupAt
import { lookupAt } from "https://deno.land/x/fun@v2.0.0-alpha.6/record.ts";

Lookup the value at key. Returns an Option, where None indicates that the record does not hold the key.

Examples

Example 1

import * as R from "./record.ts";
import { pipe } from "./fn.ts";

const result1 = pipe(
  { one: 1, two: 2 },
  R.lookupAt('one'),
); // Some(1)
const result2 = pipe(
  { one: 1, two: 2 },
  R.lookupAt('three'),
); // None

Parameters

key: string