Comparing version 0.0.8 to 0.0.9
27
index.js
'use strict' | ||
// @ts-ignore | ||
const fs = require('fs-extra') | ||
@@ -7,2 +8,21 @@ const path = require('path') | ||
/** | ||
* @typedef {string} Glob | ||
* @typedef {Object} OptionsExt | ||
* @property {Glob[]} [ignore] - Glob patterns to ignore | ||
* @property {string} [cwd=process.cwd()] | ||
* @property {boolean} [absolute=false] - If true produces absolute paths | ||
* @property {boolean} [nodir] - If true yields file paths and skip directories | ||
* | ||
* @typedef {OptionsExt & minimatch.IOptions} Options | ||
*/ | ||
/** | ||
* Async iterable filename pattern matcher | ||
* | ||
* @param {string} dir | ||
* @param {string} pattern | ||
* @param {Options} [options] | ||
* @returns {AsyncIterable<string>} | ||
*/ | ||
module.exports = async function * glob (dir, pattern, options = {}) { | ||
@@ -27,2 +47,9 @@ const absoluteDir = path.resolve(dir) | ||
/** | ||
* @param {string} base | ||
* @param {string} dir | ||
* @param {Glob} pattern | ||
* @param {Options} options | ||
* @returns {AsyncIterable<string>} | ||
*/ | ||
async function * _glob (base, dir, pattern, options) { | ||
@@ -29,0 +56,0 @@ for await (const entry of await fs.readdir(path.join(base, dir))) { |
{ | ||
"name": "it-glob", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Async iterable filename pattern matcher", | ||
@@ -13,3 +13,6 @@ "main": "index.js", | ||
"coverage": "nyc --reporter html --reporter lcov ava", | ||
"clean": "rm -rf .nyc_output coverage" | ||
"clean": "rm -rf .nyc_output coverage dist", | ||
"check": "tsc --noEmit", | ||
"build": "npm run build:types", | ||
"build:types": "tsc --emitDeclarationOnly --declarationDir dist" | ||
}, | ||
@@ -19,10 +22,11 @@ "author": "Alex Potsides <alex@achingbrain.net>", | ||
"dependencies": { | ||
"fs-extra": "^8.1.0", | ||
"fs-extra": "^9.0.1", | ||
"minimatch": "^3.0.4" | ||
}, | ||
"devDependencies": { | ||
"ava": "^2.4.0", | ||
"it-all": "^1.0.2", | ||
"nyc": "^14.0.0", | ||
"standard": "^14.3.1" | ||
"ava": "^3.12.1", | ||
"it-all": "^1.0.3", | ||
"nyc": "^15.1.0", | ||
"standard": "^14.3.1", | ||
"typescript": "^4.0.2" | ||
}, | ||
@@ -32,3 +36,11 @@ "browser": { | ||
}, | ||
"gitHead": "faf5c823bffd25e888b9c0353aed30efa5cf508d" | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
".", | ||
"dist/*" | ||
] | ||
} | ||
}, | ||
"gitHead": "61b1da83cade51bd7bf217966a3eddaf35d2a76b" | ||
} |
@@ -1,5 +0,5 @@ | ||
import test from 'ava' | ||
import all from 'it-all' | ||
import glob from '.' | ||
import path from 'path' | ||
const test = require('ava') | ||
const all = require('it-all') | ||
const glob = require('.') | ||
const path = require('path') | ||
@@ -6,0 +6,0 @@ test('it should match file', async t => { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
6191
5
133
0
5
+ Addedat-least-node@1.0.0(transitive)
+ Addedfs-extra@9.1.0(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addeduniversalify@2.0.1(transitive)
- Removedfs-extra@8.1.0(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removeduniversalify@0.1.2(transitive)
Updatedfs-extra@^9.0.1