@monstermann/fn
Version:
A utility library for TypeScript.
23 lines (21 loc) • 499 B
TypeScript
import { Repeat } from "string-ts";
//#region src/string/repeat.d.ts
/**
* `repeat(target, amount)`
*
* Repeats `target` string `amount` times.
*
* ```ts
* repeat("hello", 3); // "hellohellohello"
* ```
*
* ```ts
* pipe("hello", repeat(3)); // "hellohellohello"
* ```
*/
declare const repeat: {
<U extends number>(amount: U): <T extends string>(target: T) => Repeat<T, U>;
<T extends string, U extends number>(target: T, amount: U): Repeat<T, U>;
};
//#endregion
export { repeat };