applicationinsights
Version:
Microsoft Application Insights module for Node.js
46 lines (45 loc) • 1.38 kB
TypeScript
export declare class Util {
private static _instance;
private _listenerAttached;
isNodeExit: boolean;
static getInstance(): Util;
constructor();
/**
* helper method to trim strings (IE8 does not implement String.prototype.trim)
*/
trim(str: string): string;
/**
* Check if an object is of type Array
*/
isArray(obj: any): boolean;
/**
* Check if an object is of type Error
*/
isError(obj: any): boolean;
isPrimitive(input: any): boolean;
/**
* Check if an object is of type Date
*/
isDate(obj: any): boolean;
/**
* Convert milliseconds to Breeze expected time.
* @internal
*/
msToTimeSpan(ms: number): string;
/**
* Using JSON.stringify, by default Errors do not serialize to something useful:
* Simplify a generic Node Error into a simpler map for customDimensions
* Custom errors can still implement toJSON to override this functionality
*/
protected extractError(err: Error): {
message: string;
code: string;
};
isDbDependency(dependencyType: string): boolean;
/**
* Returns string representation of an object suitable for diagnostics diag.
*/
dumpObj(object: any): string;
stringify(payload: any): string;
private _addCloseHandler;
}