qjutil 0.0.5 → 0.0.6

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,12 +1,13 @@
1
1
  {
2
2
  "name": "qjutil",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "personal util",
5
- "main": "dist/index.ts",
5
+ "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "files": ["dist"],
7
8
  "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
- "build": "tsup src/index.ts --format esm,cjs,iife --dts --out-dir dist"
9
+ "build": "tsup src/index.ts --format esm,cjs,iife --dts --out-dir dist",
10
+ "prepublishOnly": "npm run build"
10
11
  },
11
12
  "keywords": [],
12
13
  "author": "Polarwolf",
@@ -19,4 +20,4 @@
19
20
  "dependencies": {
20
21
  "ts-md5": "^2.0.1"
21
22
  }
22
- }
23
+ }
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/qjUtil.iml" filepath="$PROJECT_DIR$/.idea/qjUtil.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/qjUtil.iml DELETED
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
- <excludeFolder url="file://$MODULE_DIR$/temp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
package/src/index.ts DELETED
@@ -1,5 +0,0 @@
1
- import * as sign from './util/sign'
2
-
3
- export default {
4
- sign:sign
5
- }
package/src/util/sign.ts DELETED
@@ -1,34 +0,0 @@
1
- import { Md5 } from 'ts-md5';
2
- export function md5(str:string){
3
- return Md5.hashStr(str)
4
- }
5
-
6
- export function raw(args:Record<string, any>) {
7
- let keys = Object.keys(args);
8
- //参数名ASCII码从小到大排序(字典序)
9
- keys = keys.sort();
10
- let newArgs:Record<string, any> = {};
11
- keys.forEach(function (key) {
12
- //如果参数值类型是object 先将object值内各字段排序
13
- if (typeof args[key] === "object") {
14
- let mArgs = args[key];//req
15
- let mKey = Object.keys(mArgs);
16
- mKey = mKey.sort();
17
- let newObj:Record<string,any> = {};
18
- for (let iKey of mKey) {
19
- newObj[iKey] = mArgs[iKey];
20
- }
21
- newArgs[key] = JSON.stringify(newObj);
22
- }
23
- //如果参数的值为空不参与签名
24
- else if (args[key] !== undefined && args[key] !== "" && key !== 'sign') {
25
- newArgs[key] = args[key];
26
- }
27
- });
28
- let string = '';
29
- for (let k in newArgs) {
30
- string += '&' + k + '=' + newArgs[k];
31
- }
32
- string = string.substr(1);//去掉第一个&
33
- return string;
34
- }
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2017",
4
- "module": "ESNext",
5
- "moduleResolution": "node",
6
- "declaration": true, // 生成类型声明文件
7
- "outDir": "dist",
8
- "strict": true,
9
- "esModuleInterop": true,
10
- "skipLibCheck": true
11
- },
12
- "include": ["src"]
13
- }