mem-fs-editor
Advanced tools
Comparing version 7.1.0 to 8.0.0-beta.0
@@ -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 [![Build Status](https://api.travis-ci.org/SBoudrias/mem-fs-editor.svg?branch=master)](https://travis-ci.org/SBoudrias/mem-fs-editor) [![NPM version](https://badge.fury.io/js/mem-fs-editor.svg)](http://badge.fury.io/js/mem-fs-editor) [![Coverage Status](https://coveralls.io/repos/github/SBoudrias/mem-fs-editor/badge.svg)](https://coveralls.io/github/SBoudrias/mem-fs-editor) | ||
# mem-fs-editor [![Node.js CI](https://github.com/SBoudrias/mem-fs-editor/workflows/Node.js%20CI/badge.svg)](https://github.com/SBoudrias/mem-fs-editor/actions?query=workflow%3A%22Node.js+CI%22) [![NPM version](https://badge.fury.io/js/mem-fs-editor.svg)](http://badge.fury.io/js/mem-fs-editor) [![Coverage Status](https://coveralls.io/repos/github/SBoudrias/mem-fs-editor/badge.svg)](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) |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
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
9
326
0
2
+ Addednormalize-path@^3.0.0
+ Added@nodelib/fs.scandir@2.1.5(transitive)
+ Added@nodelib/fs.stat@2.0.5(transitive)
+ Added@nodelib/fs.walk@1.2.8(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addeddir-glob@3.0.1(transitive)
+ Addedfast-glob@3.3.2(transitive)
+ Addedfastq@1.17.1(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedglobby@11.1.0(transitive)
+ Addedignore@5.3.2(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedmultimatch@5.0.0(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addedpath-type@4.0.0(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedqueue-microtask@1.2.3(transitive)
+ Addedreusify@1.0.4(transitive)
+ Addedrun-parallel@1.2.0(transitive)
+ Addedslash@3.0.0(transitive)
+ Addedthrough2@4.0.2(transitive)
+ Addedto-regex-range@5.0.1(transitive)
- Removedglob@^7.1.4
- Removedmkdirp@^1.0.0
- Removedrimraf@^3.0.0
- Removed@mrmlnc/readdir-enhanced@2.2.1(transitive)
- Removed@nodelib/fs.stat@1.1.3(transitive)
- Removed@types/glob@7.2.0(transitive)
- Removed@types/minimatch@5.1.2(transitive)
- Removed@types/node@22.9.1(transitive)
- Removedarr-diff@4.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarr-union@3.1.0(transitive)
- Removedarray-union@1.0.2(transitive)
- Removedarray-uniq@1.0.3(transitive)
- Removedarray-unique@0.3.2(transitive)
- Removedassign-symbols@1.0.0(transitive)
- Removedatob@2.1.2(transitive)
- Removedbase@0.11.2(transitive)
- Removedbraces@2.3.2(transitive)
- Removedcache-base@1.0.1(transitive)
- Removedcall-me-maybe@1.0.2(transitive)
- Removedclass-utils@0.3.6(transitive)
- Removedcollection-visit@1.0.0(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedcopy-descriptor@0.1.1(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefine-property@0.2.51.0.02.0.2(transitive)
- Removeddir-glob@2.2.2(transitive)
- Removedexpand-brackets@2.1.4(transitive)
- Removedextend-shallow@2.0.13.0.2(transitive)
- Removedextglob@2.0.4(transitive)
- Removedfast-glob@2.2.7(transitive)
- Removedfill-range@4.0.0(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfragment-cache@0.2.1(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-value@2.0.6(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-parent@3.1.0(transitive)
- Removedglob-to-regexp@0.3.0(transitive)
- Removedglobby@9.2.0(transitive)
- Removedhas-value@0.3.11.0.0(transitive)
- Removedhas-values@0.1.41.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedignore@4.0.6(transitive)
- Removedinflight@1.0.6(transitive)
- Removedis-accessor-descriptor@1.0.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-data-descriptor@1.0.1(transitive)
- Removedis-descriptor@0.1.71.0.3(transitive)
- Removedis-extendable@0.1.11.0.1(transitive)
- Removedis-glob@3.1.0(transitive)
- Removedis-number@3.0.0(transitive)
- Removedis-plain-object@2.0.4(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedisobject@2.1.03.0.1(transitive)
- Removedkind-of@3.2.24.0.06.0.3(transitive)
- Removedmap-cache@0.2.2(transitive)
- Removedmap-visit@1.0.0(transitive)
- Removedmicromatch@3.1.10(transitive)
- Removedmixin-deep@1.3.2(transitive)
- Removedmkdirp@1.0.4(transitive)
- Removedms@2.0.0(transitive)
- Removedmultimatch@4.0.0(transitive)
- Removednanomatch@1.2.13(transitive)
- Removedobject-copy@0.1.0(transitive)
- Removedobject-visit@1.0.1(transitive)
- Removedobject.pick@1.3.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedpascalcase@0.1.1(transitive)
- Removedpath-dirname@1.0.2(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-type@3.0.0(transitive)
- Removedpify@3.0.04.0.1(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedregex-not@1.0.2(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedret@0.1.15(transitive)
- Removedrimraf@3.0.2(transitive)
- Removedsafe-regex@1.1.0(transitive)
- Removedset-value@2.0.1(transitive)
- Removedslash@2.0.0(transitive)
- Removedsnapdragon@0.8.2(transitive)
- Removedsnapdragon-node@2.1.1(transitive)
- Removedsnapdragon-util@3.0.1(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsplit-string@3.1.0(transitive)
- Removedstatic-extend@0.1.2(transitive)
- Removedthrough2@3.0.2(transitive)
- Removedto-object-path@0.3.0(transitive)
- Removedto-regex@3.0.2(transitive)
- Removedto-regex-range@2.1.1(transitive)
- Removedundici-types@6.19.8(transitive)
- Removedunion-value@1.0.1(transitive)
- Removedunset-value@1.0.0(transitive)
- Removedurix@0.1.0(transitive)
- Removeduse@3.1.1(transitive)
- Removedwrappy@1.0.2(transitive)
Updatedglobby@^11.0.1
Updatedmultimatch@^5.0.0
Updatedthrough2@^4.0.2