vegan-ipsum
Version:
Generates passages of vegan-themed placeholder text suitable for use in web pages, graphics, and more. Works in the browser, NodeJS, and React Native.
32 lines (31 loc) • 1.22 kB
TypeScript
/**
* Capitalizes the first character of a given string after trimming whitespace.
*
* @param {string} str - The input string to capitalize.
*
* @returns {string} The input string with the first character capitalized.
*/
export declare const capitalize: (str: string) => string;
/**
* Creates an array of a specified length, where each element is its index.
*
* @param {number} length - The desired length of the array. Defaults to 0.
*
* @returns {number[]} An array of indexes from 0 to `length - 1`.
*/
export declare const rangeArray: (length?: number) => number[];
/**
* Creates an array of strings of a specified length, using a provided string generator function.
*
* @param {number} length - The desired length of the array.
* @param {() => string} makeString - A function that generates a string for each element.
*
* @returns {string[]} An array of strings of the specified length.
*/
export declare const fillArrayWith: (length: number, makeString: () => string) => string[];
declare const _default: {
capitalize: (str: string) => string;
rangeArray: (length?: number) => number[];
fillArrayWith: (length: number, makeString: () => string) => string[];
};
export default _default;