Comparing version 1.0.3 to 1.0.4
@@ -243,2 +243,6 @@ "use strict"; | ||
super.mv(to, newName); | ||
// when `to` is null, it means the item is detached from the tree and disposed off | ||
if (this.disposed) { | ||
return; | ||
} | ||
if (typeof this.watchTerminator === 'function') { | ||
@@ -245,0 +249,0 @@ this.watchTerminator(prevPath); |
@@ -72,5 +72,5 @@ "use strict"; | ||
if (to === null || to.type !== types_1.FileType.Directory) { // that's the best check we can do; `parent instanceof Directory` causes a cyclic dependency | ||
this.dispose(); | ||
this._parent = null; | ||
prevParent.unlinkItem(this); | ||
this.dispose(); | ||
return; | ||
@@ -77,0 +77,0 @@ } |
{ | ||
"name": "aspen-core", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Sync dynamic nested objects with their flattened representation", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -42,5 +42,5 @@ import { FileEntry } from './FileEntry' | ||
protected _children: Array<Directory | FileEntry> | ||
/** | ||
* Directory.children.length of self and all leafs (recursive) with isExpanded = true | ||
*/ | ||
/** | ||
* Directory.children.length of self and all leafs (recursive) with isExpanded = true | ||
*/ | ||
protected _branchSize: number | ||
@@ -233,2 +233,7 @@ protected flattenedBranch: Uint32Array | ||
// when `to` is null, it means the item is detached from the tree and disposed off | ||
if (this.disposed) { | ||
return | ||
} | ||
if (typeof this.watchTerminator === 'function') { | ||
@@ -250,7 +255,7 @@ this.watchTerminator(prevPath) | ||
/** | ||
* WARNING: This will only stop watchers and clear bookkeeping records | ||
* To clean-up flattened branches and stuff, call Directory#removeItem in the parent | ||
* Directory#removeItem will call Directory#dispose anyway | ||
*/ | ||
/** | ||
* WARNING: This will only stop watchers and clear bookkeeping records | ||
* To clean-up flattened branches and stuff, call Directory#removeItem in the parent | ||
* Directory#removeItem will call Directory#dispose anyway | ||
*/ | ||
protected dispose() { | ||
@@ -336,3 +341,3 @@ if (typeof this.watchTerminator === 'function') { | ||
this.setFlattenedBranch(flatTree) | ||
if ( typeof this.watchTerminator === 'function') { | ||
if (typeof this.watchTerminator === 'function') { | ||
this.watchTerminator(this.path) | ||
@@ -339,0 +344,0 @@ } |
@@ -96,5 +96,5 @@ import { Directory } from './Directory' | ||
if (to === null || to.type !== FileType.Directory) { // that's the best check we can do; `parent instanceof Directory` causes a cyclic dependency | ||
this.dispose() | ||
this._parent = null | ||
prevParent.unlinkItem(this) | ||
this.dispose() | ||
return | ||
@@ -101,0 +101,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5533001
4071