@immjs/express-subdomain
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20288