UNPKG

pragmatic-fp-ts

Version:

Opinionated functional programming library with easy use in mind

19 lines (18 loc) 488 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getValue = void 0; const main_1 = require("./main"); function getValue(candidate) { if ((0, main_1.isFunction)(candidate === null || candidate === void 0 ? void 0 : candidate.getValue)) { try { return getValue(candidate.getValue()); } catch (_a) { return null; } } else { return candidate; } } exports.getValue = getValue;