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

@adonisjs/http-server

Package Overview
Dependencies
Maintainers
2
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adonisjs/http-server - npm Package Compare versions

Comparing version 1.8.0 to 1.8.1

4

build/src/Router/index.d.ts

@@ -63,6 +63,2 @@ /**

private testRoutePatternCounter;
/**
* Cache of routes matched for a given domain, url and method
*/
private matchedRoutes;
private getRecentGroup;

@@ -69,0 +65,0 @@ /**

@@ -20,3 +20,2 @@ "use strict";

const qs_1 = require("qs");
const quick_lru_1 = __importDefault(require("quick-lru"));
const utils_1 = require("@poppinss/utils");

@@ -82,6 +81,2 @@ const Route_1 = require("./Route");

/**
* Cache of routes matched for a given domain, url and method
*/
this.matchedRoutes = new quick_lru_1.default({ maxSize: 1000 });
/**
* A handler to handle routes created for testing

@@ -298,6 +293,2 @@ */

*/
const cacheKey = `${url}-${method}-${domain}`;
if (this.matchedRoutes.has(cacheKey)) {
return this.matchedRoutes.get(cacheKey);
}
let response = null;

@@ -317,3 +308,2 @@ const matchingDomain = domain ? this.store.matchDomain(domain) : [];

}
this.matchedRoutes.set(cacheKey, response);
return response;

@@ -320,0 +310,0 @@ }

16

build/src/Router/Store.d.ts

@@ -32,2 +32,14 @@ /**

/**
* The [[matchDomainReal]] and [[matchDomainNoop]] functions are two
* implementation of matching a domain. We use noop implementation
* by default and once an explicit domain is registered, we
* pivot to [[matchDomainReal]].
*
* This all is done for performance, since we have noticed around 8-10%
* improvement.
*/
private matchDomainReal;
private matchDomainNoop;
matchDomain: any;
/**
* Returns the domain node for a given domain. If domain node is missing,

@@ -61,6 +73,2 @@ * it will added to the routes object and tokens are also generated

/**
* Matches the domain pattern for a given string
*/
matchDomain(domain: string): RouteStoreMatch[];
/**
* Matches the url, method and optionally domain to pull the matching

@@ -67,0 +75,0 @@ * route. `null` is returned when unable to match the URL against

@@ -48,2 +48,18 @@ "use strict";

this.tree = { tokens: [], domains: {} };
/**
* The [[matchDomainReal]] and [[matchDomainNoop]] functions are two
* implementation of matching a domain. We use noop implementation
* by default and once an explicit domain is registered, we
* pivot to [[matchDomainReal]].
*
* This all is done for performance, since we have noticed around 8-10%
* improvement.
*/
this.matchDomainReal = function (domain) {
return matchit_1.default.match(domain || 'root', this.tree.tokens);
}.bind(this);
this.matchDomainNoop = function (_) {
return [];
}.bind(this);
this.matchDomain = this.matchDomainNoop;
}

@@ -110,2 +126,8 @@ /**

]));
/**
* An explicit domain is defined
*/
if (route.domain && route.domain !== 'root' && this.matchDomain !== this.matchDomainReal) {
this.matchDomain = this.matchDomainReal;
}
route.methods.forEach((method) => {

@@ -135,8 +157,2 @@ const methodRoutes = this.getMethodRoutes(route.domain || 'root', method);

/**
* Matches the domain pattern for a given string
*/
matchDomain(domain) {
return matchit_1.default.match(domain || 'root', this.tree.tokens);
}
/**
* Matches the url, method and optionally domain to pull the matching

@@ -143,0 +159,0 @@ * route. `null` is returned when unable to match the URL against

{
"name": "@adonisjs/http-server",
"version": "1.8.0",
"version": "1.8.1",
"description": "Extracted copy of AdonisJs HTTP server along with it's router",

@@ -36,7 +36,7 @@ "main": "build/providers/HttpServerProvider.js",

"@adonisjs/fold": "^6.3.3",
"@adonisjs/logger": "^1.1.8",
"@adonisjs/logger": "^1.1.9",
"@adonisjs/mrm-preset": "^2.2.4",
"@adonisjs/profiler": "^2.0.0",
"@poppinss/dev-utils": "^1.0.4",
"@types/node": "^13.7.6",
"@types/node": "^13.7.7",
"@types/pluralize": "0.0.29",

@@ -52,7 +52,7 @@ "@types/proxy-addr": "^2.0.0",

"eslint-plugin-adonis": "^1.0.8",
"fastify": "^2.12.0",
"fastify": "^2.12.1",
"http-status-codes": "^1.4.0",
"husky": "^4.2.3",
"japa": "^3.0.0",
"mrm": "^2.0.4",
"mrm": "^2.1.0",
"np": "^5.2.1",

@@ -63,6 +63,6 @@ "pem": "^1.14.4",

"ts-node": "^8.6.2",
"typedoc": "^0.16.10",
"typedoc": "^0.16.11",
"typedoc-plugin-external-module-name": "^3.0.0",
"typedoc-plugin-markdown": "^2.2.17",
"typescript": "^3.8.2"
"typescript": "^3.8.3"
},

@@ -120,3 +120,3 @@ "peerDependencies": {

"snake-case": "^3.0.3",
"ts-essentials": "^6.0.1",
"ts-essentials": "^6.0.2",
"type-is": "^1.6.18",

@@ -123,0 +123,0 @@ "vary": "^1.1.2"

@@ -29,4 +29,4 @@ <div align="center"><img src="https://res.cloudinary.com/adonisjs/image/upload/q_100/v1564392111/adonis-banner_o9lunk.png" width="600px"></div>

| :----------------- | :------------------------- | :----------: | ------------: |
| **Fastify** | **2.0.0** | **&#10003;** | **52709** |
| **AdonisJs** | **1.5.4** | **&#10003;** | **47791** |
| **Fastify** | **2.0.0** | **&#10003;** | **58,740** |
| **AdonisJS** | **1.8.1** | **&#10003;** | **54,832** |

@@ -33,0 +33,0 @@ You can run the same benchmarks by cloning the repo and then running the following command.

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