@vtj/base 0.8.5 → 0.8.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/dist/index.cjs +3 -3
- package/dist/index.mjs +12 -12
- package/package.json +1 -1
- package/types/data.d.ts +18 -0
- package/types/lodash.d.ts +1 -1
package/package.json
CHANGED
package/types/data.d.ts
CHANGED
|
@@ -11,6 +11,24 @@ export declare function arrayToMap<T>(data: T[], prop: keyof T): Map<any, T>;
|
|
|
11
11
|
* @returns
|
|
12
12
|
*/
|
|
13
13
|
export declare function mapToObject<V = any>(map: Map<any, V>): Record<any, V>;
|
|
14
|
+
/**
|
|
15
|
+
* 数组转键值对
|
|
16
|
+
* @param data
|
|
17
|
+
* @param key
|
|
18
|
+
* @param value
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare function arrayToKv(data?: Record<string, any>[], key?: string, value?: string): Record<string, any>;
|
|
22
|
+
/**
|
|
23
|
+
* 键值对转数组
|
|
24
|
+
* @param data
|
|
25
|
+
* @param key
|
|
26
|
+
* @param value
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
export declare function kvToArray(data?: Record<string, any>, key?: string, value?: string): {
|
|
30
|
+
[x: string]: number | [string, any];
|
|
31
|
+
}[];
|
|
14
32
|
/**
|
|
15
33
|
* 数组去重
|
|
16
34
|
* @param array
|
package/types/lodash.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { isString, isFunction, isArray, isObject, isBoolean, isBuffer, isArrayBuffer, isDate, isUndefined, isNaN, isNull, isNumber, isSymbol, isPlainObject, isEqual, noop, upperFirst, camelCase, get, set, cloneDeep, merge, debounce, throttle, template, lowerFirst, kebabCase } from 'lodash-es';
|
|
1
|
+
export { isString, isFunction, isArray, isObject, isBoolean, isBuffer, isArrayBuffer, isDate, isUndefined, isNaN, isNull, isNumber, isSymbol, isPlainObject, isEqual, noop, upperFirst, camelCase, get, set, cloneDeep, merge, debounce, throttle, template, lowerFirst, kebabCase, snakeCase } from 'lodash-es';
|
|
2
2
|
export declare function upperFirstCamelCase(name: string): string;
|