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

fs-merger

Package Overview
Dependencies
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-merger - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

7

dist/index.js

@@ -52,2 +52,3 @@ "use strict";

}
let fullPath = relativePath;
// at is a spcfical property exist in FSMerge which takes number as input do not perform path operation on it.

@@ -60,3 +61,2 @@ if (propertyName == 'at' || !path.isAbsolute(relativePath)) {

let { _dirList } = this;
let fullPath = relativePath;
for (let i = _dirList.length - 1; i > -1; i--) {

@@ -69,7 +69,4 @@ let { root } = this.PREFIXINDEXMAP[i];

}
return target[propertyName](fullPath, ...fsArguments);
}
else {
throw new Error(`Relative path is expected, path ${relativePath} is an absolute path. inputPath gets prefixed to the reltivePath provided.`);
}
return target[propertyName](fullPath, ...fsArguments);
}

@@ -76,0 +73,0 @@ class FSMerger {

{
"name": "fs-merger",
"version": "3.0.1",
"version": "3.0.2",
"description": "Reads files from a real location",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -70,2 +70,3 @@ "use strict";

}
let fullPath = relativePath

@@ -79,3 +80,2 @@ // at is a spcfical property exist in FSMerge which takes number as input do not perform path operation on it.

let { _dirList } = this;
let fullPath = relativePath;
for (let i=_dirList.length-1; i > -1; i--) {

@@ -88,6 +88,4 @@ let { root } = this.PREFIXINDEXMAP[i];

}
return target[propertyName](fullPath, ...fsArguments);
} else {
throw new Error(`Relative path is expected, path ${relativePath} is an absolute path. inputPath gets prefixed to the reltivePath provided.`);
}
return target[propertyName](fullPath, ...fsArguments);
}

@@ -94,0 +92,0 @@

@@ -232,7 +232,14 @@ "use strict";

it('absolute path throws error', function() {
it('absolute path is accepted', function() {
let filepath = `${__dirname}/../fixtures/test-1`;
expect( ()=>{fsMerger.fs.existsSync(filepath)}).to.throw(`Relative path is expected, path ${filepath} is an absolute path. inputPath gets prefixed to the reltivePath provided.`);
expect(fsMerger.fs.existsSync(filepath)).to.be.true;
});
it('absolute path is accepted only with allowed operations', function() {
let filepath = `${__dirname}/../fixtures/test-1`;
expect(()=>{
fsMerger.fs.rmdirSync(filepath);
}).to.throw(`Operation rmdirSync is not allowed with FSMerger.fs. Allowed operations are readFileSync,existsSync,lstatSync,statSync,readdirSync,readdir,readFileMeta,entries,at`);
});
it('writeFileSync operation must throw error', function () {

@@ -239,0 +246,0 @@ let fsMerger = new FSMerge(['fixtures/test-1']);

Sorry, the diff of this file is not supported yet

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