@technobuddha/library
Version:
A large library of useful functions
13 lines (12 loc) • 319 B
JavaScript
/**
* Indent each line of a string
*
* @param input The string to indent
* @param __namedParameters see {@Options}
* @default indenter space
* @returns string with each line indented
*/
export function indent(input, { indenter = ' ' } = {}) {
return input.replace(/^/ugm, indenter);
}
export default indent;