is-object-empty2 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +5 -0
- package/README.md +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
package/.gitattributes
ADDED
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ $ npm i is-object-empty2
|
|
|
31
31
|
|
|
32
32
|
# JavaScript
|
|
33
33
|
```javascript
|
|
34
|
-
const isObjectEmpty2 = require('is-object-
|
|
34
|
+
const isObjectEmpty2 = require('is-object-empty2');
|
|
35
35
|
|
|
36
36
|
console.log(isObjectEmpty2({})); // true
|
|
37
37
|
console.log(isObjectEmpty2({ a: 1 })); // false
|
|
@@ -42,7 +42,7 @@ console.log(isObjectEmpty2(undefined)); // false
|
|
|
42
42
|
|
|
43
43
|
# TypeScript
|
|
44
44
|
```javascript
|
|
45
|
-
import isObjectEmpty2 = require('is-object-
|
|
45
|
+
import isObjectEmpty2 = require('is-object-empty2');
|
|
46
46
|
|
|
47
47
|
const testValues: unknown[] = [
|
|
48
48
|
{},
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* is-object-empty2 - 📦 Tiny utility to check if a value is a plain empty object in JavaScript and TypeScript
|
|
3
|
-
* @version: v1.0.
|
|
3
|
+
* @version: v1.0.3
|
|
4
4
|
* @link: https://github.com/tutyamxx/is-object-empty2
|
|
5
5
|
* @license: MIT
|
|
6
6
|
**/
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
* isObjectEmpty2(null); // false
|
|
21
21
|
* isObjectEmpty2(undefined); // false
|
|
22
22
|
*/
|
|
23
|
-
const isObjectEmpty2 = (obj) => obj !== null && typeof obj === 'object' && !Array.isArray(obj) ? Object.keys(obj).length === 0 : false;
|
|
23
|
+
const isObjectEmpty2 = (obj) => (obj !== null && typeof obj === 'object' && !Array.isArray(obj)) ? Object.keys(obj).length === 0 : false;
|
|
24
24
|
|
|
25
25
|
module.exports = isObjectEmpty2;
|