Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mem-fs-editor

Package Overview
Dependencies
Maintainers
2
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mem-fs-editor - npm Package Compare versions

Comparing version 9.2.0 to 9.3.0

8

lib/actions/dump.js

@@ -5,2 +5,3 @@ 'use strict';

const normalize = require('normalize-path');
const minimatch = require('minimatch');

@@ -10,4 +11,9 @@ const {hasClearedState, hasState, STATE, STATE_CLEARED} = require('../state');

module.exports = function (cwd = process.cwd(), filter = file => hasClearedState(file) || hasState(file)) {
if (typeof filter === 'string') {
const pattern = filter;
filter = file => minimatch(file.path, pattern);
}
return Object.fromEntries(
this.store.all().filter(file => filter(file)).map(file => {
this.store.all().filter(file => filter(file, cwd)).map(file => {
const filePath = normalize(cwd ? path.relative(cwd, file.path) : file.path);

@@ -14,0 +20,0 @@ const fileDump = {

3

package.json
{
"name": "mem-fs-editor",
"version": "9.2.0",
"version": "9.3.0",
"description": "File edition helpers working on top of mem-fs",

@@ -24,2 +24,3 @@ "scripts": {

"isbinaryfile": "^4.0.8",
"minimatch": "^3.0.4",
"multimatch": "^5.0.0",

@@ -26,0 +27,0 @@ "normalize-path": "^3.0.0",

@@ -145,1 +145,7 @@ # 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)

`callback` is called once the files are updated on disk.
### `#dump([cwd,] [filter])`
Dump files to compare expected result.
Provide a `cwd` for relative path. Allows to omit temporary path.
Provide a `filter` function or glob to focus on specific files.
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