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

baobab

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

baobab - npm Package Compare versions

Comparing version 2.0.0-dev1 to 2.0.0-dev2

2

bower.json
{
"name": "baobab",
"main": "build/baobab.min.js",
"version": "2.0.0-dev1",
"version": "2.0.0-dev2",
"homepage": "https://github.com/Yomguithereal/baobab",

@@ -6,0 +6,0 @@ "author": {

@@ -415,3 +415,3 @@ /**

Object.defineProperty(Baobab, 'version', {
value: '2.0.0-dev1'
value: '2.0.0-dev2'
});

@@ -418,0 +418,0 @@

@@ -113,3 +113,3 @@ /**

// TODO: some operations here might be merged for perfs
var additionalPaths = _this._facetPath ? (0, _helpers.getIn)(_this.tree._computedDataIndex, _this._facetPath).paths : [];
var additionalPaths = _this._facetPath ? (0, _helpers.getIn)(_this.tree._computedDataIndex, _this._facetPath).relatedPaths() : [];

@@ -116,0 +116,0 @@ // If this is the root selector, we fire already

@@ -64,2 +64,7 @@ /**

// Is the facet recursive?
this.isRecursive = !!this.paths.filter(function (p) {
return _type2['default'].facetPath(p);
}).length;
// Internal state

@@ -81,3 +86,3 @@ this.state = {

// Is this facet affected by the current write event?
var concerned = (0, _helpers.solveUpdate)([path], _this.paths);
var concerned = (0, _helpers.solveUpdate)([path], _this.relatedPaths());

@@ -95,2 +100,22 @@ if (concerned) {

_createClass(Facet, [{
key: 'relatedPaths',
/**
* Method returning solved paths related to the facet.
*
* @return {array} - An array of related paths.
*/
value: function relatedPaths() {
var _this2 = this;
if (!this.isRecursive) return this.paths;else return this.paths.reduce(function (paths, path) {
if (!_type2['default'].facetPath(path)) return paths.concat(path);
// Solving recursive path
var relatedFacet = (0, _helpers.getIn)(_this2.tree._computedDataIndex, path);
return paths.concat(relatedFacet.relatedPaths());
}, []);
}
}, {
key: 'get',

@@ -97,0 +122,0 @@

{
"name": "baobab",
"version": "2.0.0-dev1",
"version": "2.0.0-dev2",
"description": "JavaScript persistent data tree with cursors.",

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

@@ -399,3 +399,3 @@ /**

Object.defineProperty(Baobab, 'version', {
value: '2.0.0-dev1'
value: '2.0.0-dev2'
});

@@ -402,0 +402,0 @@

@@ -98,3 +98,3 @@ /**

const additionalPaths = this._facetPath ?
getIn(this.tree._computedDataIndex, this._facetPath).paths :
getIn(this.tree._computedDataIndex, this._facetPath).relatedPaths() :
[];

@@ -101,0 +101,0 @@

@@ -10,2 +10,3 @@ /**

deepFreeze,
getIn,
makeError,

@@ -55,2 +56,5 @@ solveUpdate

// Is the facet recursive?
this.isRecursive = !!this.paths.filter(p => type.facetPath(p)).length;
// Internal state

@@ -71,3 +75,3 @@ this.state = {

// Is this facet affected by the current write event?
const concerned = solveUpdate([path], this.paths);
const concerned = solveUpdate([path], this.relatedPaths());

@@ -85,2 +89,23 @@ if (concerned) {

/**
* Method returning solved paths related to the facet.
*
* @return {array} - An array of related paths.
*/
relatedPaths() {
if (!this.isRecursive)
return this.paths;
else
return this.paths.reduce((paths, path) => {
if (!type.facetPath(path))
return paths.concat(path);
// Solving recursive path
const relatedFacet = getIn(this.tree._computedDataIndex, path);
return paths.concat(relatedFacet.relatedPaths());
}, []);
}
/**
* Getter method

@@ -87,0 +112,0 @@ *

@@ -5,2 +5,3 @@ TODO

* TRY RECURSIVE FACETS BITCH
* DYNAMIC PATHS IN FACETS BITCH

@@ -7,0 +8,0 @@ * Make the facets update work

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