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

state-tree

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

state-tree - npm Package Compare versions

Comparing version 0.1.17 to 0.1.18

2

package.json
{
"name": "state-tree",
"version": "0.1.17",
"version": "0.1.18",
"description": "A state tree that handles reference updates and lets you flush a description of changes",

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

var subscribers = [];
function getByPath(path, state, forcePath) {
return path.reduce(function (currentPath, key, index) {
var currentPath = state;
for (var x = 0; x < path.length; x++) {
var key = path[x];
if (forcePath && currentPath[key] === undefined) {

@@ -10,9 +12,12 @@ var newBranch = {};

configurable: true,
value: [path.slice().splice(0, index + 1)]
value: [path.slice().splice(0, x + 1)]
});
currentPath[key] = newBranch;
}
return currentPath[key];
}, state);
if (currentPath[key] === undefined) {
return currentPath[key];
}
currentPath = currentPath[key];
}
return currentPath;
}

@@ -19,0 +24,0 @@

@@ -61,1 +61,7 @@ var Lib = require('../src');

};
exports['should be able to get undefined from paths that are not in tree'] = function (test) {
var lib = Lib({});
test.equals(lib.get('some.path'), undefined);
test.done();
};
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