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

supertest-prefix

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

supertest-prefix - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

32

lib/index.js
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(['exports', './supertest-prefix'], factory);
define(['exports'], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require('./supertest-prefix'));
factory(exports);
} else {

@@ -10,6 +10,6 @@ var mod = {

};
factory(mod.exports, global.supertestPrefix);
factory(mod.exports);
global.index = mod.exports;
}
})(this, function (exports, _supertestPrefix) {
})(this, function (exports) {
'use strict';

@@ -20,14 +20,18 @@

});
Object.defineProperty(exports, 'supertestPrefix', {
enumerable: true,
get: function () {
return _interopRequireDefault(_supertestPrefix).default;
}
});
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
exports.default = function (prefix) {
return function (req) {
if (req.url[0] === '/') {
req.url = prefix + req.url;
return req;
}
var protocol = req.url.substring(0, req.url.indexOf('://') + 3);
var path = req.url.substring(req.url.indexOf('://') + 3, req.url.length);
var newPath = path.substring(0, path.indexOf('/')) + prefix + path.substring(path.indexOf('/'), path.length);
req.url = protocol + newPath;
return req;
};
}
};
});
{
"name": "supertest-prefix",
"version": "1.0.0",
"version": "1.0.1",
"description": "An extension to supertest which adds prefix to the routes",

@@ -5,0 +5,0 @@ "license": "WTFPL",

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