@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/base",
3
3
  "private": false,
4
- "version": "0.8.5",
4
+ "version": "0.8.7",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "@types/lodash-es": "~4.17.12",
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;