@libs-ui/utils 0.2.314-0 → 0.2.316-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/file.d.ts CHANGED
@@ -15,4 +15,4 @@ export declare const isIncludeAudioExtList: (ext: string, listExt?: Array<string
15
15
  export declare const getFileExtension: (file: IFile | File) => string | undefined;
16
16
  export declare const getLabelBySizeFile: (size: number, toFixed?: number) => string;
17
17
  export declare const convertBlobToFile: (blob: Blob, fileName?: string) => File;
18
- export declare const convertUrlToFile: (url: string, fileName?: string) => Promise<File>;
18
+ export declare const convertUrlToFile: (url: string, fileName?: string) => Promise<File | undefined>;
package/helpers.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { TYPE_OBJECT } from '@libs-ui/interfaces-types';
1
+ import { Signal } from '@angular/core';
2
+ import { GetReturnType, GetValueAtPath, PathOf, TYPE_OBJECT } from '@libs-ui/interfaces-types';
2
3
  /**Các hàm tương tự thư viện lodash */
3
4
  /**
4
5
  * Kiểm tra xem một giá trị có phải là null hoặc undefined hay không
@@ -142,7 +143,7 @@ export declare const omitBy: <T>(objData: Record<string, any>, predicate: (val:
142
143
  * get(null, 'any.path'); // undefined
143
144
  * get(undefined, 'any.path', 'fallback'); // 'fallback'
144
145
  */
145
- export declare const get: <T = any>(obj: any, path: string | string[], defaultValue?: any, keepLastValueIfSignal?: boolean) => T;
146
+ export declare const get: <O, P extends PathOf<O> = PathOf<O>, KS extends boolean = false, D extends GetValueAtPath<O, P, KS> | undefined = undefined>(obj: Signal<O> | O, path: P, defaultValue?: D, keepLastValueIfSignal?: KS) => GetReturnType<O, P, KS, D>;
146
147
  /**
147
148
  * Thiết lập giá trị cho một thuộc tính trong đối tượng theo đường dẫn chỉ định
148
149
  * @param obj Đối tượng cần thiết lập giá trị
@@ -154,10 +155,10 @@ export declare const get: <T = any>(obj: any, path: string | string[], defaultVa
154
155
  * const obj = { a: { b: 1 } };
155
156
  * set(obj, 'a.b', 2); // { a: { b: 2 } }
156
157
  */
157
- export declare const set: <T = any>(obj: any, path: string | string[], value: any, options?: {
158
+ export declare const set: <O, P extends PathOf<O> = PathOf<O>, T extends GetValueAtPath<O, P, true> = GetValueAtPath<O, P, true>>(obj: Signal<O> | O, path: P, value: T, options?: {
158
159
  valueDefaultPathObjectUndefined?: any;
159
160
  valueDefaultPathArrayUndefined?: any;
160
- }) => T;
161
+ }) => O;
161
162
  /**
162
163
  * Tạo một bản sao sâu của một đối tượng hoặc giá trị bất kỳ
163
164
  * @param data Dữ liệu cần sao chép
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@libs-ui/utils",
3
- "version": "0.2.314-0",
3
+ "version": "0.2.316-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.314-0",
9
+ "@libs-ui/interfaces-types": "0.2.316-0",
10
10
  "rxjs": "~7.8.0"
11
11
  },
12
12
  "sideEffects": false,