Socket
Socket
Sign inDemoInstall

tree-sync

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-sync - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

.eslintrc.js

16

index.js

@@ -26,3 +26,3 @@ 'use strict';

var input = FSTree.fromEntries(walkSync.entries(this._input))
var input = FSTree.fromEntries(walkSync.entries(this._input));
var output = FSTree.fromEntries(walkSync.entries(this._output));

@@ -64,5 +64,15 @@

case 'mkdir' :
return fs.mkdirSync(outputFullpath);
try {
return fs.mkdirSync(outputFullpath);
} catch(e) {
if (e && e.code === 'EXISTS') { /* do nothing */ }
else { throw e; }
}
case 'unlink':
return fs.unlinkSync(outputFullpath);
try {
return fs.unlinkSync(outputFullpath);
} catch(e) {
if (e && e.code === 'ENOENT') { /* do nothing */ }
else { throw e; }
}
case 'rmdir':

@@ -69,0 +79,0 @@ return fs.rmdir(outputFullpath);

6

package.json
{
"name": "tree-sync",
"version": "1.0.2",
"version": "1.1.0",
"description": "",

@@ -27,4 +27,6 @@ "main": "index.js",

"chai": "^3.4.1",
"mocha": "^2.3.4"
"glob": "^7.0.0",
"mocha": "^2.3.4",
"mocha-eslint": "^1.0.0"
}
}

@@ -32,6 +32,6 @@ var expect = require('chai').expect;

expect(walkSync(tmp)).to.deep.equal([
'one/',
'one/bar/',
'one/bar/bar.txt',
'one/foo.txt',
'one/',
'one/bar/',
'one/bar/bar.txt',
'one/foo.txt'
]);

@@ -41,2 +41,19 @@ });

describe('existing empty directory -> populated', function() {
it('file content', function() {
expect(walkSync(tmp)).to.deep.equal([]);
fs.mkdirSync(tmp + '/one');
treeSync.sync();
expect(walkSync(tmp)).to.deep.equal([
'one/',
'one/bar/',
'one/bar/bar.txt',
'one/foo.txt'
]);
});
});
describe('input(same) -> input(same)', function() {

@@ -43,0 +60,0 @@ beforeEach(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