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

cerebral

Package Overview
Dependencies
Maintainers
1
Versions
638
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cerebral - npm Package Compare versions

Comparing version 0.25.1 to 0.26.0

2

package.json
{
"name": "cerebral",
"version": "0.25.1",
"version": "0.26.0",
"description": "A state controller with its own debugger",

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

@@ -8,3 +8,3 @@ var CreateSignalFactory = require('./CreateSignalFactory.js');

module.exports = function (Model, services) {
var Controller = function (Model, services) {

@@ -54,1 +54,31 @@ var controller = new EventEmitter();

};
Controller.ServerController = function (state) {
var model = {
accessors: {
get: function (path) {
path = path.slice();
var key = path.pop();
var grabbedState = state;
while (path.length) {
grabbedState = grabbedState[path.shift()];
}
return grabbedState[key];
}
}
};
var compute = Compute(model);
return {
isServer: true,
get: function (path) {
if (typeof arguments[0] === 'function') {
return compute.has(arguments[0]) ? compute.getComputedValue(arguments[0]) : compute.register(arguments[0]);
}
var path = !arguments.length ? [] : typeof arguments[0] === 'string' ? [].slice.call(arguments) : arguments[0];
return model.accessors.get(path);
}
}
};
module.exports = Controller;
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