@libs-ui/utils 0.2.307-0 → 0.2.309-0

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
@@ -10,7 +10,9 @@ import { TYPE_OBJECT } from '@libs-ui/interfaces-types';
10
10
  * isNil(0); // false
11
11
  * isNil('hello'); // false
12
12
  */
13
- export declare const isNil: (value: unknown) => value is null | undefined;
13
+ export declare const isNil: (value: unknown, options?: {
14
+ ignoreUnWrapSignal?: boolean;
15
+ }) => value is null | undefined;
14
16
  /**
15
17
  * Kiểm tra xem một giá trị có phải là rỗng hay không
16
18
  * @param value Giá trị cần kiểm tra
@@ -24,7 +26,50 @@ export declare const isNil: (value: unknown) => value is null | undefined;
24
26
  * isEmpty([1, 2, 3]); // false
25
27
  * isEmpty({ a: 1 }); // false
26
28
  */
27
- export declare const isEmpty: (value: unknown) => boolean;
29
+ export declare const isEmpty: (value: unknown, options?: {
30
+ ignoreCheckTypeObj?: boolean;
31
+ ignoreCheckFalsy?: boolean;
32
+ ignoreUnWrapSignal?: boolean;
33
+ ignoreCheckString?: 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;
28
73
  /**
29
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
30
75
  * @param objData Đối tượng cần xử lý
@@ -110,7 +155,10 @@ export declare const get: <T = any>(obj: any, path: string | string[], defaultVa
110
155
  * const obj = { a: { b: 1 } };
111
156
  * set(obj, 'a.b', 2); // { a: { b: 2 } }
112
157
  */
113
- export declare const set: <T = any>(obj: any, path: string | string[], value: any) => T;
158
+ export declare const set: <T = any>(obj: any, path: string | string[], value: any, options?: {
159
+ valueDefaultPathObjectUndefined?: any;
160
+ valueDefaultPathArrayUndefined?: any;
161
+ }) => T;
114
162
  /**
115
163
  * Tạo một bản sao sâu của một đối tượng hoặc giá trị bất kỳ
116
164
  * @param data Dữ liệu cần sao chép
@@ -197,6 +245,7 @@ export declare const range: (start: number, end?: number, step?: number) => Arra
197
245
  export declare const isEqual: (value1: any, value2: any, options?: {
198
246
  exactlyPosition?: boolean;
199
247
  ignoreExactlyDataType?: boolean;
248
+ ignoreUnWrapSignal?: boolean;
200
249
  }) => boolean;
201
250
  /**
202
251
  * 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/index.d.ts CHANGED
@@ -26,3 +26,4 @@ export * from './uri';
26
26
  export * from './format-text';
27
27
  export * from './get-smart-axis-scale';
28
28
  export * from './random';
29
+ export * from './dangerous-object';
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@libs-ui/utils",
3
- "version": "0.2.307-0",
3
+ "version": "0.2.309-0",
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.307-0",
9
+ "@libs-ui/interfaces-types": "0.2.309-0",
10
10
  "rxjs": "~7.8.0"
11
11
  },
12
12
  "sideEffects": false,