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

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.1.1 to 0.1.2

.jshintrc

36

lib/parse/amd.js

@@ -10,2 +10,3 @@ 'use strict';

parse = require('./parse'),
resolve = require('resolve'),
colors = require('colors'),

@@ -29,2 +30,22 @@ Base = require('./base');

/**
* Resolve the given `id` to a filename.
* @param {String} dir
* @param {String} id
* @return {String}
*/
AMD.prototype.resolve = function (dir, id) {
try {
return resolve.sync(id, {
basedir: dir
});
} catch (e) {
if (this.opts.breakOnError) {
console.log(String('\nError while resolving module from: ' + id).red);
throw e;
}
return id;
}
};
/**
* Normalize a module file path and return a proper identificator.

@@ -72,4 +93,15 @@ * @param {String} filename

parse.findDependencies(filename, src).filter(function (id) {
return id !== 'require';
}).filter(function (id) {
return id !== 'require' && id !== 'exports' && id !== 'module';
}).map(function (id) {
// Only resolve relative module identifiers (if the first term is "." or "..")
if (id.charAt(0) !== '.') {
return id;
}
var depFilename = this.resolve(path.dirname(filename), id);
if (depFilename) {
return this.normalize(depFilename);
}
}, this).filter(function (id) {
if (!this.isExcluded(id) && dependencies.indexOf(id) < 0) {

@@ -76,0 +108,0 @@ dependencies.push(id);

4

lib/parse/base.js

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

/**
* Resolves all paths in `sources`and ensure we have a absolute path.
* Resolves all paths in `sources` and ensure we have a absolute path.
* @param {Array} sources

@@ -118,3 +118,3 @@ * @return {Array}

}
return src;

@@ -121,0 +121,0 @@ };

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

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

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

## v0.1.2 (November 15, 2012)
Relative AMD module identifiers (if the first term is "." or "..") are now resolved.
## v0.1.1 (September 3, 2012)

@@ -137,0 +140,0 @@ Tweaked circular dependency path output.

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