summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/strings/str_repeat.js.map
blob: 773b6b00efada239ea69861ab3ae5d5f9c4d1a83 (plain) (blame)
1
{"version":3,"sources":["../../../src/php/strings/str_repeat.js"],"names":["module","exports","str_repeat","input","multiplier","y"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,UAAT,CAAqBC,KAArB,EAA4BC,UAA5B,EAAwC;AAAE;AACzD;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,IAAI,EAAR;AACA,SAAO,IAAP,EAAa;AACX,QAAID,aAAa,CAAjB,EAAoB;AAClBC,WAAKF,KAAL;AACD;AACDC,mBAAe,CAAf;AACA,QAAIA,UAAJ,EAAgB;AACdD,eAASA,KAAT;AACD,KAFD,MAEO;AACL;AACD;AACF;AACD,SAAOE,CAAP;AACD,CArBD","file":"str_repeat.js","sourcesContent":["module.exports = function str_repeat (input, multiplier) { // eslint-disable-line camelcase\n  //  discuss at: http://locutus.io/php/str_repeat/\n  // original by: Kevin van Zonneveld (http://kvz.io)\n  // improved by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n  // improved by: Ian Carter (http://euona.com/)\n  //   example 1: str_repeat('-=', 10)\n  //   returns 1: '-=-=-=-=-=-=-=-=-=-='\n\n  var y = ''\n  while (true) {\n    if (multiplier & 1) {\n      y += input\n    }\n    multiplier >>= 1\n    if (multiplier) {\n      input += input\n    } else {\n      break\n    }\n  }\n  return y\n}\n"]}