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

anumargak

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anumargak - npm Package Compare versions

Comparing version 1.8.1 to 1.9.0

2

package.json
{
"name": "anumargak",
"version": "1.8.1",
"version": "1.9.0",
"description": "Amazing fast multipurpose simple to use web/ HTTP router",

@@ -5,0 +5,0 @@ "main": "./src/letsRoute.js",

@@ -185,2 +185,4 @@ # अनुमार्गक (anumargak)

Lookup method also save _path, _queryStr, and _hashStr in request object to save re-effort of spliting them.
## count

@@ -187,0 +189,0 @@

@@ -274,3 +274,3 @@ var { getFirstMatche, getAllMatches, doesMatch, urlSlice } = require("./util");

Anumargak.prototype.quickFind = function (method, url, version) {
url = urlSlice(url);
url = urlSlice(url).url;
var result = this.staticRoutes[method][url];

@@ -307,2 +307,5 @@ if (result) {

}else{
req._path = result.urlData.url;
req._queryStr = result.urlData.queryStr;
req._hashStr = result.urlData.hashStr;
result.handler(req, res, result.params);

@@ -313,4 +316,4 @@ }

Anumargak.prototype.find = function (method, url, version) {
url = urlSlice(url);
var result = this.staticRoutes[method][url];
const urlData = urlSlice(url);
var result = this.staticRoutes[method][urlData.url];
if (result) {

@@ -320,3 +323,4 @@ return {

params: result.params,
store: result.store
store: result.store,
urlData : urlData
};

@@ -327,3 +331,3 @@ }else {

var route = this.dynamicRoutes[method][urlRegex[i]];
var matches = route.regex.exec(url);
var matches = route.regex.exec(urlData.url);
var params = route.params;

@@ -339,3 +343,4 @@ if (matches) {

params: params,
store: result.store
store: result.store,
urlData : urlData
};

@@ -342,0 +347,0 @@ }

@@ -59,3 +59,3 @@ const RandExp = require('randexp');

exports.urlSlice = function (url) {
/* exports.urlSlice = function (url) {
var index = url.indexOf("?");

@@ -66,2 +66,24 @@ if (index > 0) return url.substr(0, index);

return url;
} */
exports.urlSlice = function (url) {
var result = {
url : url
};
for (var i = 0, len = url.length; i < len; i++) {
var charCode = url.charCodeAt(i)
if( url[i] === '?' ) {
result.url = url.substr(0, i)
result.queryStr = url.substr(i+1);
break;
}else if( url[i] === '#' ) {
result.url = url.substr(0, i)
result.hashStr = url.substr(i+1);
break;
}else if( url[i] === ';' ) {
result.url = url.substr(0, i)
result.queryStr = url.substr(i+1);
break;
}
}
return result;
}

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