UNPKG

@monstermann/fn

Version:

A utility library for TypeScript.

22 lines (20 loc) 390 B
import { dfdlT } from "@monstermann/dfdl"; //#region src/string/repeat.ts /** * `repeat(target, amount)` * * Repeats `target` string `amount` times. * * ```ts * repeat("hello", 3); // "hellohellohello" * ``` * * ```ts * pipe("hello", repeat(3)); // "hellohellohello" * ``` */ const repeat = dfdlT((target, amount) => { return target.repeat(amount); }, 2); //#endregion export { repeat };