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

microrouter

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

microrouter - npm Package Compare versions

Comparing version 3.1.2 to 3.1.3

7

dist/lib/index.js

@@ -8,8 +8,9 @@ function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }

const methodFn = method => (path, handler) => {
if (!path) throw new Error('You need to set a valid path');
const methodFn = method => (givenPath, handler) => {
if (!givenPath) throw new Error('You need to set a valid path');
if (!handler) throw new Error('You need to set a valid handler');
return (req, res, namespace) => {
const route = !isPattern(path) ? new UrlPattern(`${namespace}${path}`, patternOpts) : path;
const path = givenPath === '/' ? '(/)' : givenPath;
const route = isPattern(path) ? path : new UrlPattern(`${namespace}${path}`, patternOpts);

@@ -16,0 +17,0 @@ const { params, query } = getParamsAndQuery(route, req.url);

@@ -5,3 +5,4 @@ const { parse } = require('url');

const patternOpts = {
segmentNameCharset: 'a-zA-Z0-9_-'
segmentNameCharset: 'a-zA-Z0-9_-',
segmentValueCharset: 'a-zA-Z0-9@.+-_'
};

@@ -8,0 +9,0 @@

{
"name": "microrouter",
"description": "🚉 A tiny and functional router for ZEIT's Micro",
"version": "3.1.2",
"version": "3.1.3",
"main": "dist/lib/index.js",
"jsnext:main": "src/lib/index.js",
"scripts": {
"prerelease": "yarn test && yarn lint && yarn build",
"release": "np",

@@ -9,0 +10,0 @@ "lint": "eslint ./src/**/*.js",

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