qjutil 0.0.5 → 0.0.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.d.mts CHANGED
@@ -11,4 +11,4 @@ declare const _default: {
11
11
  sign: typeof sign;
12
12
  };
13
13
 
14
- export { _default as default };
14
+ export { _default as default, sign };
package/dist/index.d.ts CHANGED
@@ -11,4 +11,4 @@ declare const _default: {
11
11
  sign: typeof sign;
12
12
  };
13
13
 
14
- export { _default as default };
14
+ export { _default as default, sign };
package/dist/index.js CHANGED
@@ -20,7 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- default: () => index_default
23
+ default: () => index_default,
24
+ sign: () => sign_exports
24
25
  });
25
26
  module.exports = __toCommonJS(index_exports);
26
27
 
@@ -64,3 +65,7 @@ function raw(args) {
64
65
  var index_default = {
65
66
  sign: sign_exports
66
67
  };
68
+ // Annotate the CommonJS export names for ESM import in node:
69
+ 0 && (module.exports = {
70
+ sign
71
+ });
package/dist/index.mjs CHANGED
@@ -45,5 +45,6 @@ var index_default = {
45
45
  sign: sign_exports
46
46
  };
47
47
  export {
48
- index_default as default
48
+ index_default as default,
49
+ sign_exports as sign
49
50
  };
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "qjutil",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "personal util",
5
- "main": "dist/index.ts",
5
+ "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
7
10
  "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
- "build": "tsup src/index.ts --format esm,cjs,iife --dts --out-dir dist"
11
+ "build": "tsup src/index.ts --format esm,cjs,iife --dts --out-dir dist",
12
+ "gptBuild": "tsup src/index.ts --format cjs,esm,iife --global-name qjutil --dts --out-dir dist",
13
+ "prepublishOnly": "npm run build"
10
14
  },
11
15
  "keywords": [],
12
16
  "author": "Polarwolf",
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
- }