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

fs-merger

Package Overview
Dependencies
Maintainers
1
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 1.0.4 to 1.0.5

appveyor.yml

9

index.js

@@ -18,3 +18,3 @@ "use strict";

return {
root: root,
root: path.normalize(root),
prefix: tree.prefix || prefix,

@@ -62,6 +62,7 @@ getDestinationPath: tree.getDestinationPath || getDestinationPath

let { basePath } = options || {};
basePath = basePath && path.normalize(basePath);
if (this.MAP[basePath]) {
let { root, prefix, getDestinationPath } = this.MAP[basePath];
return {
path: root + '/' + filePath,
path: path.join(root, filePath),
prefix: prefix,

@@ -75,3 +76,3 @@ getDestinationPath: getDestinationPath

return {
path: root + '/' + filePath,
path: path.join(root, filePath),
prefix: prefix,

@@ -81,3 +82,3 @@ getDestinationPath: getDestinationPath

}
let fullPath = root + '/' + filePath;
let fullPath = path.join(root, filePath);
if(fs.existsSync(fullPath)) {

@@ -84,0 +85,0 @@ result = {

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

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

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

const rm = require('rimraf').sync;
const path = require('path');

@@ -78,3 +79,3 @@ describe('fs-reader', function () {

expect(meta).to.eql({
path: 'fixtures/test-1/x.txt',
path: path.normalize('fixtures/test-1/x.txt'),
prefix: '',

@@ -87,3 +88,3 @@ getDestinationPath: undefined,

expect(meta).to.eql({
path: 'fixtures/test-2/c.txt',
path: path.normalize('fixtures/test-2/c.txt'),
prefix: 'test-2',

@@ -96,3 +97,3 @@ getDestinationPath: undefined,

expect(meta).to.eql({
path: 'fixtures/test-3/d.txt',
path: path.normalize('fixtures/test-3/d.txt'),
prefix: '',

@@ -102,2 +103,10 @@ getDestinationPath: undefined,

});
it('correct meta when basePath is provided', function () {
let meta = fs.readFileMeta('d.txt', { basePath: 'fixtures/test-3'})
expect(meta).to.eql({
path: path.normalize('fixtures/test-3/d.txt'),
prefix: '',
getDestinationPath: undefined,
})
});
});

@@ -104,0 +113,0 @@ describe('Reads contents of the folder from location', function() {

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