utils-lib-js 2.0.15 → 2.0.17

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/README.en.md CHANGED
@@ -347,6 +347,18 @@ const o2 = { name: "hunter" };
347
347
  console.log(o.__proto__, o2.__proto__); // Output: undefined, [Object: null prototype] {}
348
348
  ```
349
349
 
350
+ ##### 15. `isEmptyObject(object: IObject<unknown>): boolean`
351
+
352
+ Determines if the object is empty
353
+
354
+ - `object` : the target object.
355
+
356
+ ```javascript
357
+ const o = isEmptyObject({name: "a u"});
358
+ const o2 = isEmptyObject({});
359
+ console.log(o, o2); // Output: false true
360
+ ```
361
+
350
362
  #### array module
351
363
 
352
364
  ##### 1. `arrayRandom(arr: any[]): any[]`
@@ -360,7 +372,7 @@ const originalArray = [1, 2, 3, 4, 5];
360
372
  const randomizedArray = arrayRandom(originalArray);
361
373
  console.log(randomizedArray);
362
374
  // Output: a randomly sorted array
363
- ```
375
+ ````
364
376
 
365
377
  ##### 2. `arrayUniq(arr: any[]): any[]`
366
378
 
package/README.md CHANGED
@@ -132,7 +132,7 @@ console.log(isTypeAllowed); // 输出: true
132
132
  - `separator`: 分隔符
133
133
 
134
134
  ```javascript
135
- const camelCase = 'fontSize';
135
+ const camelCase = "fontSize";
136
136
  const kebabCase = toKebabCase(camelCase);
137
137
  console.log(kebabCase); // 输出: font-size
138
138
  ```
@@ -347,6 +347,18 @@ const o2 = { name: "hunter" };
347
347
  console.log(o.__proto__, o2.__proto__); // 输出: undefined, [Object: null prototype] {}
348
348
  ```
349
349
 
350
+ ##### 15. `isEmptyObject(object: IObject<unknown>): boolean`
351
+
352
+ 判断是否是空对象
353
+
354
+ - `object`: 目标对象。
355
+
356
+ ```javascript
357
+ const o = isEmptyObject({ name: "阿宇" });
358
+ const o2 = isEmptyObject({});
359
+ console.log(o, o2); // 输出: false true
360
+ ```
361
+
350
362
  #### array 模块
351
363
 
352
364
  ##### 1. `arrayRandom(arr: any[]): any[]`
@@ -68,5 +68,6 @@ declare const _default: {
68
68
  jsonToString: import("./types").IJsonToString;
69
69
  isWindow: (win: any) => boolean;
70
70
  emptyObject: (init?: import("./types").IObject<unknown>) => any;
71
+ isEmptyObject: (object?: import("./types").IObject<unknown>) => boolean;
71
72
  };
72
73
  export default _default;