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.0.0 to 2.1.0

5

lib/index.js

@@ -38,4 +38,5 @@ var fs = require('fs'),

bowerDirectory = opts.paths.bowerDirectory ? path.resolve(process.cwd(), opts.paths.bowerDirectory)
: path.resolve(cwd, bowerDirectory || 'bower_components');
bowerDirectory = opts.paths.bowerDirectory ?
path.resolve(process.cwd(), opts.paths.bowerDirectory) :
path.resolve(cwd, bowerDirectory || 'bower_components');

@@ -42,0 +43,0 @@ if (!bowerJson || !fs.existsSync(bowerJson)) {

16

lib/package_collection.js

@@ -65,15 +65,21 @@ var path = require('path'),

var name,
includeDev = this.opts.includeDev || false,
bowerJson = JSON.parse(fs.readFileSync(this.opts.paths.bowerJson, 'utf8')),
devDependencies = bowerJson.devDependencies || {},
dependencies = bowerJson.dependencies || {};
includeDev = includeDev === true ? 'inclusive' : includeDev;
this.overrides = bowerJson.overrides || {};
if (this.opts.includeDev === true && bowerJson.devDependencies) {
for (name in bowerJson.devDependencies) {
dependencies[name] = bowerJson.devDependencies[name];
if (includeDev !== 'exclusive') {
for (name in dependencies) {
this.add(name, path.join(this.opts.paths.bowerDirectory, '/', name));
}
}
for (name in dependencies) {
this.add(name, path.join(this.opts.paths.bowerDirectory, '/', name));
if (includeDev !== false) {
for (name in devDependencies) {
this.add(name, path.join(this.opts.paths.bowerDirectory, '/', name));
}
}

@@ -80,0 +86,0 @@ },

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

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

@@ -185,4 +185,6 @@ main-bower-files

Type: `boolean` Default: `false`
Set this to true if you want to include your dev dependencies.
Type: `mixed` Default: `false`
You can include your devDependencies in two ways:
* Set this option to `inclusive` or true to add the devDependencies to your dependencies
* or use `exclusive` to exclude your dependencies

@@ -189,0 +191,0 @@ ### filter

@@ -29,3 +29,3 @@ var mainBowerFiles = require('../'),

expectedFiles.should.be.eql(srcFiles);
srcFiles.should.be.eql(expectedFiles);

@@ -132,2 +132,8 @@ if (done) {

it('should get only devDependencies', function(done) {
expect([
'/fixtures/includeDev/includeDev.js'
]).fromConfig('/_includedev_bower.json', { includeDev: 'exclusive' }).when(done);
});
it('should get devDependencies and ignore missing dependencies', function(done) {

@@ -134,0 +140,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