profiler-md 0.0.1 → 0.0.2

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/index.d.mts CHANGED
@@ -1,12 +1,12 @@
1
1
  //#region src/v8/common.d.ts
2
- /** A single call frame in a V8 profile as seen by callers. */
3
- type V8ProfileCallFrame = {
4
- /** The name of the function, or undefined for anonymous functions. */functionName?: string;
2
+ /** A single table row in a rendered V8 profile. */
3
+ type V8ProfileRow = {
4
+ /** The name of the entity corresponding to the row. */name: string;
5
5
  /**
6
6
  * The URL of the script this frame belongs to, or undefined if it's native
7
7
  * code.
8
8
  */
9
- url?: URL;
9
+ location?: string;
10
10
  };
11
11
  /** Options for V8 profile converters. */
12
12
  type V8ProfileToMdOptions = {
@@ -21,9 +21,9 @@ type V8ProfileToMdOptions = {
21
21
  *
22
22
  * Excluding a call frame does not exclude it from metric computations.
23
23
  *
24
- * Defaults to {@link defaultIncludeCallFrame}.
24
+ * Defaults to {@link defaultIncludeRow}.
25
25
  */
26
- includeCallFrame?: (callFrame: V8ProfileCallFrame) => boolean;
26
+ includeRow?: (row: V8ProfileRow) => boolean;
27
27
  /**
28
28
  * Whether the given URL points to third-party code.
29
29
  *
@@ -45,14 +45,17 @@ type V8ProfileToMdOptions = {
45
45
  cwd?: string | null;
46
46
  };
47
47
  /**
48
- * Returns whether to include the given call frame in the Markdown output.
48
+ * Returns whether to include the given row in the Markdown output.
49
49
  *
50
- * This is the default value for {@link V8ProfileToMdOptions.includeCallFrame}.
50
+ * This is the default value for {@link V8ProfileToMdOptions.includeRow}.
51
51
  *
52
- * It makes reasonable assumptions about which call frames are uninteresting to
52
+ * It makes reasonable assumptions about which rows are uninteresting to
53
53
  * display. For example, Node internals related to ESM loading are excluded.
54
54
  */
55
- declare const defaultIncludeCallFrame: (callFrame: V8ProfileCallFrame) => boolean;
55
+ declare const defaultIncludeRow: ({
56
+ name,
57
+ location
58
+ }: V8ProfileRow) => boolean;
56
59
  /**
57
60
  * Returns whether the given URL points to third-party code.
58
61
  *
@@ -107,4 +110,4 @@ declare const v8HeapProfileToMd: (data: string | Buffer, options?: V8ProfileToMd
107
110
  */
108
111
  declare const v8HeapSnapshotToMd: (data: string | Buffer, options?: V8ProfileToMdOptions) => string;
109
112
  //#endregion
110
- export { V8ProfileCallFrame, V8ProfileToMdOptions, defaultIncludeCallFrame, defaultIsThirdPartyURL, v8CpuProfileToMd, v8HeapProfileToMd, v8HeapSnapshotToMd };
113
+ export { V8ProfileRow, V8ProfileToMdOptions, defaultIncludeRow, defaultIsThirdPartyURL, v8CpuProfileToMd, v8HeapProfileToMd, v8HeapSnapshotToMd };