Socket
Socket
Sign inDemoInstall

@memlab/core

Package Overview
Dependencies
Maintainers
3
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@memlab/core - npm Package Compare versions

Comparing version 1.1.12 to 1.1.14

2

dist/__tests__/parser/HeapParser.test.d.ts

@@ -8,5 +8,5 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/
export {};
//# sourceMappingURL=HeapParser.test.d.ts.map

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -43,3 +43,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

}), timeout);
test('Does not capture transcient object', () => __awaiter(void 0, void 0, void 0, function* () {
test('Does not capture transient object', () => __awaiter(void 0, void 0, void 0, function* () {
class TestObject {

@@ -46,0 +46,0 @@ constructor() {

@@ -8,5 +8,5 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/
export {};
//# sourceMappingURL=NodeHeap.test.d.ts.map

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -8,5 +8,5 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/
export {};
//# sourceMappingURL=StringNode.test.d.ts.map

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { AnyValue } from '../../../lib/Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -8,5 +8,5 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/
export {};
//# sourceMappingURL=utils.test.d.ts.map

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ /** @internal */

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { ParsedArgs } from 'minimist';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { ConsoleMessage, Dialog, LaunchOptions, Page } from 'puppeteer';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -56,2 +56,3 @@ import type { LaunchOptions, Permission } from 'puppeteer';

_isHeadfulBrowser: boolean;
_disableWebSecurity: boolean;
_browser: string;

@@ -74,2 +75,3 @@ snapshotHasDetachedness: boolean;

curDataDir: string;
webSourceDir: string;
runMetaFile: string;

@@ -194,2 +196,3 @@ snapshotSequenceFile: string;

seqClusteringIsRandomChunks: boolean;
instrumentJS: boolean;
constructor(options?: ConfigOption);

@@ -201,3 +204,3 @@ private initInternalConfigs;

static getInstance(): MemLabConfig;
static resetConfigWithTranscientDir(): MemLabConfig;
static resetConfigWithTransientDir(): MemLabConfig;
private haltOrThrow;

@@ -213,2 +216,4 @@ setTarget(app: string, tab: string): void;

get isHeadfulBrowser(): boolean;
set disableWebSecurity(disable: boolean);
get disableWebSecurity(): boolean;
get browserBinaryPath(): string;

@@ -215,0 +220,0 @@ set reportLeaksInTimers(shouldReport: boolean);

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -59,2 +59,3 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

this._isHeadfulBrowser = false;
this._disableWebSecurity = false;
this.targetApp = Constant_1.default.unset;

@@ -120,2 +121,4 @@ this.targetTab = Constant_1.default.unset;

this.runningMode = RunningModes_1.default.get('regular', this);
// intercept and rewrite JavaScript Code in browser
this.instrumentJS = false;
// external heap snapshot paths, if enabled

@@ -328,5 +331,5 @@ this.externalSnapshotFilePaths = [];

}
static resetConfigWithTranscientDir() {
static resetConfigWithTransientDir() {
const config = MemLabConfig.getInstance();
FileManager_1.default.initDirs(config, { transcient: true });
FileManager_1.default.initDirs(config, { transient: true });
return config;

@@ -400,2 +403,23 @@ }

}
set disableWebSecurity(disable) {
this._disableWebSecurity = disable;
const args = this.puppeteerConfig.args;
const flag = '--disable-web-security';
const index = args.indexOf(flag);
if (disable) {
// add the flag
if (index < 0) {
args.push(flag);
}
}
else {
// remove the flag
if (index >= 0) {
args.splice(index, 1);
}
}
}
get disableWebSecurity() {
return this._disableWebSecurity;
}
get browserBinaryPath() {

@@ -402,0 +426,0 @@ return path_1.default.join(this.browserDir, this.browser);

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import { Chalk } from 'chalk';

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ 'use strict';

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ declare const constants: {

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -17,3 +17,3 @@ import type { MemLabConfig } from './Config';

clear?: boolean;
transcient?: boolean;
transient?: boolean;
};

@@ -24,3 +24,3 @@ /** @internal */

generateTmpHeapDir(): string;
private static transcientInstanceIdx;
private static transientInstanceIdx;
getWorkDir(options?: FileOption): string;

@@ -36,2 +36,4 @@ getChromeBinaryZipFile(): string;

getCurDataDir(options: FileOption): string;
getWebSourceDir(options?: FileOption): string;
getWebSourceMetaFile(options?: FileOption): string;
getPersistDataDir(options: FileOption): string;

@@ -38,0 +40,0 @@ getLoggerOutDir(options?: FileOption): string;

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -56,5 +56,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

}
// transcient options supercedes other the CLI options
if (options.transcient) {
const idx = ++FileManager.transcientInstanceIdx;
// transient options supercedes other the CLI options
if (options.transient) {
const idx = ++FileManager.transientInstanceIdx;
const instanceId = `${process.pid}-${Date.now()}-${idx}`;

@@ -97,2 +97,8 @@ const workDir = path_1.default.join(this.getTmpDir(), `memlab-${instanceId}`);

}
getWebSourceDir(options = {}) {
return path_1.default.join(this.getCurDataDir(options), 'code');
}
getWebSourceMetaFile(options = {}) {
return path_1.default.join(this.getWebSourceDir(options), 'files.json');
}
getPersistDataDir(options) {

@@ -211,2 +217,3 @@ return path_1.default.join(this.getDataBaseDir(options), 'persist');

}
this.emptyDirIfExists(this.getWebSourceDir(options));
const dataSuffix = ['.heapsnapshot', '.json', '.png'];

@@ -293,2 +300,3 @@ const files = fs_extra_1.default.readdirSync(curDataDir);

config.curDataDir = joinAndProcessDir(options, this.getCurDataDir(options));
config.webSourceDir = joinAndProcessDir(options, this.getWebSourceDir(options));
config.dataBuilderDataDir = joinAndProcessDir(options, config.dataBaseDir, 'dataBuilder');

@@ -328,3 +336,3 @@ config.persistentDataDir = joinAndProcessDir(options, this.getPersistDataDir(options));

exports.FileManager = FileManager;
FileManager.transcientInstanceIdx = 0;
FileManager.transientInstanceIdx = 0;
exports.default = new FileManager();

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ import type { IHeapEdge } from '../Types';

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ 'use strict';

@@ -9,5 +9,5 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/
import type { IHeapLocation } from '../Types';
import type { IHeapLocation, IHeapNode, Nullable } from '../Types';
import type HeapSnapshot from './HeapSnapshot';

@@ -19,2 +19,3 @@ export default class HeapLocation implements IHeapLocation {

get snapshot(): HeapSnapshot;
get node(): Nullable<IHeapNode>;
get script_id(): number;

@@ -21,0 +22,0 @@ get line(): number;

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -22,2 +22,9 @@ 'use strict';

}
get node() {
const heapSnapshot = this.heapSnapshot;
const locations = heapSnapshot.snapshot.locations;
const locationFieldsCount = heapSnapshot._locationFieldsCount;
const objectIndex = locations[this.idx * locationFieldsCount + heapSnapshot._locationObjectIndexOffset];
return heapSnapshot.nodes.get(objectIndex);
}
get script_id() {

@@ -24,0 +31,0 @@ const heapSnapshot = this.heapSnapshot;

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ import type { IHeapNode, IHeapEdge, Nullable, EdgeIterationCallback, Predicator, IHeapStringNode } from '../Types';

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -261,3 +261,3 @@ 'use strict';

const locationIdx = heapSnapshot._nodeIdx2LocationIdx[this.idx];
if (locationIdx === undefined) {
if (locationIdx == null) {
return null;

@@ -264,0 +264,0 @@ }

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ import type { IHeapNode, IHeapNodes, IHeapEdges, IHeapSnapshot, HeapNodeTypes, HeapEdgeTypes, HeapSnapshotMeta, RawHeapSnapshot, NumericDictionary, Nullable } from '../Types';

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ 'use strict';

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ import type { IHeapStringNode } from '../Types';

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ 'use strict';

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ export declare const NodeDetachState: {

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ 'use strict';

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { AnyValue, IHeapSnapshot } from '../Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { E2EStepInfo, HeapNodeIdSet, IHeapNode, IHeapSnapshot, IMemoryAnalystOptions, IMemoryAnalystSnapshotDiff, LeakTracePathItem, Optional, IOveralLeakInfo, TraceCluster, ISerializedInfo } from './Types';

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ 'use strict';

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ import type { IHeapSnapshot } from './Types';

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ 'use strict';

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ /** @internal */

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { MemLabConfig } from '../Config';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import { ILeakObjectFilterRule } from './BaseLeakFilter.rule';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { MemLabConfig } from '../Config';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { MemLabConfig } from '../../Config';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { MemLabConfig } from '../../Config';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { MemLabConfig } from '../../Config';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { MemLabConfig } from '../../Config';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { MemLabConfig } from '../../Config';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { MemLabConfig } from '../../Config';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { MemLabConfig } from '../../Config';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { IHeapSnapshot } from './Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -23,3 +23,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -26,0 +26,0 @@ const fs_extra_1 = __importDefault(require("fs-extra"));

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { Command, Optional } from './Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import { E2EStepInfo, HeapNodeIdSet, IHeapEdge, IHeapNode, IHeapSnapshot, ISerializedInfo, LeakTracePathItem, Nullable } from './Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -140,7 +140,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

}
function JSONifyNodeShallow(node) {
// double check when you try to call JSONify methods
// other than JSONifyNodeShallow and JSONifyNodeInShort inside this method
// as it may trigger infinite recursion
function JSONifyNodeShallow(node, options = {}) {
const info = Object.create(null);
options.processedNodeId = options.processedNodeId || new Set();
options.processedNodeId.add(node.id);
iterateSelectedEdges(node, (edge) => {
var _a;
const key = JSONifyEdgeNameAndType(edge);
if (objectNodeUsefulProps.has(edge.name_or_index)) {
if (!((_a = options.processedNodeId) === null || _a === void 0 ? void 0 : _a.has(edge.toNode.id)) &&
objectNodeUsefulProps.has(edge.name_or_index)) {
info[key] = JSONifyNodeShallow(edge.toNode);

@@ -153,2 +160,3 @@ }

});
options.processedNodeId.delete(node.id);
return info;

@@ -330,5 +338,11 @@ }

let info;
// defense against infinite recursion
if (options.processedNodeId.has(node.id)) {
info = JSONifyNodeShallow(node);
return info;
}
options.processedNodeId.add(node.id);
const depths = options.forceJSONifyDepth;
if (Utils_1.default.isDetachedDOMNode(node) && depths !== 0) {
info = JSONifyDetachedHTMLElement(node, args, EMPTY_JSONIFY_OPTIONS);
info = JSONifyDetachedHTMLElement(node, args, Object.assign(Object.assign({}, EMPTY_JSONIFY_OPTIONS), { processedNodeId: options.processedNodeId }));
}

@@ -356,2 +370,3 @@ else if (Utils_1.default.isFiberNode(node) && depths !== 0) {

}
options.processedNodeId.delete(node.id);
if (node.location) {

@@ -384,3 +399,3 @@ info[`${filterJSONPropName('allocation location (extra)')}`] = {

ret['$tabsOrder:' + JSONifyTabsOrder()] = '';
ret[`${idx++}: ${getNodeNameInJSON(path.node, args)}`] = JSONifyNode(path.node, args, EMPTY_JSONIFY_OPTIONS);
ret[`${idx++}: ${getNodeNameInJSON(path.node, args)}`] = JSONifyNode(path.node, args, Object.assign(Object.assign({}, EMPTY_JSONIFY_OPTIONS), { processedNodeId: new Set() }));
let pathItem = path;

@@ -395,3 +410,3 @@ while (pathItem === null || pathItem === void 0 ? void 0 : pathItem.edge) {

const edgeRetainSize = pathItem.edgeRetainSize;
ret[`${idx++}: ${getEdgeNameInJSON(edge, edgeRetainSize)}${getNodeNameInJSON(nextNode, args)}`] = JSONifyNode(nextNode, args, EMPTY_JSONIFY_OPTIONS);
ret[`${idx++}: ${getEdgeNameInJSON(edge, edgeRetainSize)}${getNodeNameInJSON(nextNode, args)}`] = JSONifyNode(nextNode, args, Object.assign(Object.assign({}, EMPTY_JSONIFY_OPTIONS), { processedNodeId: new Set() }));
pathItem = pathItem.next;

@@ -398,0 +413,0 @@ }

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ /// <reference types="node" />

@@ -9,3 +9,3 @@ /**

* @lightSyntaxTransform
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ 'use strict';

@@ -9,5 +9,5 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", { value: true });

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -125,2 +125,3 @@ import type { HaltOrThrowOptions } from './Types';

declare function getUniqueID(): string;
declare function getClosureSourceUrl(node: IHeapNode): Nullable<string>;
declare const _default: {

@@ -141,2 +142,3 @@ applyToNodes: typeof applyToNodes;

getAllDominators: typeof getAllDominators;
getClosureSourceUrl: typeof getClosureSourceUrl;
getConditionalDominatorIds: typeof getConditionalDominatorIds;

@@ -143,0 +145,0 @@ getError: typeof getError;

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -488,3 +488,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {

(s.leakFilter && typeof s.leakFilter !== 'function') ||
(s.beforeLeakFilter && typeof s.beforeLeakFilter !== 'function')) {
(s.beforeLeakFilter && typeof s.beforeLeakFilter !== 'function') ||
(s.beforeInitialPageLoad &&
typeof s.beforeInitialPageLoad !== 'function') ||
(s.setup && typeof s.setup !== 'function')) {
throw new Error('Invalid senario');

@@ -891,2 +894,7 @@ }

}
// if the path has pattern: Pending activitiies -> DetachedElement
if (Config_1.default.hideBrowserLeak &&
pendingActivitiesRetainsDetachedElementChain(p)) {
return false;
}
return true;

@@ -971,2 +979,25 @@ }

}
function pendingActivitiesRetainsDetachedElementChain(path) {
let p = path;
// find the Pending activities
while (p && p.node && !isPendingActivityNode(p.node)) {
p = p.next;
if (!p) {
return false;
}
}
p = p.next;
if (!p || !p.node) {
return false;
}
// all the following reference chain is detached DOM elements
// pointing to other detached DOM elements
while (p && p.node) {
if (!isDetachedDOMNode(p.node)) {
return false;
}
p = p.next;
}
return true;
}
function pathHasDetachedHTMLNode(path) {

@@ -1702,2 +1733,21 @@ if (!path) {

}
// try to get the url that defines the closure function
// this is particular to heap snapshot taken from V8 in Chromium
function getClosureSourceUrl(node) {
var _a, _b;
if (node.type !== 'closure') {
return null;
}
const shared = node.getReferenceNode('shared', 'internal');
if (!shared) {
return null;
}
const debug = shared.getReferenceNode('script_or_debug_info', 'internal');
if (!debug) {
return null;
}
const urlNode = debug.getReferenceNode('name', 'internal');
const url = (_b = (_a = urlNode === null || urlNode === void 0 ? void 0 : urlNode.toStringNode()) === null || _a === void 0 ? void 0 : _a.stringValue) !== null && _b !== void 0 ? _b : null;
return url;
}
exports.default = {

@@ -1718,2 +1768,3 @@ applyToNodes,

getAllDominators,
getClosureSourceUrl,
getConditionalDominatorIds,

@@ -1720,0 +1771,0 @@ getError,

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import { E2EStepInfo, TraceCluster, TraceClusterDiff, TraceClusterMetaInfo } from '../lib/Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { IHeapSnapshot, ISerializedInfo, LeakTracePathItem, Nullable } from '../lib/Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { E2EStepInfo, Config, IE2EScenarioVisitPlan, Optional } from '../lib/Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import BaseMode from './BaseMode';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import BaseMode from './BaseMode';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { Config, IRunningMode } from '../lib/Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { AnyOptions, HeapNodeIdSet, IHeapEdge, IHeapNode, IHeapSnapshot, LeakTracePathItem, Nullable, Optional, Predicator } from '../lib/Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ declare const _default: {

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ declare const _default: {

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { AnyValue, LeakTraceElement, LeakTrace } from '../lib/Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ declare type ClusteredLeakTraces = Record<string, string>;

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { LeakTrace } from '../lib/Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,5 +8,5 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/
export declare const distance: (tfidfs: Record<string, number>[]) => Float32Array;
//# sourceMappingURL=DistanceMatrix.d.ts.map

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ /**

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -8,5 +8,5 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/
export declare function nGram(n: number, terms: string[]): string[];
//# sourceMappingURL=Ngram.d.ts.map

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ interface TfidfVectorizerProps {

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { IClusterStrategy, LeakTrace, TraceDiff } from '../../lib/Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { IClusterStrategy, LeakTrace, TraceDiff } from '../../lib/Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { IClusterStrategy, LeakTrace, TraceDiff } from '../../lib/Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { IHeapNode, IHeapSnapshot, LeakTrace, LeakTracePathItem, Optional, TraceCluster, TraceClusterDiff, IClusterStrategy } from '../lib/Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -8,3 +8,3 @@ /**

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -11,0 +11,0 @@ import type { EdgeIterationCallback, IHeapEdge, IHeapLocation, IHeapNode, IHeapSnapshot, IHeapStringNode, Nullable } from '../lib/Types';

@@ -9,3 +9,3 @@ "use strict";

* @format
* @oncall ws_labs
* @oncall web_perf_infra
*/

@@ -12,0 +12,0 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

{
"name": "@memlab/core",
"version": "1.1.12",
"version": "1.1.14",
"license": "MIT",

@@ -56,3 +56,3 @@ "description": "memlab core libraries",

"type": "git",
"url": "git+https://github.com/facebookincubator/memlab.git",
"url": "git+https://github.com/facebook/memlab.git",
"directory": "packages/core"

@@ -67,5 +67,5 @@ },

"bugs": {
"url": "https://github.com/facebookincubator/memlab/issues"
"url": "https://github.com/facebook/memlab/issues"
},
"homepage": "https://github.com/facebookincubator/memlab#readme"
"homepage": "https://github.com/facebook/memlab#readme"
}

@@ -6,3 +6,3 @@ ## memlab Core Library

## Online Resources
* [Official Website and Demo](https://facebookincubator.github.io/memlab)
* [Documentation](https://facebookincubator.github.io/memlab/docs/intro)
* [Official Website and Demo](https://facebook.github.io/memlab)
* [Documentation](https://facebook.github.io/memlab/docs/intro)

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc