vue2-filters
Version:
A collection of Vue.js filters
14 lines (12 loc) • 307 B
JavaScript
/**
* Repeats a given value an x amount of times
*
* @author Bastiaan Jansen
* @param {string | number} value to repeat
* @param {number} amount
* @returns repeated string
*/
const repeat = (value, amount = 1) => {
return amount ? value.toString().repeat(amount) : '';
};
export default repeat;