@base-web-kits/base-tools-ts 0.0.7 → 0.8.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.
@@ -1,5 +1,8 @@
1
1
  /**
2
- * https://www.lodashjs.com/
2
+ * re-export 全量 lodash-es
3
+ * 文档: https://www.lodashjs.com/
4
+ * 目的: 从工具库统一loadsh版本,避免项目多个版本冲突
5
+ * 注意: 需在tsup.config.ts加入noExternal: ['lodash-es'],确保打包时不被忽略
3
6
  */
4
7
  export * from 'lodash-es';
5
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ts/lodash/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ts/lodash/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,WAAW,CAAC"}
@@ -7,7 +7,7 @@
7
7
  export declare function createUuid(): string;
8
8
  /**
9
9
  * 生成随机字符串id
10
- * @description 常用于生成元素标签的id (默认加上'id_'前缀, 避免小程序中数字开头的id导致查询节点信息失败)
10
+ * - 常用于生成元素标签的id (默认加上'id_'前缀, 避免小程序中数字开头的id导致查询节点信息失败)
11
11
  * @param prefix 前缀, 默认 'id_'
12
12
  * @returns 随机字符串
13
13
  * @example
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 获取url的查询参数值
3
- * @description 采用纯JS解析,因为小程序不支持URLSearchParams
3
+ * - 采用纯JS解析,因为小程序不支持URLSearchParams
4
4
  * @param key 参数名
5
5
  * @param url 完整 URL 或仅查询串(如 "a=1&b=2")
6
6
  * @returns 解码后的参数值 (若不存在|"null"|"undefined",则返回 null)
@@ -26,7 +26,7 @@ export declare function getUrlParam(key: string, url: string): string | null;
26
26
  export declare function getUrlNumber(key: string, url: string): number | null;
27
27
  /**
28
28
  * 获取url的所有查询参数值
29
- * @description 采用纯JS解析,因为小程序不支持URLSearchParams
29
+ * - 采用纯JS解析,因为小程序不支持URLSearchParams
30
30
  * @param url 完整 URL 或仅查询串(如 "a=1&b=2")
31
31
  * @returns 解码后的键值对象(无参数返回空对象; "null"|"undefined"的参数会被忽略)
32
32
  * @example
@@ -38,7 +38,7 @@ export declare function getUrlNumber(key: string, url: string): number | null;
38
38
  export declare function getUrlParamAll(url: string): Record<string, string>;
39
39
  /**
40
40
  * 将对象参数拼接到 URL
41
- * @description 采用纯JS拼接,因为小程序不支持URLSearchParams
41
+ * - 采用纯JS拼接,因为小程序不支持URLSearchParams
42
42
  * @param url 基础地址
43
43
  * @param param 将要追加的参数对象;`null/undefined` 值会被忽略,Object 会使用 `JSON.stringify`
44
44
  * @returns 拼接后的完整 URL(保留原有哈希片段)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-web-kits/base-tools-ts",
3
- "version": "0.0.7",
3
+ "version": "0.8.1",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Independent TS utilities package built from src/ts.",
@@ -11,10 +11,23 @@
11
11
  "thin-wrapper"
12
12
  ],
13
13
  "license": "MIT",
14
+ "main": "./dist/index.js",
15
+ "module": "./dist/index.js",
16
+ "types": "./dist/index.d.ts",
14
17
  "exports": {
15
18
  ".": {
16
19
  "types": "./dist/index.d.ts",
17
- "import": "./dist/index.js"
20
+ "import": "./dist/index.js",
21
+ "require": "./dist/index.js",
22
+ "default": "./dist/index.js"
23
+ },
24
+ "./package.json": "./package.json"
25
+ },
26
+ "typesVersions": {
27
+ "*": {
28
+ "*": [
29
+ "./dist/*"
30
+ ]
18
31
  }
19
32
  },
20
33
  "files": [
@@ -23,7 +36,7 @@
23
36
  ],
24
37
  "dependencies": {
25
38
  "lodash-es": "^4.17.21",
26
- "@types/lodash-es": "^4.17.7",
39
+ "@types/lodash-es": "^4.17.12",
27
40
  "bignumber.js": "^9.1.2",
28
41
  "dayjs": "^1.11.19"
29
42
  },