@tduyng/prettyoutput
Version:
Library to format JSON objects into a colorful, YAML-style output. Ideal for pretty printing logs with high performance.
35 lines • 1.15 kB
TypeScript
import type { Color } from './definitions.js';
/**
* Creates a string with specified spaces count
* @param {number} spaceCount - space count
* @return {string}
*/
export declare const indent: (spaceCount: number) => string;
/**
* Gets longest string length
* @param {Array<string>} strings
* @return {number}
*/
export declare const maxLength: (strings: string[]) => number;
/**
*
* @param {string} input - single or multiline string
* @param {string} indentation - indentation space as string
* @return {string} - Indented multiline string
*/
export declare const alignString: (input: string, indentation: string) => string;
/**
*
* @param {string} input
* @param {string} color name
* @return {string} - colored string (for terminal output)
*/
export declare const colorString: (input: string, color?: Color) => string;
export declare const repeat: (string: string, count: number) => string;
/**
* Serializable values are boolean, number, null, Date, Single line strings, empty arrays
* @param {*} input
* @return {boolean}
*/
export declare const isSerializable: (input: unknown) => boolean;
//# sourceMappingURL=utils.d.ts.map