Socket
Socket
Sign inDemoInstall

them

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.2 to 0.0.3

7

lib/index.js

@@ -12,3 +12,2 @@ var context;

var requiredModules = [];
var lib = process.env.THEM_LIB || "./lib";

@@ -22,3 +21,3 @@ functionParameters.forEach(function(name) {

if(toRequire.substr(0, 2) === "./") {
toRequire = lib + toRequire.substr(1);
toRequire = module.exports.getLib() + toRequire.substr(1);
}

@@ -43,4 +42,8 @@ subModule = mapped[1];

module.exports.getLib = function() {
return process.env.THEM_LIB || "./lib";
};
module.exports.list = function() {
return map;
};
{
"name": "them",
"version": "0.0.2",
"version": "0.0.3",
"description": "Easier node require",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -139,2 +139,25 @@ var them = require("../lib/index.js"),

});
describe('#getLib()', function() {
it('should return the default lib folder', function() {
// given
them.init(fakeContext, {});
// when
var lib = them.getLib();
// then
expect(lib).to.equal("./lib");
});
it('should return the default lib folder', function() {
// given
process.env.THEM_LIB = './lib_cov';
them.init(fakeContext, {});
// when
var lib = them.getLib();
// then
expect(lib).to.equal("./lib_cov");
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc