UNPKG

pragmatic-fp-ts

Version:

Opinionated functional programming library with easy use in mind

22 lines (21 loc) 699 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.propEq = void 0; const main_1 = require("./main"); function propEq(path, value, input) { if (arguments.length === 1) { return function (_value, _input) { return arguments.length === 1 ? propEq(path, _value) : propEq(path, _value, _input); }; } else if (arguments.length === 2) { return (_input) => propEq(path, value, _input); } const propValue = path instanceof Array ? (0, main_1.getIn)(path, input) : (0, main_1.get)(path, input); return (0, main_1.equals)(propValue, value); } exports.propEq = propEq;