UNPKG

fp-ts-std

Version:

The missing pseudo-standard library for fp-ts.

7 lines (6 loc) 317 B
import * as IOO from "fp-ts/IOOption"; import * as O from "fp-ts/Option"; import { flow, pipe } from "fp-ts/function"; import * as NES from "./NonEmptyString"; export const getParam = (k) => () => pipe(process.env[k], O.fromNullable); export const getParamNonEmpty = flow(getParam, IOO.chainOptionK(NES.fromString));