Comparing version 0.34.0 to 0.35.0
@@ -1,2 +0,2 @@ | ||
import { P as Params, H as Handler, B as BodyInit, a as Pipeline } from './types-d5fbd7b3.js'; | ||
import { P as Params, H as Handler, B as BodyInit, a as Pipeline } from './types-7c06e83c.js'; | ||
import { NextApiHandler } from 'next'; | ||
@@ -3,0 +3,0 @@ import { IncomingMessage } from 'node:http'; |
@@ -117,3 +117,3 @@ var __create = Object.create; | ||
body: req.body || body, | ||
rawBody: bodies == null ? void 0 : bodies.rawBody, | ||
rawBody: bodies?.rawBody, | ||
response: null | ||
@@ -120,0 +120,0 @@ }; |
import 'http'; | ||
export { h as handle } from './types-d5fbd7b3.js'; | ||
export { h as handle } from './types-7c06e83c.js'; | ||
import 'stream'; |
import 'http'; | ||
export { b as HTTPMethod, H as Handler, M as Middleware, a as Pipeline, i as Request, g as Routes, f as Routing, j as ServerApp, h as handle, r as response } from './types-d5fbd7b3.js'; | ||
export { b as HTTPMethod, H as Handler, M as Middleware, a as Pipeline, i as Request, g as Routes, f as Routing, j as ServerApp, h as handle, r as response } from './types-7c06e83c.js'; | ||
import 'stream'; |
11
index.js
@@ -295,3 +295,3 @@ var __create = Object.create; | ||
const preferredType = accept.split(",").shift(); | ||
const format = preferredType == null ? void 0 : preferredType.split("/").pop(); | ||
const format = preferredType?.split("/").pop(); | ||
return format; | ||
@@ -324,3 +324,2 @@ }; | ||
var handleRequest = async (request) => { | ||
var _a; | ||
const { headers, params } = request; | ||
@@ -333,3 +332,3 @@ const { format } = params; | ||
if (buffer.length > 0) { | ||
const contentType = (_a = headers["content-type"]) == null ? void 0 : _a.split(";")[0]; | ||
const contentType = headers["content-type"]?.split(";")[0]; | ||
switch (contentType) { | ||
@@ -676,4 +675,3 @@ case "application/x-www-form-urlencoded": | ||
return new Promise((resolve, reject) => { | ||
var _a; | ||
(_a = this.server) == null ? void 0 : _a.listen(port, () => { | ||
this.server?.listen(port, () => { | ||
resolve(this.server); | ||
@@ -684,4 +682,3 @@ }); | ||
get port() { | ||
var _a; | ||
const { port } = (_a = this.server) == null ? void 0 : _a.address(); | ||
const { port } = this.server?.address(); | ||
return port; | ||
@@ -688,0 +685,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { M as Middleware, b as HTTPMethod } from './types-d5fbd7b3.js'; | ||
import { M as Middleware, b as HTTPMethod } from './types-7c06e83c.js'; | ||
import { ZodTypeAny } from 'zod'; | ||
@@ -9,5 +9,5 @@ import 'http'; | ||
declare const withMethod: (...methods: HTTPMethod[]) => Middleware; | ||
declare type Schema = ZodTypeAny; | ||
type Schema = ZodTypeAny; | ||
declare const RequestValidator: (schema: Schema) => Middleware; | ||
export { RequestValidator, asHTML, asJSON, withMethod }; |
{ | ||
"name": "retes", | ||
"version": "0.34.0", | ||
"version": "0.35.0", | ||
"description": "Universal HTTP library for Node.js, Deno & Serverless (Cloudflare, Vercel, Netlify)", | ||
@@ -5,0 +5,0 @@ "types": "index.d.ts", |
@@ -1,3 +0,3 @@ | ||
export { e as Response, S as Status } from './types-d5fbd7b3.js'; | ||
export { e as Response, S as Status } from './types-7c06e83c.js'; | ||
import 'http'; | ||
import 'stream'; |
@@ -1,2 +0,2 @@ | ||
import { H as Handler, a as Pipeline, R as RouteOptions, c as Route } from './types-d5fbd7b3.js'; | ||
import { H as Handler, a as Pipeline, R as RouteOptions, c as Route } from './types-7c06e83c.js'; | ||
import 'http'; | ||
@@ -3,0 +3,0 @@ import 'stream'; |
@@ -1,3 +0,3 @@ | ||
export { d as Router } from './types-d5fbd7b3.js'; | ||
export { d as Router } from './types-7c06e83c.js'; | ||
import 'http'; | ||
import 'stream'; |
@@ -1,3 +0,3 @@ | ||
export { f as Routing } from './types-d5fbd7b3.js'; | ||
export { f as Routing } from './types-7c06e83c.js'; | ||
import 'http'; | ||
import 'stream'; |
@@ -73,3 +73,3 @@ var __create = Object.create; | ||
const preferredType = accept.split(",").shift(); | ||
const format = preferredType == null ? void 0 : preferredType.split("/").pop(); | ||
const format = preferredType?.split("/").pop(); | ||
return format; | ||
@@ -102,3 +102,2 @@ }; | ||
var handleRequest = async (request) => { | ||
var _a; | ||
const { headers, params } = request; | ||
@@ -111,3 +110,3 @@ const { format } = params; | ||
if (buffer.length > 0) { | ||
const contentType = (_a = headers["content-type"]) == null ? void 0 : _a.split(";")[0]; | ||
const contentType = headers["content-type"]?.split(";")[0]; | ||
switch (contentType) { | ||
@@ -114,0 +113,0 @@ case "application/x-www-form-urlencoded": |
import 'http'; | ||
import 'stream'; | ||
export { B as BodyInit, C as Context, H as Handler, p as HandlerParams, q as HandlerParamsMap, k as HeadersInit, K as KeyValue, l as MaybePromise, n as Meta, M as Middleware, P as Params, a as Pipeline, i as Request, e as Response, m as ReversedPipeline, c as Route, R as RouteOptions, o as RoutePaths, g as Routes } from './types-d5fbd7b3.js'; | ||
export { B as BodyInit, C as Context, H as Handler, p as HandlerParams, q as HandlerParamsMap, k as HeadersInit, K as KeyValue, l as MaybePromise, n as Meta, M as Middleware, P as Params, a as Pipeline, i as Request, e as Response, m as ReversedPipeline, c as Route, R as RouteOptions, o as RoutePaths, g as Routes } from './types-7c06e83c.js'; |
@@ -1,2 +0,2 @@ | ||
import { H as Handler, a as Pipeline, P as Params } from './types-d5fbd7b3.js'; | ||
import { H as Handler, a as Pipeline, P as Params } from './types-7c06e83c.js'; | ||
import { Readable, Stream } from 'stream'; | ||
@@ -3,0 +3,0 @@ import 'http'; |
@@ -82,3 +82,3 @@ var __defProp = Object.defineProperty; | ||
const preferredType = accept.split(",").shift(); | ||
const format = preferredType == null ? void 0 : preferredType.split("/").pop(); | ||
const format = preferredType?.split("/").pop(); | ||
return format; | ||
@@ -85,0 +85,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
241690
71
8173