UNPKG

@janiscommerce/ui-native

Version:
13 lines (12 loc) 616 B
/** * Checks if the placeholder provided is single or compound and returns either the first two letters, * or the initials of the two first words. * @param {string} placeholder * @return {string} An array with the first two leters of the placeholder, or initials of the * first two words in uppercase * @example formatPlaceholder('Juan') // returns 'JU' * @example formatPlaceholder('Juan Perez') // returns 'JP' * @example formatPlaceholder('Juan Perez Rodriguez') // returns 'JP' * @example formatPlaceholder('') // returns '' */ export declare const formatPlaceholder: (placeholder?: string) => string;