UNPKG
imma
Version:
latest (0.0.1)
0.0.1
A collection of functions for dealing with native arrays and objects immutably
imma
/
lib
/
general
/
includes.js
10 lines
(7 loc)
•
288 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
'use strict'
const
objectSome =
require
(
'../object/some'
)
const
createPredicate
= value =>
other
=>
other === value
const
includes =
module
.
exports
=
(
iterable, value
) =>
Array
.
isArray
(iterable) ? iterable.
includes
(value) :
objectSome
(
object
,
createPredicate
(value))