@vtj/base 0.12.1 → 0.12.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types/lodash.d.ts +103 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/base",
3
3
  "private": false,
4
- "version": "0.12.1",
4
+ "version": "0.12.2",
5
5
  "type": "module",
6
6
  "keywords": [
7
7
  "低代码引擎",
package/types/lodash.d.ts CHANGED
@@ -1,2 +1,105 @@
1
+ /**
2
+ * 导出常用的lodash工具函数
3
+ *
4
+ * 每个函数的说明和示例:
5
+ *
6
+ * isString(value: any): boolean - 检查值是否为字符串
7
+ * 示例: isString('hello') // => true
8
+ *
9
+ * isFunction(value: any): boolean - 检查值是否为函数
10
+ * 示例: isFunction(() => {}) // => true
11
+ *
12
+ * isArray(value: any): boolean - 检查值是否为数组
13
+ * 示例: isArray([1, 2, 3]) // => true
14
+ *
15
+ * isObject(value: any): boolean - 检查值是否为对象(非null)
16
+ * 示例: isObject({}) // => true
17
+ *
18
+ * isBoolean(value: any): boolean - 检查值是否为布尔值
19
+ * 示例: isBoolean(true) // => true
20
+ *
21
+ * isBuffer(value: any): boolean - 检查值是否为Buffer
22
+ * 示例: isBuffer(Buffer.from('hello')) // => true
23
+ *
24
+ * isArrayBuffer(value: any): boolean - 检查值是否为ArrayBuffer
25
+ * 示例: isArrayBuffer(new ArrayBuffer(8)) // => true
26
+ *
27
+ * isDate(value: any): boolean - 检查值是否为Date对象
28
+ * 示例: isDate(new Date()) // => true
29
+ *
30
+ * isUndefined(value: any): boolean - 检查值是否为undefined
31
+ * 示例: isUndefined(undefined) // => true
32
+ *
33
+ * isNaN(value: any): boolean - 检查值是否为NaN
34
+ * 示例: isNaN(NaN) // => true
35
+ *
36
+ * isNull(value: any): boolean - 检查值是否为null
37
+ * 示例: isNull(null) // => true
38
+ *
39
+ * isNumber(value: any): boolean - 检查值是否为数字
40
+ * 示例: isNumber(42) // => true
41
+ *
42
+ * isSymbol(value: any): boolean - 检查值是否为Symbol
43
+ * 示例: isSymbol(Symbol('foo')) // => true
44
+ *
45
+ * isPlainObject(value: any): boolean - 检查值是否为纯对象
46
+ * 示例: isPlainObject({}) // => true
47
+ *
48
+ * isEqual(value: any, other: any): boolean - 深度比较两个值是否相等
49
+ * 示例: isEqual({a: 1}, {a: 1}) // => true
50
+ *
51
+ * noop(): void - 空操作函数
52
+ * 示例: noop() // => undefined
53
+ *
54
+ * upperFirst(string: string): string - 首字母大写
55
+ * 示例: upperFirst('hello') // => 'Hello'
56
+ *
57
+ * camelCase(string: string): string - 转换为驼峰命名
58
+ * 示例: camelCase('hello-world') // => 'helloWorld'
59
+ *
60
+ * get(object: Object, path: string, defaultValue: any): any - 获取对象属性值
61
+ * 示例: get({a: {b: 1}}, 'a.b') // => 1
62
+ *
63
+ * set(object: Object, path: string, value: any): Object - 设置对象属性值
64
+ * 示例: set({}, 'a.b', 1) // => {a: {b: 1}}
65
+ *
66
+ * cloneDeep(value: any): any - 深拷贝
67
+ * 示例: cloneDeep({a: 1}) // => {a: 1}
68
+ *
69
+ * merge(object: Object, ...sources: Object[]): Object - 深度合并对象
70
+ * 示例: merge({a: 1}, {b: 2}) // => {a: 1, b: 2}
71
+ *
72
+ * debounce(func: Function, wait: number, options: Object): Function - 防抖函数
73
+ * 示例: const debounced = debounce(() => console.log('hello'), 100)
74
+ *
75
+ * throttle(func: Function, wait: number, options: Object): Function - 节流函数
76
+ * 示例: const throttled = throttle(() => console.log('hello'), 100)
77
+ *
78
+ * template(string: string, options: Object): Function - 模板函数
79
+ * 示例: const compiled = template('hello <%= user %>!')
80
+ * compiled({user: 'world'}) // => 'hello world!'
81
+ *
82
+ * lowerFirst(string: string): string - 首字母小写
83
+ * 示例: lowerFirst('Hello') // => 'hello'
84
+ *
85
+ * kebabCase(string: string): string - 转换为短横线命名(kebab-case)
86
+ * 示例: kebabCase('helloWorld') // => 'hello-world'
87
+ *
88
+ * snakeCase(string: string): string - 转换为蛇形命名(snake_case)
89
+ * 示例: snakeCase('helloWorld') // => 'hello_world'
90
+ *
91
+ * groupBy(collection: Array|Object, iteratee: Function|string): Object - 根据条件分组
92
+ * 示例: groupBy([1.1, 1.2, 2.3], Math.floor) // => {1: [1.1, 1.2], 2: [2.3]}
93
+ */
1
94
  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, groupBy } from 'lodash-es';
95
+ /**
96
+ * 将字符串转换为首字母大写的驼峰命名形式
97
+ * @param name - 需要转换的字符串
98
+ * @returns 转换后的字符串
99
+ *
100
+ * 示例:
101
+ * upperFirstCamelCase('hello-world') // => 'HelloWorld'
102
+ * upperFirstCamelCase('hello_world') // => 'HelloWorld'
103
+ * upperFirstCamelCase('hello world') // => 'HelloWorld'
104
+ */
2
105
  export declare function upperFirstCamelCase(name: string): Capitalize<string>;