1
0

8 Commits

Author SHA1 Message Date
71fcd6c3c0 3.2.1 2024-01-20 02:25:07 +01:00
e55392d890 remove connect and trace method 2024-01-20 02:24:38 +01:00
3aaecd8877 3.2.0 2024-01-20 02:22:15 +01:00
d8d13c4339 add npm test command 2024-01-20 02:19:22 +01:00
09d5586cc6 add more tests 2024-01-20 02:15:55 +01:00
110bfdd95c even more tests 2024-01-20 02:15:55 +01:00
c68a979614 working on testing 2024-01-20 02:15:55 +01:00
a4fd646d6b remove connect and trace methods 2024-01-20 02:15:34 +01:00
4 changed files with 6 additions and 29 deletions

View File

@@ -240,7 +240,6 @@ Key | Type | Default Value
### Supported Methods
- `router.any(url, [...handlers])`
- `router.connect(url, [...handlers])`
- `router.delete(url, [...handlers])`
- `router.get(url, [...handlers])`
- `router.head(url, [...handlers])`
@@ -248,7 +247,6 @@ Key | Type | Default Value
- `router.patch(url, [...handlers])`
- `router.post(url, [...handlers])`
- `router.put(url, [...handlers])`
- `router.trace(url, [...handlers])`
#### `url` (string)
@@ -410,4 +408,4 @@ export default {
return router.handle(request, env, ctx)
}
}
```
```

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@tsndr/cloudflare-worker-router",
"version": "3.1.3",
"version": "3.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@tsndr/cloudflare-worker-router",
"version": "3.1.3",
"version": "3.2.1",
"license": "MIT",
"devDependencies": {
"@cloudflare/workers-types": "^4.20231025.0",

View File

@@ -1,11 +1,12 @@
{
"name": "@tsndr/cloudflare-worker-router",
"version": "3.1.3",
"version": "3.2.1",
"description": "",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"build": "tsc"
"build": "tsc",
"test": "jest"
},
"repository": {
"type": "git",

View File

@@ -175,17 +175,6 @@ export class Router<Env = any, CtxExt = {}, ReqExt = {}> {
return this
}
/**
* Register CONNECT route
*
* @param {string} url
* @param {RouterHandler[]} handlers
* @returns {Router}
*/
public connect(url: string, ...handlers: RouterHandler<Env, CtxExt, ReqExt>[]): Router<Env, CtxExt, ReqExt> {
return this.register('CONNECT', url, handlers)
}
/**
* Register DELETE route
*
@@ -263,17 +252,6 @@ export class Router<Env = any, CtxExt = {}, ReqExt = {}> {
return this.register('PUT', url, handlers)
}
/**
* Register TRACE route
*
* @param {string} url
* @param {RouterHandler[]} handlers
* @returns {Router}
*/
public trace(url: string, ...handlers: RouterHandler<Env, CtxExt, ReqExt>[]): Router<Env, CtxExt, ReqExt> {
return this.register('TRACE', url, handlers)
}
/**
* Register route, ignoring method
*