Socket
Socket
Sign inDemoInstall

mem-fs-editor

Package Overview
Dependencies
Maintainers
2
Versions
52
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 11.0.0 to 11.0.1

9

dist/actions/copy.js

@@ -14,3 +14,8 @@ import assert from 'assert';

to = path.resolve(to);
options = options || {};
options = options ?? {};
const { fromBasePath } = options;
if (fromBasePath) {
const applyBasePath = (from) => (path.isAbsolute(from) ? from : path.resolve(fromBasePath, from));
from = Array.isArray(from) ? from.map(applyBasePath) : applyBasePath(from);
}
let files = [];

@@ -40,3 +45,3 @@ if (options.noGlob) {

const processDestinationPath = options.processDestinationPath || ((path) => path);
const root = options.fromBasePath || getCommonPath(from);
const root = fromBasePath ?? getCommonPath(from);
generateDestination = (filepath) => {

@@ -43,0 +48,0 @@ const toFile = path.relative(root, filepath);

@@ -29,3 +29,3 @@ import ejs from 'ejs';

if (Array.isArray(filePath)) {
return filePath.reduce((memo, pattern) => memo.concat(globify(normalize(pattern))), []);
return filePath.reduce((memo, pattern) => memo.concat(globify(pattern)), []);
}

@@ -32,0 +32,0 @@ filePath = normalize(filePath);

{
"name": "mem-fs-editor",
"version": "11.0.0",
"version": "11.0.1",
"description": "File edition helpers working on top of mem-fs",

@@ -41,5 +41,5 @@ "type": "module",

"deep-extend": "^0.6.0",
"ejs": "^3.1.9",
"ejs": "^3.1.10",
"globby": "^13.2.2",
"isbinaryfile": "^5.0.0",
"isbinaryfile": "5.0.2",
"minimatch": "^9.0.3",

@@ -46,0 +46,0 @@ "multimatch": "^6.0.0",

@@ -13,8 +13,9 @@ # mem-fs-editor

import { create as createMemFs } from 'mem-fs';
import editor from 'mem-fs-editor';
import { create as createEditor } from 'mem-fs-editor';
const store = createMemFs();
const fs = editor.create(store);
const fs = createEditor(store);
fs.write('somefile.js', 'var a = 1;');
await fs.commit()
```

@@ -21,0 +22,0 @@

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