@mashroom/mashroom-utils
Advanced tools
Comparing version 1.8.3 to 1.9.0
import type { IncomingMessage } from 'http'; | ||
import type { Request } from 'express'; | ||
export declare const getClientIP: (request: Request | IncomingMessage) => string; | ||
export declare const getClientIP: (request: Request | IncomingMessage) => string | null; | ||
export declare const clientIPMatch: (request: Request | IncomingMessage, patterns: string | Array<string>) => boolean; |
@@ -14,5 +14,3 @@ "use strict"; | ||
// @ts-ignore | ||
var getClientIP = function getClientIP(request) { | ||
// @ts-ignore | ||
return _requestIp.default.getClientIp(request); | ||
@@ -24,5 +22,6 @@ }; | ||
var clientIPMatch = function clientIPMatch(request, patterns) { | ||
return !!(0, _ipFilter.default)(getClientIP(request), patterns); | ||
var clientIp = getClientIP(request); | ||
return !!clientIp && !!(0, _ipFilter.default)(clientIp, patterns); | ||
}; | ||
exports.clientIPMatch = clientIPMatch; |
@@ -16,3 +16,3 @@ "use strict"; | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } | ||
@@ -19,0 +19,0 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } |
@@ -16,3 +16,3 @@ "use strict"; | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } | ||
@@ -19,0 +19,0 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } |
@@ -16,3 +16,3 @@ "use strict"; | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } | ||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } | ||
@@ -19,0 +19,0 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } |
@@ -13,3 +13,2 @@ "use strict"; | ||
var determineUserAgent = function determineUserAgent(req) { | ||
// @ts-ignore | ||
var ua = (0, _uaParserJs.default)(req.headers['user-agent']); | ||
@@ -16,0 +15,0 @@ return { |
@@ -7,3 +7,3 @@ { | ||
"license": "MIT", | ||
"version": "1.8.3", | ||
"version": "1.9.0", | ||
"main": "lib", | ||
@@ -14,3 +14,3 @@ "files": [ | ||
"dependencies": { | ||
"find-process": "^1.4.4", | ||
"find-process": "^1.4.5", | ||
"ip-filter": "^3.0.5", | ||
@@ -22,5 +22,5 @@ "kind-of": "^6.0.3", | ||
"devDependencies": { | ||
"@babel/cli": "^7.14.8", | ||
"@babel/cli": "^7.15.7", | ||
"@types/express": "^4.17.13", | ||
"@types/jest": "^26.0.24", | ||
"@types/jest": "^27.0.1", | ||
"@types/request-ip": "^0.0.37", | ||
@@ -31,4 +31,4 @@ "@types/ua-parser-js": "^0.7.36", | ||
"eslint": "^7.32.0", | ||
"jest": "^27.0.6", | ||
"typescript": "^4.3.5" | ||
"jest": "^27.2.0", | ||
"typescript": "^4.4.3" | ||
}, | ||
@@ -35,0 +35,0 @@ "jest": { |
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
44160
32
621
Updatedfind-process@^1.4.5