Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dkx/http-server

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dkx/http-server - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

4

lib/middleware-stack.d.ts
import { Request } from './request';
import { Response } from './response';
import { Middleware } from './middleware';
import { Middleware, RequestState } from './middleware';
export declare class MiddlewareStack {
private readonly middlewares;
constructor(middlewares: Array<Middleware>);
run(request: Request, response: Response): Promise<Response>;
run(request: Request, response: Response, state?: RequestState): Promise<Response>;
private createNextFunction;
}

@@ -15,3 +15,3 @@ "use strict";

}
run(request, response) {
run(request, response, state = {}) {
return __awaiter(this, void 0, void 0, function* () {

@@ -21,3 +21,2 @@ if (!this.middlewares.length) {

}
const state = {};
const next = this.createNextFunction(request, state, 0);

@@ -24,0 +23,0 @@ return yield this.middlewares[0](request, response, next, state);

@@ -1,2 +0,2 @@

import { Middleware } from './middleware';
import { Middleware, RequestState } from './middleware';
import { Request } from './request';

@@ -10,4 +10,4 @@ import { Response } from './response';

run(port: number, fn?: () => void): void;
middleware(req: Request, res: Response): Promise<Response>;
middleware(req: Request, res: Response, state?: RequestState): Promise<Response>;
close(fn?: () => void): void;
}

@@ -28,3 +28,3 @@ "use strict";

const req = request_1.transformFromNativeRequest(request);
const res = yield this.middleware(req, new response_1.Response);
const res = yield this.middleware(req, new response_1.Response, {});
response_1.transformToNativeResponse(response, res, () => {

@@ -36,5 +36,5 @@ response.end();

}
middleware(req, res) {
middleware(req, res, state = {}) {
const middlewares = new middleware_stack_1.MiddlewareStack([...this.middlewares]);
return middlewares.run(req, res);
return middlewares.run(req, res, state);
}

@@ -41,0 +41,0 @@ close(fn) {

{
"name": "@dkx/http-server",
"version": "1.3.1",
"version": "1.3.2",
"description": "Minimalistic HTTP server",

@@ -5,0 +5,0 @@ "repository": "git@gitlab.com:dkx/http/server.git",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc