@soratani-code/samtools 1.3.8 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/tree.js +6 -4
  2. package/package.json +1 -1
package/lib/tree.js CHANGED
@@ -43,13 +43,15 @@ function deleteNodeFormKey(key, nodes, id) {
43
43
  while (queue.length > 0) {
44
44
  const node = queue.shift();
45
45
  if (node[key] === id) {
46
- return null;
46
+ return [];
47
47
  }
48
48
  if ((0, lodash_1.isArray)(node.children)) {
49
49
  const newChildren = [];
50
- const result = deleteNodeFormKey(key, node.children, id);
51
- if (result) {
52
- newChildren.push(...result);
50
+ for (let child of node.children) {
51
+ const result = deleteNodeFormKey(key, [child], id);
52
+ if (result.length) {
53
+ newChildren.push(...result);
54
+ }
53
55
  }
54
56
  node.children = newChildren;
55
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soratani-code/samtools",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "description": "",
5
5
  "typings": "lib/index.d.ts",
6
6
  "main": "lib/index.js",