Skip to content

Commit 08f0cbe

Browse files
committed
🎉 feat: 0.6.1
1 parent 5d7491e commit 08f0cbe

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## 0.6.1 - 11 Sep 2023
4+
-[#11](https://github.com/elysiajs/elysia-jwt/pull/11) Remove unused imports
5+
-[#10](https://github.com/elysiajs/elysia-jwt/pull/10) Meaningful type import
6+
-[#9](https://github.com/elysiajs/elysia-jwt/pull/9) s Add missing ESLint plugins
7+
-[#8](https://github.com/elysiajs/elysia-jwt/pull/8) Reformat CHANGELOG with
8+
-[#7](https://github.com/elysiajs/elysia-jwt/pull/7) Format README with Markdownlint
9+
-[#6](https://github.com/elysiajs/elysia-jwt/pull/6) Correct the schema validation
10+
-[#5](https://github.com/elysiajs/elysia-jwt/pull/5) Support KeyLike and Uint8Array as secret
11+
-[#4](https://github.com/elysiajs/elysia-jwt/pull/4) Remove unnecessary "as any"
12+
-[#3](https://github.com/elysiajs/elysia-jwt/pull/3) Schema alidator Security Fix
13+
314
## 0.6.0 - 6 Aug 2023
415

516
- Add support for Elysia 0.6

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"license": "MIT",
3232
"scripts": {
3333
"dev": "bun run --hot example/index.ts",
34-
"test": "bun wiptest && npm run test:node",
34+
"test": "bun test && npm run test:node",
3535
"test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js",
3636
"build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json",
3737
"release": "npm run build && npm run test && npm publish --access public"

src/index.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
ValidationError,
3-
getSchemaValidator,
4-
Elysia,
5-
} from 'elysia'
1+
import { Elysia, ValidationError, getSchemaValidator } from 'elysia'
62

73
import {
84
SignJWT,
@@ -97,9 +93,8 @@ export const jwt = <
9793
JWTOption<Name, Schema>) => {
9894
if (!secret) throw new Error("Secret can't be empty")
9995

100-
const key = typeof secret === 'string'
101-
? new TextEncoder().encode(secret)
102-
: secret;
96+
const key =
97+
typeof secret === 'string' ? new TextEncoder().encode(secret) : secret
10398

10499
const validator = schema
105100
? getSchemaValidator(

0 commit comments

Comments
 (0)