Sign In

srvx

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

srvx - npm Package Compare versions

Comparing version
0.12.0
to
0.12.1
+3
-0
dist/adapters/node.d.mts

@@ -46,2 +46,5 @@ import { FetchHandler, NodeHttpHandler, NodeServerRequest, NodeServerResponse, Server, ServerOptions, ServerRequest, TrustProxyOption } from "../_chunks/types.mjs";

};
json(data: unknown, init?: ResponseInit): globalThis.Response & {
_toNodeResponse: () => PreparedNodeResponse;
};
};

@@ -48,0 +51,0 @@ type NodeResponse = InstanceType<typeof NodeResponse>;

@@ -512,2 +512,17 @@ import { FastURL, lazyInherit } from "../_chunks/_url.mjs";

}
static json(data, init) {
const body = JSON.stringify(data);
if (body === void 0) throw new TypeError("Value is not JSON serializable");
let headers = init?.headers;
if (!headers) headers = { "content-type": "application/json" };
else {
const merged = new Headers(headers);
if (!merged.has("content-type")) merged.set("content-type", "application/json");
headers = merged;
}
return new NodeResponse(body, init ? {
...init,
headers
} : { headers });
}
get status() {

@@ -514,0 +529,0 @@ return this.#response?.status || this.#init?.status || 200;

+1
-1

@@ -208,3 +208,3 @@ import { bold, cyan, gray, green, magenta, red, url, yellow } from "./_chunks/_utils.mjs";

name: "srvx",
version: "0.11.22",
version: "0.12.0",
description: "Universal Server."

@@ -211,0 +211,0 @@ };

{
"name": "srvx",
"version": "0.12.0",
"version": "0.12.1",
"description": "Universal Server.",

@@ -5,0 +5,0 @@ "homepage": "https://srvx.h3.dev",