New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

amend

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amend - npm Package Compare versions

Comparing version 0.3.0-beta-16 to 0.3.0-beta-17

dist/get-conf-paths.js

41

browserify.js
var R = require('ramda')
var normalize = require('path').normalize;
var getConfPaths = require('./dist/get-conf-paths')
function isLocal(path) {
return path[0] === '.';
}
function getRequrePath(val) {
if (typeof val === 'string') {
return val;
} else {
return val.require;
}
}
function addAmendModule(b, opts, nodeModule) {

@@ -25,27 +14,11 @@ function shouldInclude(key, path) {

var bundleExternal = opts.bundleExternal !== false;
var modules = opts.config.modules;
var parents = opts.config.parents || [];
parents.forEach(function(p) {
addParent(b, opts, p);
})
Object.keys(modules).forEach(function(key) {
var modulePath = getRequrePath(modules[key]);
if (shouldInclude(key, modulePath)) {
if (nodeModule) {
modulePath = normalize([ nodeModule, modulePath ].join('/'))
}
b.require(modulePath);
var paths = getConfPaths(opts.config)
paths.forEach(function(obj) {
var key = obj.key;
var path = obj.path;
if (shouldInclude(key, path)) {
b.require(p);
}
});
}
function addParent(b, opts, parentConf) {
var base = process.cwd();
var configFilePath = normalize([ parentConf.nodeModule, parentConf.configFile ]).join('/');
var p = require(configFilePath);
var parentOpts = R.assoc('config', p, opts)
b.require(configFilePath)
addAmendModule(b, parentOpts, parentConf.nodeModule)
}

@@ -52,0 +25,0 @@

// Generated by CoffeeScript 1.10.0
var CouldNotLoad, findModule, makePath;
var CouldNotLoad, findModule, makePath, tryFind;

@@ -12,3 +12,6 @@ makePath = require('./make-path');

try {
return require(fullPath);
return {
instance: require(fullPath),
path: fullPath
};
} catch (error) {

@@ -24,3 +27,3 @@ e = error;

module.exports = function(base, fileName, callers) {
tryFind = function(base, fileName, callers) {
var e, error;

@@ -34,1 +37,9 @@ try {

};
exports.instance = function(base, fileName, callers) {
return tryFind(base, fileName, callers).instance;
};
exports.path = function(base, fileName, callers) {
return tryFind(base, fileName, callers).path;
};

@@ -6,3 +6,3 @@ // Generated by CoffeeScript 1.10.0

findModule = require('./find-module');
findModule = require('./find-module').instance;

@@ -9,0 +9,0 @@ populateDi = require('./populate-di')(findModule);

exports.fromConfig = require('./dist/load-config');
exports.fromNodeConfig = require('./dist/load-node-config');
exports.Container = require('./dist/container');
{
"name": "amend",
"version": "0.3.0-beta-16",
"version": "0.3.0-beta-17",
"description": "Dependency injection module and IoC container.",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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