New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mako-tree

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mako-tree - npm Package Compare versions

Comparing version 0.10.0 to 0.10.1

5

HISTORY.md
0.10.1 / 2016-02-09
===================
* adding ability to forcibly remove a file from the tree
0.10.0 / 2016-02-08

@@ -3,0 +8,0 @@ ===================

17

lib/tree.js

@@ -97,7 +97,16 @@

*
* @param {String} location The absolute path to the file.
* Available `options`:
* - `force` removes the file even if dependencies/dependants exist
*
* @param {String} location The absolute path to the file.
* @param {Object} [options] Additional options.
*/
removeFile(location) {
debug('removing node %s', relative(location));
this.graph.removeVertex(location);
removeFile(location, options) {
let config = defaults(options, { force: false });
debug('removing node %s: %j', relative(location), config);
if (config.force) {
this.graph.destroyVertex(location);
} else {
this.graph.removeVertex(location);
}
}

@@ -104,0 +113,0 @@

{
"name": "mako-tree",
"version": "0.10.0",
"version": "0.10.1",
"main": "./lib/tree",

@@ -5,0 +5,0 @@ "description": "The build tree structure used internally by mako",

@@ -116,3 +116,3 @@

describe('#removeFile(location)', function () {
describe('#removeFile(location, [options])', function () {
it('should remove the file from the tree', function () {

@@ -137,2 +137,16 @@ let tree = new Tree();

});
context('with options', function () {
context('.force', function () {
// a <- b
let tree = new Tree();
tree.addFile('a');
tree.addFile('b');
tree.addDependency('a', 'b');
tree.removeFile('a', { force: true });
assert.isFalse(tree.hasFile('a'));
assert.isTrue(tree.hasFile('b'));
});
});
});

@@ -560,3 +574,3 @@

it('should not properly handle a complex case', function () {
it('should properly handle a complex case', function () {
// a* <- b <- c <- d

@@ -641,3 +655,3 @@ // e <- f <-

describe('.fromString()', function () {
describe('.fromString(input)', function () {
it('should parse a JSON string into a tree instance', function () {

@@ -644,0 +658,0 @@ // a <- b

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