@memlab/heap-analysis 1.0.40 → 2.0.0
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.
- package/dist/BaseAnalysis.js +6 -6
- package/dist/PluginUtils.js +2 -2
- package/dist/index.js +2 -2
- package/dist/plugins/CollectionUnboundGrowthAnalysis.js +1 -1
- package/dist/plugins/GlobalVariableAnalysis/BuiltInGlobalVariables.d.ts.map +1 -1
- package/dist/plugins/GlobalVariableAnalysis/BuiltInGlobalVariables.js +970 -955
- package/dist/plugins/ObjectShapeAnalysis.js +2 -2
- package/dist/plugins/ObjectUnboundGrowthAnalysis.js +5 -5
- package/dist/plugins/ReactComponentHookAnalysis.js +2 -2
- package/dist/plugins/StringAnalysis.d.ts.map +1 -1
- package/dist/plugins/StringAnalysis.js +30 -17
- package/package.json +7 -7
package/dist/BaseAnalysis.js
CHANGED
|
@@ -59,8 +59,8 @@ class Analysis {
|
|
|
59
59
|
* different return value format.
|
|
60
60
|
* @internal
|
|
61
61
|
*/
|
|
62
|
-
run(
|
|
63
|
-
return __awaiter(this,
|
|
62
|
+
run() {
|
|
63
|
+
return __awaiter(this, arguments, void 0, function* (options = PluginUtils_1.default.defaultAnalysisArgs) {
|
|
64
64
|
loadScenarioConfig();
|
|
65
65
|
yield this.process(options);
|
|
66
66
|
});
|
|
@@ -94,8 +94,8 @@ class Analysis {
|
|
|
94
94
|
* });
|
|
95
95
|
* ```
|
|
96
96
|
*/
|
|
97
|
-
analyzeSnapshotFromFile(
|
|
98
|
-
return __awaiter(this,
|
|
97
|
+
analyzeSnapshotFromFile(file_1) {
|
|
98
|
+
return __awaiter(this, arguments, void 0, function* (file, options = {}) {
|
|
99
99
|
if (options.workDir) {
|
|
100
100
|
// set and init the new work dir
|
|
101
101
|
core_1.config.defaultFileManagerOption = options;
|
|
@@ -144,8 +144,8 @@ class Analysis {
|
|
|
144
144
|
* });
|
|
145
145
|
* ```
|
|
146
146
|
*/
|
|
147
|
-
analyzeSnapshotsInDirectory(
|
|
148
|
-
return __awaiter(this,
|
|
147
|
+
analyzeSnapshotsInDirectory(directory_1) {
|
|
148
|
+
return __awaiter(this, arguments, void 0, function* (directory, options = {}) {
|
|
149
149
|
if (options.workDir) {
|
|
150
150
|
// set and init the new work dir
|
|
151
151
|
core_1.config.defaultFileManagerOption = options;
|
package/dist/PluginUtils.js
CHANGED
|
@@ -486,8 +486,8 @@ function getHeapFromFile(file) {
|
|
|
486
486
|
return yield loadProcessedSnapshot({ file });
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
|
-
function loadProcessedSnapshot(
|
|
490
|
-
return __awaiter(this,
|
|
489
|
+
function loadProcessedSnapshot() {
|
|
490
|
+
return __awaiter(this, arguments, void 0, function* (options = {}) {
|
|
491
491
|
const opt = { buildNodeIdIndex: true, verbose: true };
|
|
492
492
|
const file = options.file || core_2.utils.getSnapshotFilePathWithTabType(/.*/);
|
|
493
493
|
const snapshot = yield core_2.utils.getSnapshotFromFile(file, opt);
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
21
21
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.heapConfig = exports.heapAnalysisLoader = exports.PluginUtils = exports.StringAnalysis = exports.ObjectUnboundGrowthAnalysis = exports.ObjectShapeAnalysis = exports.ObjectFanoutAnalysis = exports.ShapeUnboundGrowthAnalysis = exports.ObjectSizeAnalysis = exports.ObjectShallowAnalysis = exports.CollectionsHoldingStaleAnalysis = exports.GlobalVariableAnalysis = exports.DetachedDOMElementAnalysis = exports.BaseAnalysis = exports.takeNodeFullHeap = exports.snapshotMapReduce = exports.loadHeapSnapshot = exports.getSnapshotFileForAnalysis = exports.getSnapshotDirForAnalysis = exports.getFullHeapFromFile = exports.getHeapFromFile = exports.getDominatorNodes =
|
|
24
|
+
exports.heapConfig = exports.heapAnalysisLoader = exports.PluginUtils = exports.StringAnalysis = exports.ObjectUnboundGrowthAnalysis = exports.ObjectShapeAnalysis = exports.ObjectFanoutAnalysis = exports.ShapeUnboundGrowthAnalysis = exports.ObjectSizeAnalysis = exports.ObjectShallowAnalysis = exports.CollectionsHoldingStaleAnalysis = exports.GlobalVariableAnalysis = exports.DetachedDOMElementAnalysis = exports.BaseAnalysis = exports.takeNodeFullHeap = exports.snapshotMapReduce = exports.loadHeapSnapshot = exports.getSnapshotFileForAnalysis = exports.getSnapshotDirForAnalysis = exports.getFullHeapFromFile = exports.getHeapFromFile = exports.getDominatorNodes = void 0;
|
|
25
|
+
exports.registerPackage = registerPackage;
|
|
25
26
|
const path_1 = __importDefault(require("path"));
|
|
26
27
|
const core_1 = require("@memlab/core");
|
|
27
28
|
/** @internal */
|
|
@@ -30,7 +31,6 @@ function registerPackage() {
|
|
|
30
31
|
return core_1.PackageInfoLoader.registerPackage(path_1.default.join(__dirname, '..'));
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
|
-
exports.registerPackage = registerPackage;
|
|
34
34
|
const PluginUtils_1 = __importDefault(require("./PluginUtils"));
|
|
35
35
|
exports.getDominatorNodes = PluginUtils_1.default.getDominatorNodes,
|
|
36
36
|
/** @deprecated */
|
|
@@ -162,7 +162,7 @@ class CollectionUnboundGrowthAnalysis extends BaseAnalysis_1.default {
|
|
|
162
162
|
core_1.info.topLevel('\n' + str);
|
|
163
163
|
// save results to file
|
|
164
164
|
const csv = core_1.serializer.summarizeUnboundedObjectsToCSV(ids);
|
|
165
|
-
fs_1.default.writeFileSync(core_1.config.unboundObjectCSV, csv, '
|
|
165
|
+
fs_1.default.writeFileSync(core_1.config.unboundObjectCSV, csv, { encoding: 'utf8' });
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BuiltInGlobalVariables.d.ts","sourceRoot":"","sources":["../../../src/plugins/GlobalVariableAnalysis/BuiltInGlobalVariables.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;;AAEH,
|
|
1
|
+
{"version":3,"file":"BuiltInGlobalVariables.d.ts","sourceRoot":"","sources":["../../../src/plugins/GlobalVariableAnalysis/BuiltInGlobalVariables.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;;AAEH,wBAmjCG"}
|