All files has.js

75% Statements 18/24
100% Branches 0/0
62.5% Functions 10/16
100% Lines 8/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36            54x       3x       50x       13x       3x       3x       30x       21x  
// requires [spread](spread.html), and [iterable](iterable.html)
import { hasify, } from './iterable';
import { spread, spreadK, spreadV, } from './spread';
 
// **has** `:: Iterable<a> -> a -> bool`  
// checks if an iterable contains an element
export const has = coll => el => hasify(coll).has(el);
 
// **xhas** `:: Iterable<a> -> a -> bool`  
// checks if an iterable does not contain an element
export const xhas = coll => el => !has(coll)(el);
 
// **hasK** `:: Iterable<a> -> a -> bool`  
// checks if an iterables keys contains an element
export const hasK = coll => k => has(spreadK(coll))(k);
 
// **xhasK** `:: Iterable<a> -> a -> bool`  
// checks if an iterables keys does not contain an element
export const xhasK = coll => k => !hasK(coll)(k);
 
// **hasV** `:: Iterable<a> -> a -> bool`  
// checks if an iterables values contain an element
export const hasV = coll => v => has(spreadV(coll))(v);
 
// **xhasV** `:: Iterable<a> -> a -> bool`  
// checks if an iterables values does not contain an element
export const xhasV = coll => v => !hasV(coll)(v);
 
// **hasKV** `:: Iterable<a> -> [k,v] -> bool`  
// checks if an iterables keys contain the key of a [k,v] pair
export const hasKV = coll => ([ k, v, ]) => hasK(coll)(k);
 
// **xhasKV** `:: Iterable<a> -> [k,v] -> bool`  
// checks if an iterables keys do not contain the key of a [k,v] pair
export const xhasKV = coll => ([ k, v, ]) => !hasKV(coll)([ k, v, ]);