New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@kaluza/mock-server

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kaluza/mock-server - npm Package Compare versions

Comparing version 0.8.2 to 0.8.3

1

dist/mockserver.d.ts

@@ -18,2 +18,3 @@ import { RequestHandler } from 'express';

method: Method;
path: PathParams;
record: EndpointRecord;

@@ -20,0 +21,0 @@ handler: RequestHandler;

17

dist/mockserver.js

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

: function (req, res) { return res.json(response); };
this.endpoints.set(path, { method: method, handler: handler, record: record });
this.endpoints.set("" + method + path, { method: method, handler: handler, record: record, path: path });
this.recreateRouter();

@@ -149,18 +149,19 @@ this.log("Handler added for path " + method + " " + path);

this.router.use(bodyParser.json());
this.endpoints.forEach(function (endpoint, path) {
switch (endpoint.method) {
this.endpoints.forEach(function (_a) {
var record = _a.record, handler = _a.handler, path = _a.path, method = _a.method;
switch (method) {
case Method.GET:
_this.router.get(path, middleware_1.recordCalls(endpoint.record.calls), endpoint.handler);
_this.router.get(path, middleware_1.recordCalls(record.calls), handler);
break;
case Method.POST:
_this.router.post(path, middleware_1.recordCalls(endpoint.record.calls), endpoint.handler);
_this.router.post(path, middleware_1.recordCalls(record.calls), handler);
break;
case Method.PATCH:
_this.router.patch(path, middleware_1.recordCalls(endpoint.record.calls), endpoint.handler);
_this.router.patch(path, middleware_1.recordCalls(record.calls), handler);
break;
case Method.PUT:
_this.router.put(path, middleware_1.recordCalls(endpoint.record.calls), endpoint.handler);
_this.router.put(path, middleware_1.recordCalls(record.calls), handler);
break;
case Method.DELETE:
_this.router["delete"](path, middleware_1.recordCalls(endpoint.record.calls), endpoint.handler);
_this.router["delete"](path, middleware_1.recordCalls(record.calls), handler);
break;

@@ -167,0 +168,0 @@ }

{
"name": "@kaluza/mock-server",
"version": "0.8.2",
"version": "0.8.3",
"main": "dist/mockserver.js",

@@ -5,0 +5,0 @@ "types": "dist/mockserver.d.ts",

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