mem-fs-editor
Advanced tools
Comparing version
@@ -6,4 +6,3 @@ 'use strict'; | ||
var through = require('through2'); | ||
var mkdirp = require('mkdirp'); | ||
var rimraf = require('rimraf'); | ||
var {pipeline} = require('stream'); | ||
@@ -13,3 +12,3 @@ function write(file) { | ||
if (!fs.existsSync(dir)) { | ||
mkdirp.sync(dir); | ||
fs.mkdirSync(dir, {recursive: true}); | ||
} | ||
@@ -23,3 +22,3 @@ | ||
function remove(file) { | ||
rimraf.sync(file.path); | ||
fs.rmdirSync(file.path, {recursive: true}); | ||
} | ||
@@ -64,10 +63,9 @@ | ||
filters.unshift(modifiedFilter); | ||
filters.push(commitFilter); | ||
stream = filters.reduce(function (stream, filter) { | ||
return stream.pipe(filter); | ||
}, stream); | ||
stream.on('finish', cb); | ||
pipeline( | ||
stream, | ||
modifiedFilter, | ||
...filters, | ||
commitFilter, | ||
(...args) => cb(...args) | ||
); | ||
}; |
@@ -6,3 +6,2 @@ 'use strict'; | ||
var path = require('path'); | ||
var glob = require('glob'); | ||
var globby = require('globby'); | ||
@@ -12,2 +11,3 @@ var multimatch = require('multimatch'); | ||
var util = require('../util'); | ||
var normalize = require('normalize-path'); | ||
@@ -29,3 +29,3 @@ function applyProcessingFunc(process, contents, filename) { | ||
// The store may have a glob path and when we try to copy it will fail because not real file | ||
if (!glob.hasMagic(file.path) && multimatch([file.path], fromGlob).length !== 0) { | ||
if (!globby.hasMagic(normalize(file.path)) && multimatch([file.path], fromGlob).length !== 0) { | ||
storeFiles.push(file.path); | ||
@@ -37,3 +37,3 @@ } | ||
var generateDestination = () => to; | ||
if (Array.isArray(from) || !this.exists(from) || glob.hasMagic(from)) { | ||
if (Array.isArray(from) || !this.exists(from) || globby.hasMagic(normalize(from))) { | ||
assert( | ||
@@ -40,0 +40,0 @@ !this.exists(to) || fs.statSync(to).isDirectory(), |
@@ -6,3 +6,4 @@ 'use strict'; | ||
var commondir = require('commondir'); | ||
var glob = require('glob'); | ||
var globby = require('globby'); | ||
var normalize = require('normalize-path'); | ||
@@ -34,6 +35,8 @@ function notNullOrExclusion(file) { | ||
if (Array.isArray(filePath)) { | ||
return filePath.reduce((memo, pattern) => memo.concat(this.globify(pattern)), []); | ||
return filePath.reduce((memo, pattern) => memo.concat(this.globify(normalize(pattern))), []); | ||
} | ||
if (glob.hasMagic(filePath)) { | ||
filePath = normalize(filePath); | ||
if (globby.hasMagic(filePath)) { | ||
return filePath; | ||
@@ -47,3 +50,3 @@ } | ||
filePath, | ||
path.join(filePath, '**') | ||
normalize(path.join(filePath, '**')) | ||
]; | ||
@@ -58,3 +61,3 @@ } | ||
if (fsStats.isDirectory()) { | ||
return path.join(filePath, '**'); | ||
return normalize(path.join(filePath, '**')); | ||
} | ||
@@ -61,0 +64,0 @@ |
{ | ||
"name": "mem-fs-editor", | ||
"version": "7.1.0", | ||
"version": "8.0.0-beta.0", | ||
"description": "File edition helpers working on top of mem-fs", | ||
@@ -20,9 +20,7 @@ "scripts": { | ||
"ejs": "^3.1.5", | ||
"glob": "^7.1.4", | ||
"globby": "^9.2.0", | ||
"globby": "^11.0.1", | ||
"isbinaryfile": "^4.0.0", | ||
"mkdirp": "^1.0.0", | ||
"multimatch": "^4.0.0", | ||
"rimraf": "^3.0.0", | ||
"through2": "^3.0.2", | ||
"multimatch": "^5.0.0", | ||
"normalize-path": "^3.0.0", | ||
"through2": "^4.0.2", | ||
"vinyl": "^2.2.1" | ||
@@ -45,4 +43,4 @@ }, | ||
"engines": { | ||
"node": ">=10.0.0" | ||
"node": ">=12.10.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# mem-fs-editor [](https://travis-ci.org/SBoudrias/mem-fs-editor) [](http://badge.fury.io/js/mem-fs-editor) [](https://coveralls.io/github/SBoudrias/mem-fs-editor) | ||
# mem-fs-editor [](https://github.com/SBoudrias/mem-fs-editor/actions?query=workflow%3A%22Node.js+CI%22) [](http://badge.fury.io/js/mem-fs-editor) [](https://coveralls.io/github/SBoudrias/mem-fs-editor) | ||
@@ -3,0 +3,0 @@ File edition helpers working on top of [mem-fs](https://github.com/SBoudrias/mem-fs) |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
17610
0.59%9
-18.18%326
0.62%0
-100%2
100%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated