//#region src/Map/getOrThrow.d.ts /** * # getOrThrow * * ```ts * function Map.getOrThrow( * target: ReadonlyMap, * key: NoInfer, * ): Exclude * ``` * * Gets the value associated with the specified key, or throws an error if the value is `null` or `undefined`. * * ## Example * * ```ts [data-first] * import { Map } from "@monstermann/map"; * * Map.getOrThrow( * new Map([ * ["a", 1], * ["b", 2], * ]), * "a", * ); // 1 * * Map.getOrThrow( * new Map([ * ["a", 1], * ["b", null], * ]), * "b", * ); // throws FnError * * Map.getOrThrow( * new Map([ * ["a", 1], * ["b", 2], * ]), * "c", * ); // throws FnError * ``` * * ```ts [data-last] * import { Map } from "@monstermann/map"; * * pipe( * new Map([ * ["a", 1], * ["b", 2], * ]), * Map.getOrThrow("a"), * ); // 1 * * pipe( * new Map([ * ["a", 1], * ["b", null], * ]), * Map.getOrThrow("b"), * ); // throws FnError * * pipe( * new Map([ * ["a", 1], * ["b", 2], * ]), * Map.getOrThrow("c"), * ); // throws FnError * ``` * */ declare const getOrThrow: { (key: NoInfer): (target: ReadonlyMap) => Exclude; (target: ReadonlyMap, key: NoInfer): Exclude; }; //#endregion export { getOrThrow };