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

@immjs/express-subdomain

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@immjs/express-subdomain - npm Package Compare versions

Comparing version 1.2.3 to 1.2.4

2

index.d.ts

@@ -9,2 +9,2 @@ import express from "express";

}
export default function (subdomain: string, fn: express.Router): (req: express.Request, res: express.Response, next: express.NextFunction) => void;
export default function (subdomain: string, fn: express.Router, offset?: number): (req: express.Request, res: express.Response, next: express.NextFunction) => void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function default_1(subdomain, fn) {
function default_1(subdomain, fn, offset = 0) {
if (!subdomain || typeof subdomain !== "string") {

@@ -17,3 +17,3 @@ throw new Error("The first parameter must be a string representing the subdomain");

req._subdomainLevel || (req._subdomainLevel = 0);
let relevantSubdomains = req.subdomains.reverse().slice(req._subdomainLevel);
let relevantSubdomains = req.subdomains.reverse().slice(req._subdomainLevel + offset);
let match = true;

@@ -20,0 +20,0 @@ for (let i in subdomains) {

@@ -11,3 +11,3 @@ import express from "express";

export default function(subdomain: string, fn: express.Router) {
export default function(subdomain: string, fn: express.Router, offset: number = 0) {
if (!subdomain || typeof subdomain !== "string") {

@@ -29,3 +29,3 @@ throw new Error("The first parameter must be a string representing the subdomain");

req._subdomainLevel ||= 0;
let relevantSubdomains = req.subdomains.reverse().slice(req._subdomainLevel);
let relevantSubdomains = req.subdomains.reverse().slice(req._subdomainLevel + offset);

@@ -32,0 +32,0 @@ let match = true;

{
"name": "@immjs/express-subdomain",
"version": "1.2.3",
"version": "1.2.4",
"repository": {

@@ -18,3 +18,3 @@ "type": "git",

],
"author": "Jerome Wang <immjs>",
"author": "Jerome Wang <contact@immjs.dev>",
"license": "Hippocratic-2.1",

@@ -21,0 +21,0 @@ "devDependencies": {

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