Skip to content

Commit 80c85e4

Browse files
committed
🧹 chore: bump version
1 parent a2a179a commit 80c85e4

File tree

8 files changed

+61
-258
lines changed

8 files changed

+61
-258
lines changed

.npmignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
.git
2-
.gitignore
32
.github
3+
.gitignore
44
.prettierrc
55
.cjs.swcrc
66
.es.swcrc
77
bun.lockb
8-
src
98

109
node_modules
1110
tsconfig.json
@@ -20,3 +19,7 @@ CHANGELOG.md
2019
.eslintrc.js
2120
tsconfig.cjs.json
2221
tsconfig.esm.json
22+
tsconfig.dts.json
23+
24+
build.ts
25+
src

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2+
# 1.1.0 - 16 Jul 2024
3+
Change:
4+
- Add support for Elysia 1.1
5+
16
# 1.0.5 - 14 Jul 2024
27
Bug fix:
38
- fix content-type on preflight

bun.lockb

46.7 KB
Binary file not shown.

pac

Whitespace-only changes.

package.json

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
11
{
2-
"name": "@elysiajs/cors",
3-
"version": "1.0.5",
4-
"description": "Plugin for Elysia that for Cross Origin Requests (CORs)",
5-
"author": {
6-
"name": "saltyAom",
7-
"url": "https://github.com/SaltyAom",
8-
"email": "saltyaom@gmail.com"
9-
},
10-
"repository": {
11-
"type": "git",
12-
"url": "https://github.com/elysiajs/elysia-cors"
13-
},
14-
"main": "./dist/cjs/index.js",
15-
"module": "./dist/index.js",
16-
"types": "./dist/index.d.ts",
17-
"exports": {
18-
"bun": "./dist/index.js",
19-
"node": "./dist/cjs/index.js",
20-
"require": "./dist/cjs/index.js",
21-
"import": "./dist/index.js",
22-
"default": "./dist/cjs/index.js",
23-
"types": "./dist/index.d.ts"
24-
},
25-
"homepage": "https://github.com/elysiajs/elysia-cors",
26-
"keywords": [
27-
"elysia",
28-
"cors"
29-
],
30-
"license": "MIT",
31-
"scripts": {
32-
"dev": "bun run --watch example/index.ts",
33-
"test": "bun test && npm run test:node",
34-
"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",
35-
"build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json",
36-
"release": "npm run build && npm run test && npm publish --access public"
37-
},
38-
"devDependencies": {
39-
"@types/bun": "^1.0.4",
40-
"@types/node": "^18.11.7",
41-
"elysia": "1.0.27",
42-
"eslint": "^8.26.0",
43-
"rimraf": "^3.0.2",
44-
"typescript": "^5.4.3"
45-
},
46-
"peerDependencies": {
47-
"elysia": ">= 1.0.2"
48-
}
49-
}
2+
"name": "@elysiajs/cors",
3+
"version": "1.1.0",
4+
"description": "Plugin for Elysia that for Cross Origin Requests (CORs)",
5+
"author": {
6+
"name": "saltyAom",
7+
"url": "https://github.com/SaltyAom",
8+
"email": "saltyaom@gmail.com"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/elysiajs/elysia-cors"
13+
},
14+
"main": "./dist/cjs/index.js",
15+
"module": "./dist/index.mjs",
16+
"types": "./dist/index.d.ts",
17+
"exports": {
18+
"./package.json": "./package.json",
19+
".": {
20+
"types": "./dist/index.d.ts",
21+
"import": "./dist/index.mjs",
22+
"require": "./dist/cjs/index.js"
23+
}
24+
},
25+
"homepage": "https://github.com/elysiajs/elysia-cors",
26+
"keywords": [
27+
"elysia",
28+
"cors"
29+
],
30+
"license": "MIT",
31+
"scripts": {
32+
"dev": "bun run --watch example/index.ts",
33+
"test": "bun test && npm run test:node",
34+
"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",
35+
"build": "bun build.ts",
36+
"release": "npm run build && npm run test && npm publish --access public"
37+
},
38+
"devDependencies": {
39+
"@types/bun": "^1.1.6",
40+
"@types/node": "^20.14.10",
41+
"elysia": ">= 1.1.0-rc.2",
42+
"eslint": "^8.26.0",
43+
"tsup": "^8.1.0",
44+
"typescript": "^5.5.2"
45+
},
46+
"peerDependencies": {
47+
"elysia": ">= 1.1.0"
48+
}
49+
}

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ interface CORSConfig {
160160
preflight?: boolean
161161
}
162162

163+
// @ts-ignore
163164
const isBun = typeof new Headers()?.toJSON === 'function'
164165

165166
/**
@@ -301,6 +302,7 @@ export const cors = (config?: CORSConfig) => {
301302
defaultHeaders['access-control-expose-headers'] = exposeHeaders
302303

303304
if (typeof allowedHeaders === 'string')
305+
// @ts-ignore
304306
defaultHeaders['access-control-allow-headers'] = allowedHeaders
305307

306308
if (credentials === true)
@@ -336,6 +338,7 @@ export const cors = (config?: CORSConfig) => {
336338
handleMethod(set, request.method)
337339

338340
if (allowedHeaders === true || exposeHeaders === true) {
341+
// @ts-ignore
339342
const headers = processHeaders(request.headers)
340343

341344
if (allowedHeaders === true)

tsconfig.cjs.json

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)