UNPKG

pragmatic-fp-ts

Version:

Opinionated functional programming library with easy use in mind

13 lines (12 loc) 445 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isIn = void 0; const main_1 = require("./main"); function isIn(coll, what) { if (arguments.length === 1) return (candidate) => isIn(coll, candidate); const candidate = (0, main_1.getValue)(what); const theColl = (0, main_1.getValue)(coll); return (0, main_1.isNil)(theColl) ? false : theColl.includes(candidate); } exports.isIn = isIn;