Socket
Socket
Sign inDemoInstall

deglob

Package Overview
Dependencies
Maintainers
7
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deglob - npm Package Compare versions

Comparing version 1.1.2 to 2.0.0

15

index.js
module.exports = deglob
var extend = require('xtend')
var findRoot = require('find-root')

@@ -14,9 +13,2 @@ var fs = require('fs')

var DEFAULT_OPTIONS = {
useGitIgnore: true,
usePackageJson: true,
configKey: 'config',
gitIgnoreFile: '.gitignore'
}
function deglob (files, opts, cb) {

@@ -66,3 +58,8 @@ if (typeof opts === 'function') return deglob(files, null, opts)

if (!opts) opts = {}
opts = extend(DEFAULT_OPTIONS, opts)
opts = Object.assign({
useGitIgnore: true,
usePackageJson: true,
configKey: 'config',
gitIgnoreFile: '.gitignore'
}, opts)

@@ -69,0 +66,0 @@ if (!opts.cwd) opts.cwd = process.cwd()

{
"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": "1.1.2",
"version": "2.0.0",
"author": "Dan Flettre <fletd01@yahoo.com>",

@@ -41,5 +41,4 @@ "bugs": {

"run-parallel": "^1.1.2",
"uniq": "^1.0.1",
"xtend": "^4.0.0"
"uniq": "^1.0.1"
}
}

11

test/index.js
var path = require('path')
var test = require('tape')
var extend = require('xtend')
var deglob = require('../')

@@ -30,3 +29,3 @@

globs: '*.txt',
opts: extend(opts),
opts: Object.assign({}, opts),
expectedFiles: ['blah.txt']

@@ -37,3 +36,3 @@ },

globs: '*.txt',
opts: extend(opts, {useGitIgnore: false}),
opts: Object.assign({}, opts, {useGitIgnore: false}),
expectedFiles: [

@@ -46,3 +45,3 @@ 'ignored-by-git.txt',

globs: '*.txt',
opts: extend(opts, {useGitIgnore: false, usePackageJson: false}),
opts: Object.assign({}, opts, {useGitIgnore: false, usePackageJson: false}),
expectedFiles: [

@@ -56,3 +55,3 @@ 'ignored-by-git.txt',

globs: ['*.txt', '*.json'],
opts: extend(opts),
opts: Object.assign({}, opts),
expectedFiles: ['blah.txt', 'package.json']

@@ -63,5 +62,5 @@ },

globs: ['*.txt'],
opts: extend(opts, {configKey: 'custom-ignore-blah'}),
opts: Object.assign({}, opts, {configKey: 'custom-ignore-blah'}),
expectedFiles: ['ignored-by-package-json.txt']
}
]

Sorry, the diff of this file is not supported yet

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