Comparing version 2.1.0-beta.0 to 2.1.1
@@ -123,83 +123,86 @@ "use strict"; | ||
let reseted = false; | ||
if (error && !updates) { | ||
updates = [['$disconnectedTs', value_1.ValueUpdate.getTs()]]; | ||
if (!updates) { | ||
if (error) { | ||
updates = [['$disconnectedTs', value_1.ValueUpdate.getTs()]]; | ||
} | ||
else { | ||
updates = []; | ||
} | ||
} | ||
if (updates) { | ||
for (let update of updates) { | ||
let name; | ||
let value; | ||
let removed = false; | ||
if (Array.isArray(update)) { | ||
if (update.length > 0 && typeof update[0] === 'string') { | ||
name = update[0]; | ||
if (update.length > 1) { | ||
value = update[1]; | ||
} | ||
for (let update of updates) { | ||
let name; | ||
let value; | ||
let removed = false; | ||
if (Array.isArray(update)) { | ||
if (update.length > 0 && typeof update[0] === 'string') { | ||
name = update[0]; | ||
if (update.length > 1) { | ||
value = update[1]; | ||
} | ||
else { | ||
continue; // invalid response | ||
} | ||
} | ||
else if (update != null && update instanceof Object) { | ||
if (typeof update['name'] === 'string') { | ||
name = update['name']; | ||
} | ||
else { | ||
continue; // invalid response | ||
} | ||
if (update['change'] === 'remove') { | ||
removed = true; | ||
} | ||
else { | ||
value = update['value']; | ||
} | ||
else { | ||
continue; // invalid response | ||
} | ||
} | ||
else if (update != null && update instanceof Object) { | ||
if (typeof update['name'] === 'string') { | ||
name = update['name']; | ||
} | ||
else { | ||
continue; // invalid response | ||
} | ||
if (name.startsWith('$')) { | ||
if (!reseted && | ||
(name === '$is' || name === '$base' || (name === '$disconnectedTs' && typeof value === 'string'))) { | ||
reseted = true; | ||
this.node.resetNodeCache(); | ||
} | ||
if (name === '$is') { | ||
this.loadProfile(value); | ||
} | ||
this.changes.add(name); | ||
if (removed) { | ||
this.node.configs.delete(name); | ||
} | ||
else { | ||
this.node.configs.set(name, value); | ||
} | ||
if (update['change'] === 'remove') { | ||
removed = true; | ||
} | ||
else if (name.startsWith('@')) { | ||
this.changes.add(name); | ||
if (removed) { | ||
this.node.attributes.delete(name); | ||
} | ||
else { | ||
this.node.attributes.set(name, value); | ||
} | ||
else { | ||
value = update['value']; | ||
} | ||
} | ||
else { | ||
continue; // invalid response | ||
} | ||
if (name.startsWith('$')) { | ||
if (!reseted && | ||
(name === '$is' || name === '$base' || (name === '$disconnectedTs' && typeof value === 'string'))) { | ||
reseted = true; | ||
this.node.resetNodeCache(); | ||
} | ||
if (name === '$is') { | ||
this.loadProfile(value); | ||
} | ||
this.changes.add(name); | ||
if (removed) { | ||
this.node.configs.delete(name); | ||
} | ||
else { | ||
this.changes.add(name); | ||
if (removed) { | ||
this.node.children.delete(name); | ||
} | ||
else if (value != null && value instanceof Object) { | ||
// TODO, also wait for children $is | ||
this.node.children.set(name, this.requester.nodeCache.updateRemoteChildNode(this.node, name, value)); | ||
} | ||
this.node.configs.set(name, value); | ||
} | ||
} | ||
if (this.request.streamStatus !== 'initialize') { | ||
this.node._listed = true; | ||
else if (name.startsWith('@')) { | ||
this.changes.add(name); | ||
if (removed) { | ||
this.node.attributes.delete(name); | ||
} | ||
else { | ||
this.node.attributes.set(name, value); | ||
} | ||
} | ||
if (this._pendingRemoveDef) { | ||
this._checkRemoveDef(); | ||
else { | ||
this.changes.add(name); | ||
if (removed) { | ||
this.node.children.delete(name); | ||
} | ||
else if (value != null && value instanceof Object) { | ||
// TODO, also wait for children $is | ||
this.node.children.set(name, this.requester.nodeCache.updateRemoteChildNode(this.node, name, value)); | ||
} | ||
} | ||
this.onProfileUpdated(); | ||
} | ||
if (this.request.streamStatus !== 'initialize') { | ||
this.node._listed = true; | ||
} | ||
if (this._pendingRemoveDef) { | ||
this._checkRemoveDef(); | ||
} | ||
this.onProfileUpdated(); | ||
} | ||
@@ -206,0 +209,0 @@ loadProfile(defName) { |
{ | ||
"name": "dslink", | ||
"license": "Apache-2.0", | ||
"version": "2.1.0-beta.0", | ||
"version": "2.1.1", | ||
"main": "js/node.js", | ||
@@ -36,3 +36,3 @@ "repository": { | ||
"tslint": "^5.20.1", | ||
"typedoc": "^0.15.2", | ||
"typedoc": "^0.15.3", | ||
"typescript": "^3.7.2" | ||
@@ -39,0 +39,0 @@ }, |
@@ -89,75 +89,78 @@ import {Requester} from '../requester'; | ||
let reseted = false; | ||
if (error && !updates) { | ||
updates = [['$disconnectedTs', ValueUpdate.getTs()]]; | ||
if (!updates) { | ||
if (error) { | ||
updates = [['$disconnectedTs', ValueUpdate.getTs()]]; | ||
} else { | ||
updates = []; | ||
} | ||
} | ||
if (updates) { | ||
for (let update of updates) { | ||
let name: string; | ||
let value: any; | ||
let removed = false; | ||
if (Array.isArray(update)) { | ||
if (update.length > 0 && typeof update[0] === 'string') { | ||
name = update[0]; | ||
if (update.length > 1) { | ||
value = update[1]; | ||
} | ||
} else { | ||
continue; // invalid response | ||
for (let update of updates) { | ||
let name: string; | ||
let value: any; | ||
let removed = false; | ||
if (Array.isArray(update)) { | ||
if (update.length > 0 && typeof update[0] === 'string') { | ||
name = update[0]; | ||
if (update.length > 1) { | ||
value = update[1]; | ||
} | ||
} else if (update != null && update instanceof Object) { | ||
if (typeof update['name'] === 'string') { | ||
name = update['name']; | ||
} else { | ||
continue; // invalid response | ||
} | ||
if (update['change'] === 'remove') { | ||
removed = true; | ||
} else { | ||
value = update['value']; | ||
} | ||
} else { | ||
continue; // invalid response | ||
} | ||
if (name.startsWith('$')) { | ||
if ( | ||
!reseted && | ||
(name === '$is' || name === '$base' || (name === '$disconnectedTs' && typeof value === 'string')) | ||
) { | ||
reseted = true; | ||
this.node.resetNodeCache(); | ||
} | ||
if (name === '$is') { | ||
this.loadProfile(value); | ||
} | ||
this.changes.add(name); | ||
if (removed) { | ||
this.node.configs.delete(name); | ||
} else { | ||
this.node.configs.set(name, value); | ||
} | ||
} else if (name.startsWith('@')) { | ||
this.changes.add(name); | ||
if (removed) { | ||
this.node.attributes.delete(name); | ||
} else { | ||
this.node.attributes.set(name, value); | ||
} | ||
} else if (update != null && update instanceof Object) { | ||
if (typeof update['name'] === 'string') { | ||
name = update['name']; | ||
} else { | ||
this.changes.add(name); | ||
if (removed) { | ||
this.node.children.delete(name); | ||
} else if (value != null && value instanceof Object) { | ||
// TODO, also wait for children $is | ||
this.node.children.set(name, this.requester.nodeCache.updateRemoteChildNode(this.node, name, value)); | ||
} | ||
continue; // invalid response | ||
} | ||
if (update['change'] === 'remove') { | ||
removed = true; | ||
} else { | ||
value = update['value']; | ||
} | ||
} else { | ||
continue; // invalid response | ||
} | ||
if (this.request.streamStatus !== 'initialize') { | ||
this.node._listed = true; | ||
if (name.startsWith('$')) { | ||
if ( | ||
!reseted && | ||
(name === '$is' || name === '$base' || (name === '$disconnectedTs' && typeof value === 'string')) | ||
) { | ||
reseted = true; | ||
this.node.resetNodeCache(); | ||
} | ||
if (name === '$is') { | ||
this.loadProfile(value); | ||
} | ||
this.changes.add(name); | ||
if (removed) { | ||
this.node.configs.delete(name); | ||
} else { | ||
this.node.configs.set(name, value); | ||
} | ||
} else if (name.startsWith('@')) { | ||
this.changes.add(name); | ||
if (removed) { | ||
this.node.attributes.delete(name); | ||
} else { | ||
this.node.attributes.set(name, value); | ||
} | ||
} else { | ||
this.changes.add(name); | ||
if (removed) { | ||
this.node.children.delete(name); | ||
} else if (value != null && value instanceof Object) { | ||
// TODO, also wait for children $is | ||
this.node.children.set(name, this.requester.nodeCache.updateRemoteChildNode(this.node, name, value)); | ||
} | ||
} | ||
if (this._pendingRemoveDef) { | ||
this._checkRemoveDef(); | ||
} | ||
this.onProfileUpdated(); | ||
} | ||
if (this.request.streamStatus !== 'initialize') { | ||
this.node._listed = true; | ||
} | ||
if (this._pendingRemoveDef) { | ||
this._checkRemoveDef(); | ||
} | ||
this.onProfileUpdated(); | ||
} | ||
@@ -164,0 +167,0 @@ |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
15898
1
519201
166