Comparing version 0.0.3 to 0.0.4
@@ -148,3 +148,3 @@ "use strict"; | ||
parent.left = undefined; | ||
} | ||
} /* istanbul ignore else */ | ||
else if (parent.right === childNode) { | ||
@@ -156,3 +156,2 @@ // Otherwise old child was right child, replace right | ||
else { | ||
/* istanbul ignore next */ | ||
throw new Error(`Invariant failed: node ${childNode.key} is not a child of ${(_a = childNode.parent) === null || _a === void 0 ? void 0 : _a.key}`); | ||
@@ -188,3 +187,3 @@ } | ||
replacement.parent.left = undefined; | ||
} | ||
} /* istanbul ignore else */ | ||
else if (replacement.parent.right === replacement) { | ||
@@ -194,3 +193,2 @@ replacement.parent.right = undefined; | ||
else { | ||
/* istanbul ignore next */ | ||
throw new Error(`Invariant failed: node ${replacement.key} has parent ${replacement.parent.key} that has no link back`); | ||
@@ -212,3 +210,3 @@ } | ||
parent.left = replacement; | ||
} | ||
} /* istanbul ignore else */ | ||
else if (parent.right === node) { | ||
@@ -218,3 +216,2 @@ parent.right = replacement; | ||
else { | ||
/* istanbul ignore next */ | ||
throw new Error(`Invariant failed: node ${node.key} has parent ${(_a = node.parent) === null || _a === void 0 ? void 0 : _a.key} that has no link back`); | ||
@@ -280,3 +277,3 @@ } | ||
value: node.value, | ||
balanceFactor: node === null || node === void 0 ? void 0 : node.balanceFactor | ||
balanceFactor: node.balanceFactor | ||
}; | ||
@@ -283,0 +280,0 @@ if (node.left) { |
{ | ||
"name": "quick-avl", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "AVL tree: a self-balancing binary search tree", | ||
@@ -65,4 +65,4 @@ "keywords": [ | ||
"engines": { | ||
"node": "^10||^12||^14||^15" | ||
"node": "^10||^12||^14||^15||^16||^17" | ||
} | ||
} |
47693
13
1161