Socket
Socket
Sign inDemoInstall

it-glob

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

it-glob - npm Package Compare versions

Comparing version 0.0.14 to 1.0.0

10

index.js

@@ -59,13 +59,13 @@ 'use strict'

if (options.ignore && match && options.ignore.reduce((acc, curr) => {
return acc || minimatch(relativeEntryPath, curr, options)
}, false)) {
const isDirectory = entry.isDirectory()
if (isDirectory && options.nodir) {
match = false
}
if (match && !(entry.isDirectory() && options.nodir)) {
if (match) {
yield options.absolute ? absoluteEntryPath : relativeEntryPath
}
if (entry.isDirectory()) {
if (isDirectory) {
yield * _glob(base, relativeEntryPath, pattern, options)

@@ -72,0 +72,0 @@ }

{
"name": "it-glob",
"version": "0.0.14",
"version": "1.0.0",
"description": "Async iterable filename pattern matcher",

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

"types": "dist/index.d.ts",
"gitHead": "db98c14fcd41e4f17385c31d355f76f9050fa985"
"gitHead": "c902ba944194fe330a33ac447435114c5397072d"
}

@@ -21,5 +21,2 @@ # it-glob

const options = {
ignore: [
'glob' // glob patterns to ignore
],
cwd // defaults to process.cwd

@@ -36,1 +33,3 @@ absolute // return absolute paths, defaults to false

```
See the [minimatch docs](https://www.npmjs.com/package/minimatch#options) for the full list of options.

@@ -31,8 +31,3 @@ const test = require('ava')

test('it should ignore files', async t => {
const files = await all(glob('.', '**/*', {
ignore: [
'*/index.js',
'**/node_modules/**'
]
}))
const files = await all(glob('.', '**/*!(*/index.js|**/node_modules/**)'))

@@ -43,8 +38,3 @@ t.falsy(files.includes('test/index.js'))

test('it should ignore files from absolute directory', async t => {
const files = await all(glob(__dirname, '**/*', {
ignore: [
'test/index.js',
'**/node_modules/**'
]
}))
const files = await all(glob(__dirname, '**/*!(test/index.js|)**/node_modules/**'))

@@ -82,7 +72,8 @@ t.falsy(files.includes(path.resolve(__dirname, 'index.js')))

const files = await all(glob(__dirname, 'node_modules/**/*', {
nodir: true
nodir: true,
dot: true
}))
t.falsy(files.includes('node_modules/it-all'))
t.truthy(files.includes('node_modules/it-all/package.json'))
t.falsy(files.includes('node_modules/.bin'))
t.truthy(files.includes('node_modules/.bin/ava'))
})
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