Comparing version 1.0.0 to 1.0.1
@@ -0,0 +0,0 @@ import { IEntry } from 'readdir-enhanced'; |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const task = require("./utils/task"); | ||
@@ -42,3 +43,2 @@ const readdir = require("./providers/readdir"); | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = async; | ||
@@ -45,0 +45,0 @@ function sync(source, options) { |
@@ -0,0 +0,0 @@ import * as readdir from 'readdir-enhanced'; |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const fs = require("fs"); | ||
@@ -48,3 +49,3 @@ const bglob = require("bash-glob"); | ||
const cb = options.transform ? options.transform : (entry) => entry; | ||
const files = bglob.sync(patterns, { dotglob: true }); | ||
const files = bglob.sync(patterns, { cwd: options.cwd, dotglob: true }); | ||
const entries = filterByNegativePatterns(files, task.patterns); | ||
@@ -51,0 +52,0 @@ if (options.stats || options.onlyFiles || options.onlyDirs) { |
@@ -0,0 +0,0 @@ import * as readdir from 'readdir-enhanced'; |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const path = require("path"); | ||
const readdir = require("readdir-enhanced"); | ||
const micromatch = require("micromatch"); | ||
function isEnoentCodeError(err) { | ||
return err.code === 'ENOENT'; | ||
} | ||
function filter(entry, patterns, options) { | ||
@@ -15,3 +19,3 @@ if ((options.onlyFiles && !entry.isFile()) || (options.onlyDirs && !entry.isDirectory())) { | ||
function async(task, options) { | ||
const cwd = path.join(options.cwd, task.base); | ||
const cwd = path.resolve(options.cwd, task.base); | ||
const entries = []; | ||
@@ -28,3 +32,3 @@ const api = options.stats ? readdir.readdirStreamStat : readdir.stream; | ||
stream.on('data', (entry) => entries.push(cb(entry))); | ||
stream.on('error', (err) => reject(err)); | ||
stream.on('error', (err) => isEnoentCodeError(err) ? resolve([]) : reject(err)); | ||
stream.on('end', () => resolve(entries)); | ||
@@ -35,13 +39,21 @@ }); | ||
function sync(task, options) { | ||
const cwd = path.join(options.cwd, task.base); | ||
const api = options.stats ? readdir.readdirSyncStat : readdir.sync; | ||
const cb = options.transform ? options.transform : (entry) => entry; | ||
const entries = api(cwd, { | ||
filter: (entry) => filter(entry, task.patterns, options), | ||
basePath: task.base === '.' ? '' : task.base, | ||
deep: options.deep, | ||
sep: '/' | ||
}); | ||
return options.transform ? entries.map(cb) : entries; | ||
const cwd = path.resolve(options.cwd, task.base); | ||
try { | ||
const api = options.stats ? readdir.readdirSyncStat : readdir.sync; | ||
const cb = options.transform ? options.transform : (entry) => entry; | ||
const entries = api(cwd, { | ||
filter: (entry) => filter(entry, task.patterns, options), | ||
basePath: task.base === '.' ? '' : task.base, | ||
deep: options.deep, | ||
sep: '/' | ||
}); | ||
return options.transform ? entries.map(cb) : entries; | ||
} | ||
catch (err) { | ||
if (isEnoentCodeError(err)) { | ||
return []; | ||
} | ||
throw err; | ||
} | ||
} | ||
exports.sync = sync; |
/// <reference types="node" /> | ||
import * as fs from 'fs'; | ||
export declare function statFile(filepath: string): Promise<fs.Stats>; |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const fs = require("fs"); | ||
@@ -3,0 +4,0 @@ function statFile(filepath) { |
export declare function isNegative(pattern: string): boolean; | ||
export declare function getNegativeAsPositive(patterns: string[]): string[]; |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function isNegative(pattern) { | ||
@@ -3,0 +4,0 @@ return pattern[0] === '!'; |
@@ -0,0 +0,0 @@ import { IOptions } from '../fglob'; |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const globParent = require("glob-parent"); | ||
@@ -3,0 +4,0 @@ function generateTasks(patterns, options) { |
{ | ||
"name": "fast-glob", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Is a faster `node-glob` alternative", | ||
@@ -23,18 +23,18 @@ "license": "MIT", | ||
"@types/micromatch": "^2.3.29", | ||
"@types/mocha": "^2.2.34", | ||
"@types/node": "^6.0.52", | ||
"@types/mocha": "^2.2.41", | ||
"@types/node": "^7.0.27", | ||
"@types/rimraf": "0.0.28", | ||
"fs-extra": "^1.0.0", | ||
"glob": "^7.1.1", | ||
"mocha": "^3.2.0", | ||
"rimraf": "^2.5.4", | ||
"tslint": "^4.2.0", | ||
"tslint-config-xo": "^1.0.0", | ||
"typescript": "^2.1.4" | ||
"fs-extra": "^3.0.1", | ||
"glob": "^7.1.2", | ||
"mocha": "^3.4.2", | ||
"rimraf": "^2.6.1", | ||
"tslint": "^5.4.2", | ||
"tslint-config-xo": "^1.2.0", | ||
"typescript": "^2.3.4" | ||
}, | ||
"dependencies": { | ||
"bash-glob": "^0.1.1", | ||
"bash-glob": "^1.0.1", | ||
"glob-parent": "^3.1.0", | ||
"micromatch": "^2.3.11", | ||
"readdir-enhanced": "^1.4.5" | ||
"micromatch": "^3.0.3", | ||
"readdir-enhanced": "^1.5.2" | ||
}, | ||
@@ -41,0 +41,0 @@ "scripts": { |
@@ -16,3 +16,3 @@ # fast-glob | ||
* You can get not only file paths, but also their `fs.Stats` objects with the additional `path` property. | ||
* You can transform file path or `fs.Stats` object before sending it to an array (only for async). | ||
* You can transform file path or `fs.Stats` object before sending it to an array. | ||
@@ -19,0 +19,0 @@ ## Usage |
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
18570
21
288
+ Addedarr-diff@4.0.0(transitive)
+ Addedarr-union@3.1.0(transitive)
+ Addedarray-unique@0.3.2(transitive)
+ Addedassign-symbols@1.0.0(transitive)
+ Addedatob@2.1.2(transitive)
+ Addedbase@0.11.2(transitive)
+ Addedbash-glob@1.0.2(transitive)
+ Addedbash-path@1.0.3(transitive)
+ Addedbraces@2.3.2(transitive)
+ Addedcache-base@1.0.1(transitive)
+ Addedclass-utils@0.3.6(transitive)
+ Addedcollection-visit@1.0.0(transitive)
+ Addedcopy-descriptor@0.1.1(transitive)
+ Addedcross-spawn@5.1.0(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addeddefine-property@0.2.51.0.02.0.2(transitive)
+ Addedexpand-brackets@2.1.4(transitive)
+ Addedextend-shallow@3.0.2(transitive)
+ Addedextglob@2.0.4(transitive)
+ Addedfill-range@4.0.0(transitive)
+ Addedfragment-cache@0.2.1(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-value@2.0.6(transitive)
+ Addedhas-value@0.3.11.0.0(transitive)
+ Addedhas-values@0.1.41.0.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedis-accessor-descriptor@1.0.1(transitive)
+ Addedis-data-descriptor@1.0.1(transitive)
+ Addedis-descriptor@0.1.71.0.3(transitive)
+ Addedis-extendable@1.0.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@3.0.0(transitive)
+ Addedis-plain-object@2.0.4(transitive)
+ Addedis-windows@1.0.2(transitive)
+ Addedisobject@3.0.1(transitive)
+ Addedkind-of@4.0.0(transitive)
+ Addedmap-cache@0.2.2(transitive)
+ Addedmap-visit@1.0.0(transitive)
+ Addedmicromatch@3.1.10(transitive)
+ Addedmixin-deep@1.3.2(transitive)
+ Addedms@2.0.0(transitive)
+ Addednanomatch@1.2.13(transitive)
+ Addedobject-copy@0.1.0(transitive)
+ Addedobject-visit@1.0.1(transitive)
+ Addedobject.pick@1.3.0(transitive)
+ Addedpascalcase@0.1.1(transitive)
+ Addedposix-character-classes@0.1.1(transitive)
+ Addedregex-not@1.0.2(transitive)
+ Addedresolve-url@0.2.1(transitive)
+ Addedret@0.1.15(transitive)
+ Addedsafe-regex@1.1.0(transitive)
+ Addedset-value@2.0.1(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsnapdragon@0.8.2(transitive)
+ Addedsnapdragon-node@2.1.1(transitive)
+ Addedsnapdragon-util@3.0.1(transitive)
+ Addedsource-map@0.5.7(transitive)
+ Addedsource-map-resolve@0.5.3(transitive)
+ Addedsource-map-url@0.4.1(transitive)
+ Addedsplit-string@3.1.0(transitive)
+ Addedstatic-extend@0.1.2(transitive)
+ Addedto-object-path@0.3.0(transitive)
+ Addedto-regex@3.0.2(transitive)
+ Addedto-regex-range@2.1.1(transitive)
+ Addedunion-value@1.0.1(transitive)
+ Addedunset-value@1.0.0(transitive)
+ Addedurix@0.1.0(transitive)
+ Addeduse@3.1.1(transitive)
- Removedarr-diff@2.0.0(transitive)
- Removedarray-unique@0.2.1(transitive)
- Removedbash-glob@0.1.1(transitive)
- Removedbraces@1.8.5(transitive)
- Removedcross-spawn@4.0.2(transitive)
- Removedexpand-brackets@0.1.5(transitive)
- Removedexpand-range@1.8.2(transitive)
- Removedextglob@0.3.2(transitive)
- Removedfilename-regex@2.0.1(transitive)
- Removedfill-range@2.2.4(transitive)
- Removedfor-own@0.1.5(transitive)
- Removedfs-exists-sync@0.1.0(transitive)
- Removedglob-base@0.3.0(transitive)
- Removedglob-parent@2.0.0(transitive)
- Removedis-dotfile@1.0.3(transitive)
- Removedis-equal-shallow@0.1.3(transitive)
- Removedis-extglob@1.0.0(transitive)
- Removedis-glob@2.0.1(transitive)
- Removedis-number@2.1.04.0.0(transitive)
- Removedis-posix-bracket@0.1.1(transitive)
- Removedis-primitive@2.0.0(transitive)
- Removedmath-random@1.0.4(transitive)
- Removedmicromatch@2.3.11(transitive)
- Removednormalize-path@2.1.1(transitive)
- Removedobject.omit@2.0.1(transitive)
- Removedparse-glob@3.0.4(transitive)
- Removedpreserve@0.2.0(transitive)
- Removedrandomatic@3.1.1(transitive)
- Removedregex-cache@0.4.4(transitive)
- Removedremove-trailing-separator@1.1.0(transitive)
Updatedbash-glob@^1.0.1
Updatedmicromatch@^3.0.3
Updatedreaddir-enhanced@^1.5.2