@technobuddha/library
Version:
A large library of useful functions
14 lines (13 loc) • 443 B
TypeScript
export declare type Options = {
/** If true, the last block will be omitted if has insufficient characters **/
truncate?: boolean;
};
/**
* Break a string into equal sized segments of characters
*
* @param input The string to break apart
* @param length The length of each segment
* @returns Array of segments
*/
export declare function chop(input: string, length: number, { truncate }?: Options): string[];
export default chop;