UNPKG

xe-utils

Version:

JavaScript 函数库、工具类

12 lines (9 loc) 312 B
import staticParseInt from './staticParseInt' function helperStringRepeat (str, count) { if (str.repeat) { return str.repeat(count) } var list = isNaN(count) ? [] : new Array(staticParseInt(count)) return list.join(str) + (list.length > 0 ? str : '') } export default helperStringRepeat