source: node_modules/ramda-adjunct/es/lensNotSatisfy.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1import { complement } from 'ramda';
2import lensSatisfies from './lensSatisfies';
3
4/**
5 * Returns `true` if data structure focused by the given lens doesn't satisfy the predicate.
6 * Note that the predicate is expected to return boolean value.
7 *
8 * @func lensNotSatisfy
9 * @memberOf RA
10 * @since {@link https://char0n.github.io/ramda-adjunct/1.13.0|1.13.0}
11 * @category Relation
12 * @typedef Lens s a = Functor f => (a -> f a) -> s -> f s
13 * @sig Boolean b => (a -> b) -> Lens s a -> s -> b
14 * @see {@link RA.lensSatisfies|lensSatisfies}
15 * @param {Function} predicate The predicate function
16 * @param {Function} lens Van Laarhoven lens
17 * @param {*} data The data structure
18 * @return {boolean} `false` if the focused data structure satisfies the predicate, `true` otherwise
19 *
20 * @example
21 *
22 * RA.lensNotSatisfy(RA.isTrue, R.lensIndex(0), [false, true, 1]); // => true
23 * RA.lensNotSatisfy(RA.isTrue, R.lensIndex(1), [false, true, 1]); // => false
24 * RA.lensNotSatisfy(RA.isTrue, R.lensIndex(2), [false, true, 1]); // => true
25 * RA.lensNotSatisfy(R.identity, R.lensProp('x'), { x: 1 }); // => true
26 */
27var lensNotSatisfy = complement(lensSatisfies);
28export default lensNotSatisfy;
Note: See TracBrowser for help on using the repository browser.