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

wegweiser

Package Overview
Dependencies
Maintainers
1
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 3.0.1 to 3.1.0

17

matcher.js

@@ -10,3 +10,3 @@ 'use strict';

function createMatcher(method, strings, dynamicSegments, onMatch, context) {
function createMatcher(method, strings, dynamicSegments, onMatch) {
const staticSegments = strings.map(function(str) {

@@ -56,3 +56,3 @@ return str.split('/').filter(nonEmpty);

routeArgsByReq.set(req, args);
return onMatch.apply(context, [ req ].concat(args));
return onMatch.apply(this, [ req ].concat(args));
}

@@ -86,4 +86,13 @@

const params = [].slice.call(arguments, 1);
return function(onMatch) {
return createMatcher(method, strings, params, onMatch, null);
return function(target, propName, descriptor) {
if (arguments.length === 1) { // we just decorate a function
return createMatcher(method, strings, params, target);
} else if (arguments.length === 3) {
return {
enumberable: descriptor.enumberable,
configurable: descriptor.configurable,
writeable: descriptor.writeable,
value: createMatcher(method, strings, params, descriptor.value)
}
}
};

@@ -90,0 +99,0 @@ };

{
"name": "wegweiser",
"version": "3.0.1",
"version": "3.1.0",
"description": "A router for Quinn",

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

@@ -6,5 +6,20 @@ # Wegweiser

```js
const app = GET `/my/scope` (req => {
const simpleHandler = GET `/my/scope` (req => {
return respond().body('ok');
});
const usingDecorators = {
@GET `/add/${Number}/${Number}`
getSum(req, a, b) {
return respond().body(`${a} + ${b} = ${a + b}`);
}
};
class PretendingItsJava {
@PUT `/user/${String}/profile`
async updateProfile(req, username) {
const data = await readJson(req);
return respond.json({ ok: true, firstName: data.firstName });
}
}
```
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