mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Enhance definition for heapdump (#24927)
* Enhance definition and according tests for heapdump * Add changes to fix the CI
This commit is contained in:
committed by
Ryan Cavanaugh
parent
0bab723bac
commit
ed43fdd5b7
@@ -1,9 +1,20 @@
|
||||
import * as heapdump from 'heapdump';
|
||||
|
||||
heapdump.writeSnapshot('/tmp/myDump', (err) => {
|
||||
if (err) {
|
||||
console.log('Failed to dump heap: ' + err);
|
||||
} else {
|
||||
console.log('Successfully dumped heap!');
|
||||
}
|
||||
let strValue = "";
|
||||
let errValue = new Error(strValue);
|
||||
let nullValue = null;
|
||||
let undefinedValue;
|
||||
|
||||
heapdump.writeSnapshot(strValue, (err, filename) => {
|
||||
errValue = err as Error;
|
||||
nullValue = err as null;
|
||||
strValue = filename as string;
|
||||
undefinedValue = filename as undefined;
|
||||
});
|
||||
|
||||
heapdump.writeSnapshot((err, filename) => {
|
||||
errValue = err as Error;
|
||||
nullValue = err as null;
|
||||
strValue = filename as string;
|
||||
undefinedValue = filename as undefined;
|
||||
});
|
||||
|
||||
Vendored
+3
-1
@@ -2,5 +2,7 @@
|
||||
// Project: https://github.com/bnoordhuis/node-heapdump
|
||||
// Definitions by: weekens <https://github.com/weekens>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export function writeSnapshot(dumpFileName: string, callback: (err?: Error) => void): void;
|
||||
export function writeSnapshot(dumpFileName?: string, callback?: (err: Error | null, filename: string | undefined) => void): void;
|
||||
export function writeSnapshot(callback: (err: Error | null, filename: string | undefined) => void): void;
|
||||
|
||||
Reference in New Issue
Block a user