-
Notifications
You must be signed in to change notification settings - Fork 15
/
not.d.ts
34 lines (34 loc) · 909 Bytes
/
not.d.ts
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
export = not;
/**
* @name not
*
* @synopsis
* ```coffeescript [specscript]
* not(value boolean) -> negated boolean
*
* not(...args, predicate function) -> negated boolean
*
* not(predicate function)(...args) -> negated boolean
* ```
*
* @description
* Negate a value like the [logical NOT (`!`)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_NOT) operator.
*
* ```javascript [playground]
* const myObj = { a: 1 }
*
* console.log(not('a' in myObj)) // false
* console.log(not('b' in myObj)) // true
* ```
*
* If provided a predicate function, `not` returns a logically inverted predicate that returns true everywhere the original predicate would have returned false.
*
* ```javascript [playground]
* const isOdd = number => number % 2 == 1
*
* console.log(
* not(isOdd)(3),
* ) // false
* ```
*/
declare function not(...args: any[]): any;