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

express-unless

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-unless - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

4

dist/index.d.ts

@@ -7,2 +7,3 @@ import * as express from 'express';

};
export declare type RequestChecker = (req: express.Request) => boolean;
export declare type Params = {

@@ -13,3 +14,4 @@ method?: string | string[];

useOriginalUrl?: boolean;
} | ((req: express.Request) => boolean);
custom?: RequestChecker;
} | RequestChecker;
export declare function unless(options: Params): {

@@ -16,0 +18,0 @@ (req: express.Request, res: express.Response, next: express.NextFunction): Promise<void>;

@@ -17,3 +17,5 @@ "use strict";

const middleware = this;
const opts = Object.assign(Object.assign({}, options), (typeof options === 'function' ? { custom: options } : {}));
const opts = typeof options === 'function' ?
{ custom: options } :
options;
opts.useOriginalUrl = (typeof opts.useOriginalUrl === 'undefined') ? true : opts.useOriginalUrl;

@@ -41,3 +43,3 @@ const result = function (req, res, next) {

skip = skip || exts.some(function (ext) {
return url.pathname.substr(ext.length * -1) === ext;
return url.pathname.slice(ext.length * -1) === ext;
});

@@ -44,0 +46,0 @@ }

{
"name": "express-unless",
"description": "Conditionally add a middleware to express with some common patterns.",
"version": "2.1.0",
"version": "2.1.1",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": {

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