+1
-1
| { | ||
| "name": "cleanheap", | ||
| "version": "0.0.3", | ||
| "version": "0.0.4", | ||
| "description": "A tool for scrubbing Weak retainer paths from a heap snapshot", | ||
@@ -5,0 +5,0 @@ "main": "src/index.ts", |
+7
-12
@@ -38,8 +38,2 @@ import chalk from 'chalk'; | ||
| function logUpdate(str: string) { | ||
| clearLine(); | ||
| process.stdout.write(str); | ||
| } | ||
| function logCompletion(str: string) { | ||
@@ -208,3 +202,3 @@ clearLine(); | ||
| data.snapshot = null as unknown as any; | ||
| writer.write(`{ "meta": ${content},`); | ||
| writer.write(`{\n"snapshot": ${content}\n`); | ||
| writer.flush(); | ||
@@ -220,3 +214,3 @@ content = ''; // free up memory | ||
| data.nodes = null as unknown as any; | ||
| writer.write(`"nodes": ${content},`); | ||
| writer.write(`,"nodes": ${content}\n`); | ||
| writer.flush(); | ||
@@ -232,3 +226,3 @@ content = ''; // free up memory | ||
| data.edges = null as unknown as any; | ||
| writer.write(`"edges": ${content}}`); | ||
| writer.write(`,"edges": ${content}\n`); | ||
| writer.flush(); | ||
@@ -244,3 +238,3 @@ content = ''; // free up memory | ||
| data.strings = null as unknown as any; | ||
| writer.write(`"strings": ${content}}`); | ||
| writer.write(`,"strings": ${content}\n`); | ||
| writer.flush(); | ||
@@ -255,3 +249,3 @@ content = ''; // free up memory | ||
| for (const key in data) { | ||
| if (key === 'snapshot' || key === 'nodes' || key === 'edges' || key === 'strings') { | ||
| if (!Object.prototype.hasOwnProperty.call(data, key) || key === 'snapshot' || key === 'nodes' || key === 'edges' || key === 'strings') { | ||
| continue; | ||
@@ -261,3 +255,3 @@ } | ||
| data[key] = null as unknown as any; | ||
| writer.write(`"${key}": ${content},`); | ||
| writer.write(`,"${key}": ${content}\n`); | ||
| writer.flush(); | ||
@@ -271,2 +265,3 @@ content = ''; // free up memory | ||
| // close the file | ||
| writer.write('}\n'); | ||
| writer.end(); | ||
@@ -273,0 +268,0 @@ console.log(chalk.grey(`\t${chalk.white('·')}\t${chalk.green('▶')} Snapshot written`)); |
Sorry, the diff of this file is not supported yet
54010928
0289
-1.03%