UNPKG

@jungvonmatt/sb-migrate

Version:

CLI tool for managing Storyblok schema and content migrations

30 lines (29 loc) 1.04 kB
export declare const bloksEmpty: (bloks: any) => boolean; /** * Generates a preview string for various input types. * * @param {any} input - The input value to generate a preview for. Can be a string, number, array, or object. * @returns {Promise<string | number | any>} A preview representation of the input: * - For strings: Truncated string * - For numbers: The number as is * - For arrays: A string showing the preview of the first element in brackets * - For objects: A truncated JSON string representation * - For other types: The input value as is * * @example * // String input * await getPreview("This is a long string") // Returns truncated string * * @example * // Number input * await getPreview(42) // Returns 42 * * @example * // Array input * await getPreview(["item1", "item2"]) // Returns "[item1]" * * @example * // Object input * await getPreview({ key: "value" }) // Returns truncated JSON string */ export declare const getPreview: (input: any) => Promise<string | number | any>;