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:
753 bytes
|
Line | |
---|
1 | import lift from "./lift.js";
|
---|
2 | import not from "./not.js";
|
---|
3 | /**
|
---|
4 | * Takes a function `f` and returns a function `g` such that if called with the same arguments
|
---|
5 | * when `f` returns a "truthy" value, `g` returns `false` and when `f` returns a "falsy" value `g` returns `true`.
|
---|
6 | *
|
---|
7 | * `R.complement` may be applied to any functor
|
---|
8 | *
|
---|
9 | * @func
|
---|
10 | * @memberOf R
|
---|
11 | * @since v0.12.0
|
---|
12 | * @category Logic
|
---|
13 | * @sig (*... -> *) -> (*... -> Boolean)
|
---|
14 | * @param {Function} f
|
---|
15 | * @return {Function}
|
---|
16 | * @see R.not
|
---|
17 | * @example
|
---|
18 | *
|
---|
19 | * const isNotNil = R.complement(R.isNil);
|
---|
20 | * R.isNil(null); //=> true
|
---|
21 | * isNotNil(null); //=> false
|
---|
22 | * R.isNil(7); //=> false
|
---|
23 | * isNotNil(7); //=> true
|
---|
24 | */
|
---|
25 |
|
---|
26 | var complement =
|
---|
27 | /*#__PURE__*/
|
---|
28 | lift(not);
|
---|
29 | export default complement; |
---|
Note:
See
TracBrowser
for help on using the repository browser.