UNPKG

pragmatic-fp-ts

Version:

Opinionated functional programming library with easy use in mind

13 lines (12 loc) 461 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.includes = void 0; const main_1 = require("./main"); function includes(what, coll) { if (arguments.length === 1) return (theColl) => includes(what, theColl); 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.includes = includes;