@libs-ui/utils 0.2.306 → 0.2.308-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/communicate-micro.d.ts +1 -1
- package/dangerous-object.d.ts +75 -0
- package/date.d.ts +9 -9
- package/esm2022/base64.mjs +2 -2
- package/esm2022/cache.mjs +17 -14
- package/esm2022/color.mjs +66 -14
- package/esm2022/communicate-micro.mjs +20 -16
- package/esm2022/constants.mjs +1 -1
- package/esm2022/crypto-3rd.mjs +3 -3
- package/esm2022/crypto.mjs +3 -3
- package/esm2022/dangerous-object.mjs +143 -0
- package/esm2022/date.mjs +15 -15
- package/esm2022/dom.mjs +5 -13
- package/esm2022/download.mjs +3 -3
- package/esm2022/file.mjs +22 -11
- package/esm2022/format-number.mjs +9 -6
- package/esm2022/format-text.mjs +13 -15
- package/esm2022/function-check-embed-frame.mjs +1 -1
- package/esm2022/get-smart-axis-scale.mjs +10 -10
- package/esm2022/helpers.mjs +119 -38
- package/esm2022/http-params.mjs +2 -2
- package/esm2022/index.mjs +2 -1
- package/esm2022/inject-token.mjs +2 -2
- package/esm2022/key-cache.mjs +6 -6
- package/esm2022/key-code.mjs +1 -1
- package/esm2022/language.mjs +28 -28
- package/esm2022/pattern.mjs +1 -1
- package/esm2022/random.mjs +2 -2
- package/esm2022/two-way-signal-object.mjs +32 -20
- package/esm2022/uri.mjs +9 -6
- package/esm2022/url-search-params.mjs +13 -11
- package/esm2022/uuid.mjs +2 -2
- package/esm2022/xss-filter.mjs +1 -1
- package/fesm2022/libs-ui-utils.mjs +646 -346
- package/fesm2022/libs-ui-utils.mjs.map +1 -1
- package/file.d.ts +1 -1
- package/format-text.d.ts +1 -1
- package/helpers.d.ts +53 -4
- package/http-params.d.ts +1 -1
- package/index.d.ts +1 -0
- package/inject-token.d.ts +1 -1
- package/package.json +2 -2
- package/uri.d.ts +1 -1
package/file.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IFile } from
|
|
1
|
+
import { IFile } from '@libs-ui/interfaces-types';
|
|
2
2
|
export declare const isTypeImage: (file: File | Blob) => boolean;
|
|
3
3
|
export declare const isTypeVideo: (file: File | Blob) => boolean;
|
|
4
4
|
export declare const isTypeAudio: (file: File | Blob) => boolean;
|
package/format-text.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ITextFormatOptions } from
|
|
1
|
+
import { ITextFormatOptions } from '@libs-ui/interfaces-types';
|
|
2
2
|
export declare const highlightByKeyword: (value: string | undefined, search: string | undefined, ignoreHighlight?: boolean, classHightLight?: string) => string;
|
|
3
3
|
export declare const formatTextCompare: (text: string, options?: ITextFormatOptions) => string;
|
|
4
4
|
export declare const fullNameFormat: (value: string) => string;
|
package/helpers.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TYPE_OBJECT } from
|
|
1
|
+
import { TYPE_OBJECT } from '@libs-ui/interfaces-types';
|
|
2
2
|
/**Các hàm tương tự thư viện lodash */
|
|
3
3
|
/**
|
|
4
4
|
* Kiểm tra xem một giá trị có phải là null hoặc undefined hay không
|
|
@@ -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
|
|
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
|
|
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
|
|
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/http-params.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpParameterCodec, HttpParams } from
|
|
1
|
+
import { HttpParameterCodec, HttpParams } from '@angular/common/http';
|
|
2
2
|
export declare const UtilsHttpParamsRequestInstance: <Type>(options?: HttpParamsOptions<Type>, instance?: HttpParams) => UtilsHttpParamsRequest<Type>;
|
|
3
3
|
export declare class UtilsHttpParamsRequest<Type = {
|
|
4
4
|
pem: string;
|
package/index.d.ts
CHANGED
package/inject-token.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InjectionToken } from
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
2
|
export declare const LINK_IMAGE_ERROR_TOKEN_INJECT: InjectionToken<string>;
|
|
3
3
|
export declare const PROCESS_BAR_STANDARD_CONFIG_DEFAULT_TOKEN_INJECT: InjectionToken<string>;
|
|
4
4
|
export declare const PROCESS_BAR_STEPS_CONFIG_DEFAULT_TOKEN_INJECT: InjectionToken<string>;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libs-ui/utils",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.308-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.
|
|
9
|
+
"@libs-ui/interfaces-types": "0.2.308-0",
|
|
10
10
|
"rxjs": "~7.8.0"
|
|
11
11
|
},
|
|
12
12
|
"sideEffects": false,
|
package/uri.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TYPE_OBJECT } from
|
|
1
|
+
import { TYPE_OBJECT } from '@libs-ui/interfaces-types';
|
|
2
2
|
export declare const ENCODE_URI_PATTERN: RegExp;
|
|
3
3
|
export declare const decodeURI: (value: string) => string;
|
|
4
4
|
export declare const encodeURI: (value: string) => string;
|