logical-not
Advanced tools
Comparing version 1.0.7 to 1.0.9
@@ -1,2 +0,5 @@ | ||
export declare function not(value: any): boolean; | ||
export declare function not( | ||
value: any | ||
): value is false | "" | 0 | null | undefined; | ||
export default not; |
{ | ||
"name": "logical-not", | ||
"version": "1.0.7", | ||
"version": "1.0.9", | ||
"description": "Logical NOT Function", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,3 +6,3 @@ # Logical NOT Function | ||
For example: | ||
Usage: | ||
@@ -18,6 +18,15 @@ ```js | ||
## Installation | ||
### Typescript support | ||
```sh | ||
$ npm install logical-not | ||
```ts | ||
function main(): void { | ||
const div = document.querySelector("div"); | ||
// div is HTMLDivElement | null | ||
if (not(div)) return; | ||
// now div is HTMLDivElement | ||
div.textContent; // ok | ||
// ^ no 'possibly null' error | ||
} | ||
``` | ||
@@ -24,0 +33,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2718
16
35