text: const { NotImplementedError } = require('../extensions/index.js');
  
  /**
   * Create a repeating string based on the given parameters
   *  
   * @param {String} str string to repeat
   * @param {Object} options options object 
   * @return {String} repeating string
   * 
   *
   * @example
   * 
   * repeater('STRING', { repeatTimes: 3, separator: '**', 
   * addition: 'PLUS', additionRepeatTimes: 3, additionSeparator: '00' })
   * => 'STRINGPLUS00PLUS00PLUS**STRINGPLUS00PLUS00PLUS**STRINGPLUS00PLUS00PLUS'
   *
   */
  
   //{repeatTimes, separator: '+', addition, additionRepeatTimes, additionSeparator: '|' } 
   function repeater(str, options) {
    let addArr 
    let addStr
  
    
       addArr = new Array(options.additionRepeatTimes)
       addArr.fill(String(options.addition))
       addStr = addArr.join(options.additionSeparator || '|');
      
  
       let resultArr = new Array(options.repeatTimes)
     if (addStr != 'undefined') {
       resultArr.fill(String(str) + addStr) } else {resultArr.fill(String(str))}
       let resultStr = resultArr.join(options.separator || '+');
       return resultStr
    }
  
  module.exports = {
    repeater
  };
  