Rebasely Beta: data may be purged

justintypescript-ultra-strict Public

TypeScript · 20 lines · 905 B · at 503e839

import type { Option, Result } from "./index.js";export declare const fromNullable: <T>(value: T | null | undefined) => Option<T>;export declare const wrapSync: <A extends unknown[], R>(  fn: (...args: A) => R,) => (...args: A) => Result<R, Error>;export declare const wrapAsync: <A extends unknown[], R>(  fn: (...args: A) => R | Promise<R>,) => (...args: A) => Promise<Result<Awaited<R>, Error>>;/** A plain object (not null, not an array). Narrows unknown without a cast. */export declare const isRecord: (value: unknown) => value is Record<string, unknown>;/** Some(value) when value is a plain object, otherwise None. */export declare const asRecord: (value: unknown) => Option<Record<string, unknown>>;/** The own property `key` of a plain object, as an Option (None when absent, null or undefined). */export declare const field: (value: unknown, key: string) => Option<unknown>;