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

wegweiser

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wegweiser - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

4

package.json
{
"name": "wegweiser",
"version": "4.1.0",
"version": "4.2.0",
"description": "A router for Quinn",

@@ -30,5 +30,5 @@ "main": "wegweiser.js",

"dependencies": {
"footnote": "^1.0.0",
"footnote": "^1.1.0",
"routington": "^1.0.3"
}
}

@@ -35,4 +35,9 @@ # Wegweiser

const router = createRouter(simpleHandler, PretendingItsJava);
// router is a quinn handler: request => response
const objectOrInstance {
@GET('/object/:op')
getObject(req, { op }) { return respond.json({ op }); }
}
const router = // router is a quinn handler: request => response
createRouter(simpleHandler, PretendingItsJava, objectOrInstance);
```

@@ -49,4 +54,6 @@

Each argument to this function should either be an annotated function
or a class with annotated methods.
Each argument to this function should be an annotated function,
a class with annotated methods,
or an object with annoated methods.
Both for objects and classes the prototype chain will be scanned.
Routes have to be unambiguous.

@@ -53,0 +60,0 @@ If the same method and path combination is configured twice,

@@ -26,5 +26,5 @@ 'use strict';

const constructAndHandle = function constructAndHandle(req) {
const constructAndHandle = function constructAndHandle(req, params) {
const instance = new ctor(req);
return instance[key].apply(instance, arguments);
return instance[key](req, params);
};

@@ -36,2 +36,13 @@

return constructAndHandle;
} else if (result.ctx !== null && typeof result.ctx === 'object') {
const ctx = result.ctx, key = result.key;
const applyHandlerToContext = function applyHandlerToContext(req, params) {
return ctx[key](req, params);
};
applyHandlerToContext.ctx = ctx;
applyHandlerToContext.key = key;
return applyHandlerToContext;
}

@@ -38,0 +49,0 @@ return result.target;

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