@lntvow/utils 2.5.0 → 3.0.1
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/dist/index.d.ts +7 -7
- package/package.json +11 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare type
|
|
1
|
+
export declare type AnyObject = Record<string, any>;
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @description url追加查询字符串
|
|
@@ -9,7 +9,7 @@ export declare type AnyObj = Record<string, any>;
|
|
|
9
9
|
* appendQueryString('https://www.baidu.com', { a: '1', b: '2' }) => 'https://www.baidu.com?a=1&b=2'
|
|
10
10
|
* appendQueryString('/pages/index?id=10', { test:'23' }) => '/pages/index?id=10&test=23'
|
|
11
11
|
*/
|
|
12
|
-
declare function appendQueryString(url: string, obj:
|
|
12
|
+
declare function appendQueryString(url: string, obj: AnyObject, options?: StringifyOptions): string;
|
|
13
13
|
|
|
14
14
|
export declare type Arrayable<T> = T | T[];
|
|
15
15
|
|
|
@@ -22,7 +22,7 @@ export declare type ArrayItem<T> = T extends (infer U)[] ? U : never;
|
|
|
22
22
|
*/
|
|
23
23
|
export declare function castArray<T>(target: T | T[]): T[];
|
|
24
24
|
|
|
25
|
-
export declare function compareProperties(target:
|
|
25
|
+
export declare function compareProperties(target: AnyObject, source: AnyObject): void | AnyObject;
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* @description compose
|
|
@@ -62,7 +62,7 @@ export declare function deepClone<T>(target: T): T;
|
|
|
62
62
|
* @param options 配置对象
|
|
63
63
|
* @example deepMerge({ name: 1, obj: { name: '默认' , text: '旧值' }, arr: [1, 2, 3] }, { name: 1, obj: { name: '修改', age: '新增' }, test: 'test' }) => { name: 1, obj: { name: '修改', text: '旧值', age: '新增' }, arr: [1, 2, 3], test: 'test' }
|
|
64
64
|
*/
|
|
65
|
-
export declare function deepMerge(template:
|
|
65
|
+
export declare function deepMerge(template: AnyObject, source: AnyObject, options?: DeepMergeOptions): any;
|
|
66
66
|
|
|
67
67
|
declare interface DeepMergeOptions {
|
|
68
68
|
/**
|
|
@@ -76,7 +76,7 @@ export declare const deprecated: ({ from, replacement, version, type, }: {
|
|
|
76
76
|
from: string;
|
|
77
77
|
replacement: string;
|
|
78
78
|
version: string;
|
|
79
|
-
type?:
|
|
79
|
+
type?: 'API';
|
|
80
80
|
}) => void;
|
|
81
81
|
|
|
82
82
|
export declare const error: (...arg: unknown[]) => void;
|
|
@@ -87,7 +87,7 @@ export declare const error: (...arg: unknown[]) => void;
|
|
|
87
87
|
* @param properties 要排除的属性
|
|
88
88
|
* @example excludeProperties({ a: 1, b: 2, c: 3 }, ['a', 'b']) => { c: 3 }
|
|
89
89
|
*/
|
|
90
|
-
export declare function excludeProperties<T extends
|
|
90
|
+
export declare function excludeProperties<T extends AnyObject, K extends keyof T>(target: T, properties: Arrayable<K>): Omit<T, K>;
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* @description 提取对象中的某些属性
|
|
@@ -95,7 +95,7 @@ export declare function excludeProperties<T extends AnyObj, K extends keyof T>(t
|
|
|
95
95
|
* @param properties 要提取的属性
|
|
96
96
|
* @example extractProperties({ a: 1, b: 2, c: 3 }, ['a', 'b']) => { a: 1, b: 2 }
|
|
97
97
|
*/
|
|
98
|
-
export declare function extractProperties<T extends
|
|
98
|
+
export declare function extractProperties<T extends AnyObject, K extends keyof T>(target: T, properties: Arrayable<K>): Pick<T, K>;
|
|
99
99
|
|
|
100
100
|
export declare interface FloatOptions {
|
|
101
101
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lntvow/utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "工具库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,25 +8,25 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
|
+
"main": "dist/index.cjs",
|
|
12
|
+
"module": "dist/index.mjs",
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
11
14
|
"engines": {
|
|
12
15
|
"node": ">=18.12.0",
|
|
13
16
|
"pnpm": ">=9.0.0"
|
|
14
17
|
},
|
|
15
|
-
"main": "dist/index.cjs",
|
|
16
|
-
"module": "dist/index.mjs",
|
|
17
|
-
"types": "dist/index.d.ts",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"dayjs": "^1.11.
|
|
19
|
+
"dayjs": "^1.11.11"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@lntvow/dev": "^0.2.
|
|
23
|
-
"@vitest/coverage-istanbul": "^1.
|
|
24
|
-
"@vitest/ui": "^1.
|
|
22
|
+
"@lntvow/dev": "^0.2.6",
|
|
23
|
+
"@vitest/coverage-istanbul": "^1.6.0",
|
|
24
|
+
"@vitest/ui": "^1.6.0",
|
|
25
25
|
"deepmerge": "^4.3.1",
|
|
26
|
-
"typescript": "^5.
|
|
27
|
-
"vite": "^5.
|
|
26
|
+
"typescript": "^5.4.5",
|
|
27
|
+
"vite": "^5.2.11",
|
|
28
28
|
"vite-plugin-dts": "3.6.4",
|
|
29
|
-
"vitest": "^1.0
|
|
29
|
+
"vitest": "^1.6.0"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"test": "vitest",
|