Socket
Socket
Sign inDemoInstall

madge

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

madge - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

2

lib/madge.js

@@ -76,3 +76,3 @@ 'use strict';

if (this.opts.requireConfig) {
mergeTrees(tree, requirejs.getShimDepsFromConfig(this.opts.requireConfig));
mergeTrees(tree, requirejs.getShimDepsFromConfig(this.opts.requireConfig, this.opts.exclude));
}

@@ -79,0 +79,0 @@

@@ -12,11 +12,16 @@ 'use strict';

* @param {String} filename
* @param {String} [exclude]
*/
module.exports.getShimDepsFromConfig = function (filename) {
module.exports.getShimDepsFromConfig = function (filename, exclude) {
var deps = {},
config = parse.findConfig(filename, fs.readFileSync(filename, 'utf8'));
config = parse.findConfig(filename, fs.readFileSync(filename, 'utf8')),
excludeRegex = exclude ? new RegExp(exclude) : false,
isIncluded = function (key) {
return !(excludeRegex && key.match(excludeRegex));
};
if (config.shim) {
Object.keys(config.shim).forEach(function (key) {
Object.keys(config.shim).filter(isIncluded).forEach(function (key) {
if (config.shim[key].deps) {
deps[key] = config.shim[key].deps;
deps[key] = config.shim[key].deps.filter(isIncluded);
} else {

@@ -23,0 +28,0 @@ deps[key] = [];

{
"name": "madge",
"version": "0.3.0",
"version": "0.3.1",
"author": "Patrik Henningsson <patrik.henningsson@gmail.com>",

@@ -5,0 +5,0 @@ "repository": "git://github.com/pahen/node-madge",

@@ -229,2 +229,5 @@ # MaDGe - Module Dependency Graph

## v0.3.1 (June 03, 2014)
Apply exclude to RequireJS shim dependencies (Thanks to Michael White).
## v0.3.0 (May 25, 2014)

@@ -231,0 +234,0 @@ Added support for onParseFile and onAddModule options (Thanks to Brandon Selway).

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