Socket
Socket
Sign inDemoInstall

fs-tree-diff

Package Overview
Dependencies
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-tree-diff - npm Package Compare versions

Comparing version 0.4.3 to 0.4.4

.vim/ftplugin/javascript.vim

16

lib/index.js

@@ -20,3 +20,15 @@ 'use strict';

} else {
this.entries = new Set(options.entries || [], 'relativePath');
var inputs = options.entries || [];
this.entries = new Set(inputs, 'relativePath');
if (this.entries.size !== inputs.length) {
var uniqInputs = new Set();
for (var i=0; i<inputs.length; ++i) {
if (uniqInputs.has(inputs[i].relativePath)) {
throw new Error('Duplicate Entry "' + inputs[i].relativePath + '"');
}
uniqInputs.add(inputs[i].relativePath);
}
}
}

@@ -77,3 +89,3 @@ }

// TODO: addEntries should be combined with th preOrderDepthReducer and return addOps
// TODO: addEntries should be combined with the preOrderDepthReducer and return addOps
tree.addEntries(fsAddTree.entries);

@@ -80,0 +92,0 @@ var createOps = tree.preOrderDepthReducer(reduceAdditions, []);

2

package.json
{
"name": "fs-tree-diff",
"version": "0.4.3",
"version": "0.4.4",
"description": "Backs out file tree changes",

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

@@ -13,3 +13,3 @@ # fs-tree-diff [![Build Status](https://travis-ci.org/stefanpenner/fs-tree-diff.svg)](https://travis-ci.org/stefanpenner/fs-tree-diff)

* `create` – create the specified file
* `update` – update the specified file
* `change` – update the specified file to reflect changes

@@ -16,0 +16,0 @@ The operations choosen aim to minimize the amount of IO required to apply a given patch.

@@ -143,2 +143,11 @@ 'use strict';

});
it('throws an error for duplicate paths', function() {
expect(function () {
fsTree.calculatePatch(FSTree.fromEntries([
file('a/foo.js', { size: 1, mtime: 1 }),
file('a/foo.js', { size: 1, mtime: 2 }),
]));
}).to.throw('Duplicate Entry "a/foo.js"');
});
});

@@ -145,0 +154,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