@libs-ui/utils 0.2.306-5 → 0.2.306-7

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/helpers.d.ts CHANGED
@@ -11,7 +11,9 @@ import { GetReturnType, GetValueAtPath, PathOf, TYPE_OBJECT } from '@libs-ui/int
11
11
  * isNil(0); // false
12
12
  * isNil('hello'); // false
13
13
  */
14
- export declare const isNil: (value: unknown) => value is null | undefined;
14
+ export declare const isNil: (value: unknown, options?: {
15
+ ignoreUnWrapSignal?: boolean;
16
+ }) => value is null | undefined;
15
17
  /**
16
18
  * Kiểm tra xem một giá trị có phải là rỗng hay không
17
19
  * @param value Giá trị cần kiểm tra
@@ -25,7 +27,49 @@ export declare const isNil: (value: unknown) => value is null | undefined;
25
27
  * isEmpty([1, 2, 3]); // false
26
28
  * isEmpty({ a: 1 }); // false
27
29
  */
28
- export declare const isEmpty: (value: unknown) => boolean;
30
+ export declare const isEmpty: (value: unknown, options?: {
31
+ ignoreCheckTypeObj?: boolean;
32
+ ignoreCheckFalsy?: boolean;
33
+ ignoreUnWrapSignal?: boolean;
34
+ }) => value is null | undefined | "" | 0;
35
+ /**
36
+ * Kiểm tra xem một giá trị có phải là null, rỗng, undefined hoặc 0 hay không
37
+ * @param value Giá trị cần kiểm tra
38
+ * @param options Cấu hình tùy chọn
39
+ * @param options.ignoreZero Nếu true, sẽ không kiểm tra giá trị 0
40
+ * @returns true nếu giá trị là null, rỗng, undefined hoặc 0, false nếu không
41
+ * @example
42
+ * isTruthy(null); // false
43
+ * isTruthy(''); // false
44
+ * isTruthy(undefined); // false
45
+ * isTruthy(0); // false
46
+ * isTruthy({}); // false
47
+ * isTruthy(0, { ignoreZero: true }); // true
48
+ */
49
+ export declare const isTruthy: <T>(value: T, options?: {
50
+ ignoreZero?: boolean;
51
+ ignoreCheckString?: boolean;
52
+ ignoreUnWrapSignal?: boolean;
53
+ }) => value is NonNullable<T>;
54
+ /**
55
+ * Kiểm tra xem một giá trị có phải là null, rỗng, undefined hoặc 0 hay không
56
+ * @param value Giá trị cần kiểm tra
57
+ * @param options Cấu hình tùy chọn
58
+ * @param options.ignoreZero Nếu true, sẽ không kiểm tra giá trị 0
59
+ * @returns true nếu giá trị là null, rỗng, undefined hoặc 0, false nếu không
60
+ * @example
61
+ * isFalsy(null); // true
62
+ * isFalsy(''); // true
63
+ * isFalsy(undefined); // true
64
+ * isFalsy(0); // true
65
+ * isFalsy({}); // false
66
+ * isFalsy(0, { ignoreZero: true }); // false
67
+ */
68
+ export declare const isFalsy: (value: unknown, options?: {
69
+ ignoreZero?: boolean;
70
+ ignoreCheckString?: boolean;
71
+ ignoreUnWrapSignal?: boolean;
72
+ }) => value is null | undefined | "" | 0;
29
73
  /**
30
74
  * Loại bỏ các thuộc tính của đối tượng dựa trên một hàm điều kiện
31
75
  * @param objData Đối tượng cần xử lý
@@ -198,6 +242,7 @@ export declare const range: (start: number, end?: number, step?: number) => Arra
198
242
  export declare const isEqual: (value1: any, value2: any, options?: {
199
243
  exactlyPosition?: boolean;
200
244
  ignoreExactlyDataType?: boolean;
245
+ ignoreUnWrapSignal?: boolean;
201
246
  }) => boolean;
202
247
  /**
203
248
  * Loại bỏ các phần tử trùng lặp trong mảng dựa trên một thuộc tính chỉ định
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@libs-ui/utils",
3
- "version": "0.2.306-5",
3
+ "version": "0.2.306-7",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.0.0",
6
6
  "@angular/core": ">=18.0.0",
7
7
  "crypto-es": "^2.1.0",
8
8
  "dayjs": "1.11.5",
9
- "@libs-ui/interfaces-types": "0.2.306-5",
9
+ "@libs-ui/interfaces-types": "0.2.306-7",
10
10
  "rxjs": "~7.8.0"
11
11
  },
12
12
  "sideEffects": false,