@lsby/ts-jwt 0.0.1 → 0.0.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.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # ts-jwt
2
+
3
+ 这是一个 TypeScript JWT 库,提供 JWT 签名和解析功能。
@@ -28,11 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
30
  // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
33
  JWT\u7BA1\u7406\u5668: () => JWT\u7BA1\u7406\u5668
34
34
  });
35
- module.exports = __toCommonJS(src_exports);
35
+ module.exports = __toCommonJS(index_exports);
36
36
  var import_jsonwebtoken = __toESM(require("jsonwebtoken"), 1);
37
37
  var JWT\u7BA1\u7406\u5668 = class {
38
38
  constructor(secret, expiresIn) {
@@ -41,7 +41,7 @@ var JWT\u7BA1\u7406\u5668 = class {
41
41
  }
42
42
  \u7B7E\u540D(\u8D1F\u8F7D) {
43
43
  var token = import_jsonwebtoken.default.sign(\u8D1F\u8F7D, this.secret, {
44
- expiresIn: this.expiresIn
44
+ expiresIn: parseInt(this.expiresIn)
45
45
  });
46
46
  return token;
47
47
  }
package/dist/esm/index.js CHANGED
@@ -7,7 +7,7 @@ var JWT\u7BA1\u7406\u5668 = class {
7
7
  }
8
8
  \u7B7E\u540D(\u8D1F\u8F7D) {
9
9
  var token = jwt.sign(\u8D1F\u8F7D, this.secret, {
10
- expiresIn: this.expiresIn
10
+ expiresIn: parseInt(this.expiresIn)
11
11
  });
12
12
  return token;
13
13
  }
package/package.json CHANGED
@@ -1,44 +1,46 @@
1
- {
2
- "name": "@lsby/ts-jwt",
3
- "version": "0.0.1",
4
- "type": "module",
5
- "exports": {
6
- "require": "./dist/cjs/index.cjs",
7
- "import": "./dist/esm/index.js"
8
- },
9
- "files": [
10
- "dist"
11
- ],
12
- "scripts": {
13
- "build:all": "npm run build:cjs && npm run build:esm",
14
- "build:cjs": "tsup src/**/*.ts --format cjs --clean --dts -d dist/cjs",
15
- "build:esm": "tsup src/**/*.ts --format esm --clean --dts -d dist/esm",
16
- "check:all": "npm run check:format && npm run check:lint && npm run check:type",
17
- "check:format": "prettier --write .",
18
- "check:lint": "eslint . --fix",
19
- "check:type": "tsc --noEmit",
20
- "check:type:watch": "tsc --noEmit -w",
21
- "pub:public": "npm run check:all && npm run test:base && npm run build:all && bumpp && npm publish --access public",
22
- "test:base": "npm run check:all && vitest run",
23
- "test:coverage": "npm run check:all && vitest run --coverage && open-cli ./coverage/index.html"
24
- },
25
- "dependencies": {
26
- "jsonwebtoken": "^9.0.2",
27
- "vitest": "^2.0.2",
28
- "zod": "^3.23.8"
29
- },
30
- "devDependencies": {
31
- "@ianvs/prettier-plugin-sort-imports": "^4.2.1",
32
- "@lsby/eslint-config": "^0.0.2",
33
- "@types/jsonwebtoken": "^9.0.6",
34
- "@types/node": "^20.12.10",
35
- "@vitest/coverage-v8": "^2.0.2",
36
- "bumpp": "^9.4.1",
37
- "open-cli": "^8.0.0",
38
- "prettier": "3.2.5",
39
- "prettier-plugin-packagejson": "^2.5.0",
40
- "tsup": "^8.0.2",
41
- "tsx": "^4.9.3",
42
- "typescript": "^5.4.5"
43
- }
1
+ {
2
+ "name": "@lsby/ts-jwt",
3
+ "version": "0.0.2",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/lsby/ts-jwt.git"
7
+ },
8
+ "type": "module",
9
+ "exports": {
10
+ "require": "./dist/cjs/index.cjs",
11
+ "import": "./dist/esm/index.js"
12
+ },
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "scripts": {
17
+ "build:all": "npm run build:cjs && npm run build:esm",
18
+ "build:cjs": "tsup src/**/*.ts --format cjs --clean --dts -d dist/cjs",
19
+ "build:esm": "tsup src/**/*.ts --format esm --clean --dts -d dist/esm",
20
+ "check:all": "npm run check:format && npm run check:lint && npm run check:type",
21
+ "check:format": "prettier --write .",
22
+ "check:lint": "eslint . --fix",
23
+ "check:type": "tsc --noEmit",
24
+ "check:type:watch": "tsc --noEmit -w",
25
+ "pub:public": "npm run check:all && npm run test:base && npm run build:all && bumpp && npm publish --access public",
26
+ "test:base": "npm run check:all && vitest run",
27
+ "test:coverage": "npm run check:all && vitest run --coverage && open-cli ./coverage/index.html"
28
+ },
29
+ "dependencies": {
30
+ "jsonwebtoken": "^9.0.2",
31
+ "vitest": "^2.0.2"
32
+ },
33
+ "devDependencies": {
34
+ "@ianvs/prettier-plugin-sort-imports": "^4.2.1",
35
+ "@lsby/eslint-config": "^0.1.0",
36
+ "@types/jsonwebtoken": "^9.0.6",
37
+ "@types/node": "^20.12.10",
38
+ "@vitest/coverage-v8": "^2.0.2",
39
+ "bumpp": "^9.4.1",
40
+ "open-cli": "^8.0.0",
41
+ "prettier": "3.2.5",
42
+ "prettier-plugin-packagejson": "^2.5.0",
43
+ "tsup": "^8.0.2",
44
+ "typescript": "^5.4.5"
45
+ }
44
46
  }