@oaklean/profiler-core
Version:
Part of the @oaklean suite. It provides all basic functions to work with the `.oak` file format. It allows parsing the `.oak` file format as well as tools for analyzing the measurement values. It also provides all necessary capabilities required for prec
20 lines (19 loc) • 852 B
TypeScript
type ObjectPath<T, Prefix extends string[] = []> = {
[K in keyof T]: K extends string ? T[K] extends object | undefined ? NonNullable<T[K]> extends object ? [...Prefix, K] | ObjectPath<NonNullable<T[K]>, [...Prefix, K]> : [...Prefix, K] : [...Prefix, K] : never;
}[keyof T];
export declare class JsoncHelper<T extends object> {
private _commentedJsoncContent;
constructor(commentedJsoncContent: string);
toString(): string;
toJSON(): T;
updateJsoncContent(changes: T): this;
sortKeys(options?: {
comparator?: (a: string, b: string) => number;
deep?: boolean;
}): void;
format(): this;
getCommentIfPossible(path: ObjectPath<T>): string | undefined;
setCommentIfPossible(path: ObjectPath<T>, comment: string): void;
static highlightJsoncComments(jsoncContent: string): string;
}
export {};