Comparing version 2.0.0 to 2.1.0
11
index.js
@@ -88,7 +88,8 @@ module.exports = deglob | ||
if (root) { | ||
var packageOpts = pkgConfig(opts.configKey, { root: false, cwd: opts.cwd }) | ||
if (packageOpts && packageOpts.ignore) { | ||
// Use ignore patterns from package.json ("config.ignore" property) | ||
addIgnorePattern(packageOpts.ignore) | ||
if (opts.usePackageJson) { | ||
var packageOpts = pkgConfig(opts.configKey, { root: false, cwd: opts.cwd }) | ||
if (packageOpts && packageOpts.ignore) { | ||
// Use ignore patterns from package.json ("config.ignore" property) | ||
addIgnorePattern(packageOpts.ignore) | ||
} | ||
} | ||
@@ -95,0 +96,0 @@ |
{ | ||
"name": "deglob", | ||
"description": "Take a list of glob patterns and return an array of file locations, respecting `.gitignore` and allowing for ignore patterns via `package.json`.", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"author": "Dan Flettre <fletd01@yahoo.com>", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -27,3 +27,3 @@ var path = require('path') | ||
{ | ||
name: '*.txt useGitIgnore: true, usePackageJson: true', | ||
name: '*.txt useGitIgnore: default, usePackageJson: default', | ||
globs: '*.txt', | ||
@@ -34,3 +34,3 @@ opts: Object.assign({}, opts), | ||
{ | ||
name: '*.txt useGitIgnore: false, usePackageJson: true', | ||
name: '*.txt useGitIgnore: false, usePackageJson: default', | ||
globs: '*.txt', | ||
@@ -52,9 +52,12 @@ opts: Object.assign({}, opts, {useGitIgnore: false}), | ||
{ | ||
name: '*.txt and *.json useGitIgnore: true, usePackageJson: false', | ||
name: '*.txt and *.json useGitIgnore: default, usePackageJson: false', | ||
globs: ['*.txt', '*.json'], | ||
opts: Object.assign({}, opts), | ||
expectedFiles: ['blah.txt', 'package.json'] | ||
opts: Object.assign({}, opts, {usePackageJson: false}), | ||
expectedFiles: [ | ||
'ignored-by-package-json.txt', | ||
'blah.txt', | ||
'package.json'] | ||
}, | ||
{ | ||
name: '*.txt and *.json useGitIgnore: true, usePackageJson: true, configKey: custom-ignore-blah', | ||
name: '*.txt and *.json useGitIgnore: default, usePackageJson: default, configKey: custom-ignore-blah', | ||
globs: ['*.txt'], | ||
@@ -61,0 +64,0 @@ opts: Object.assign({}, opts, {configKey: 'custom-ignore-blah'}), |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12980
173