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-dev6 to 2.0.0-dev7

4

dist/baobab.js

@@ -391,3 +391,3 @@ /**

return new _cursor2['default'](this, null, { watch: paths });
return new _cursor2['default'](this, null, { watched: paths });
}

@@ -447,3 +447,3 @@ }, {

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

@@ -450,0 +450,0 @@

@@ -47,2 +47,5 @@ /**

*
* Note: opts.watched is not called opts.watch not to tamper with experimental
* `Object.prototype.watch`.
*
* @constructor

@@ -52,4 +55,5 @@ * @param {Baobab} tree - The cursor's root.

* @param {object} [opts] - Options
* @param {string} [opts.hash] - The path's hash computed ahead by the tree.
* @param {array} [opts.watch] - Paths the cursor is meant to watch.
* @param {string} [opts.hash] - The path's hash computed ahead by the tree.
* @param {array} [opts.watched] - Parts of the tree the cursor is meant to
* watch over.
*/

@@ -88,15 +92,15 @@

// Checking whether the cursor is a watcher
if (opts.watch) {
this._watch = (0, _helpers.shallowClone)(opts.watch);
if (opts.watched) {
this._watched = (0, _helpers.shallowClone)(opts.watched);
// Normalizing path
for (var k in this._watch) {
if (this._watch[k] instanceof Cursor) this._watch[k] = this._watch[k].path;
for (var k in this._watched) {
if (this._watched[k] instanceof Cursor) this._watched[k] = this._watched[k].path;
} // Keeping track of watched paths
this._watchedPaths = opts.watch && (!_type2['default'].array(this._watch) ? Object.keys(this._watch).map(function (k) {
return _this._watch[k];
}) : this._watch);
this._watchedPaths = opts.watched && (!_type2['default'].array(this._watched) ? Object.keys(this._watched).map(function (k) {
return _this._watched[k];
}) : this._watched);
// Overriding the cursor's get method
this.get = this.tree.project.bind(this.tree, this._watch);
this.get = this.tree.project.bind(this.tree, this._watched);
}

@@ -134,3 +138,3 @@

if (_this._watch) return _this.emit('update');
if (_this._watched) return _this.emit('update');

@@ -212,3 +216,3 @@ var record = (0, _helpers.getIn)(previousData, _this.solvedPath).data;

// Standard cursor
if (!this._watch) {
if (!this._watched) {

@@ -215,0 +219,0 @@ // Checking whether we should keep track of some dependencies

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

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

@@ -385,3 +385,3 @@ /**

return new Cursor(this, null, {watch: paths});
return new Cursor(this, null, {watched: paths});
}

@@ -431,3 +431,3 @@

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

@@ -434,0 +434,0 @@

@@ -40,2 +40,5 @@ /**

*
* Note: opts.watched is not called opts.watch not to tamper with experimental
* `Object.prototype.watch`.
*
* @constructor

@@ -45,4 +48,5 @@ * @param {Baobab} tree - The cursor's root.

* @param {object} [opts] - Options
* @param {string} [opts.hash] - The path's hash computed ahead by the tree.
* @param {array} [opts.watch] - Paths the cursor is meant to watch.
* @param {string} [opts.hash] - The path's hash computed ahead by the tree.
* @param {array} [opts.watched] - Parts of the tree the cursor is meant to
* watch over.
*/

@@ -72,17 +76,17 @@ export default class Cursor extends Emitter {

// Checking whether the cursor is a watcher
if (opts.watch) {
this._watch = shallowClone(opts.watch);
if (opts.watched) {
this._watched = shallowClone(opts.watched);
// Normalizing path
for (let k in this._watch)
if (this._watch[k] instanceof Cursor)
this._watch[k] = this._watch[k].path;
for (let k in this._watched)
if (this._watched[k] instanceof Cursor)
this._watched[k] = this._watched[k].path;
// Keeping track of watched paths
this._watchedPaths = opts.watch && (!type.array(this._watch) ?
Object.keys(this._watch).map(k => this._watch[k]) :
this._watch);
this._watchedPaths = opts.watched && (!type.array(this._watched) ?
Object.keys(this._watched).map(k => this._watched[k]) :
this._watched);
// Overriding the cursor's get method
this.get = this.tree.project.bind(this.tree, this._watch);
this.get = this.tree.project.bind(this.tree, this._watched);
}

@@ -130,3 +134,3 @@

if (this._watch)
if (this._watched)
return this.emit('update');

@@ -207,3 +211,3 @@

// Standard cursor
if (!this._watch) {
if (!this._watched) {

@@ -210,0 +214,0 @@ // Checking whether we should keep track of some dependencies

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