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

main-bower-files

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

main-bower-files - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

test/_includeSelf_bower.json

1

lib/index.js

@@ -52,2 +52,3 @@ var fs = require('fs'),

opts.includeDev = opts.includeDev || false;
opts.includeSelf = opts.includeSelf || false;
opts.paths = {

@@ -54,0 +55,0 @@ bowerJson: bowerJson,

@@ -52,2 +52,6 @@ var path = require('path'),

opts.path = path;
if (path.indexOf(this.opts.paths.bowerDirectory) === -1) {
opts.main = name;
}
opts.path = path;

@@ -67,5 +71,7 @@ this._packages[name] = new Package(opts, this);

includeDev = this.opts.includeDev || false,
includeSelf = this.opts.includeSelf || false,
bowerJson = JSON.parse(fs.readFileSync(this.opts.paths.bowerJson, 'utf8')),
devDependencies = bowerJson.devDependencies || {},
dependencies = bowerJson.dependencies || {};
dependencies = bowerJson.dependencies || {},
main = bowerJson.main || {};

@@ -87,2 +93,6 @@ includeDev = includeDev === true ? 'inclusive' : includeDev;

}
if (includeSelf !== false) {
this.add(main, path.join(path.dirname(this.opts.paths.bowerJson)));
}
},

@@ -89,0 +99,0 @@

4

lib/package.js

@@ -47,3 +47,3 @@ var path = require('path'),

data = paths.reduce(function(prev, curr) {
if (prev !== null) {
if (prev !== null && typeof prev.main !== 'undefined') {
return prev;

@@ -85,3 +85,3 @@ }

'Package\t\t',
'overriding depedependencies\t',
'overriding dependencies\t',
this.name,

@@ -88,0 +88,0 @@ data.dependencies);

{
"name": "main-bower-files",
"version": "2.1.0",
"version": "2.2.0",
"description": "Get main files from your installed bower packages.",

@@ -26,3 +26,3 @@ "main": "index.js",

"should": "^4.0.4",
"mocha": "^1.20.1"
"mocha": "^2.0.1"
},

@@ -29,0 +29,0 @@ "dependencies": {

@@ -20,2 +20,3 @@ main-bower-files

- [includeDev](#includedev)
- [includeDev](#includeself)
- [filter](#filter)

@@ -191,2 +192,7 @@

#### includeSelf
Type: `boolean` Default: `false`
Set this to true to add the main files to your dependencies
### filter

@@ -193,0 +199,0 @@ Type: `RegExp` or `function` Default: `null`

@@ -143,2 +143,8 @@ var mainBowerFiles = require('../'),

it('should get main file', function(done) {
expect([
'main.js'
]).fromConfig('/_includeSelf_bower.json', { includeSelf: true }).when(done);
});
it('should not load any deeper dependencies', function(done) {

@@ -145,0 +151,0 @@ expect([

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