summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/math/mt_rand.js.map
blob: fbd5a4dc25a62067ebc66b8c4981ce75574e62a2 (plain) (blame)
1
{"version":3,"sources":["../../../src/php/math/mt_rand.js"],"names":["module","exports","mt_rand","min","max","argc","arguments","length","Error","parseInt","Math","floor","random"],"mappings":";;AAAAA,OAAOC,OAAP,GAAiB,SAASC,OAAT,CAAkBC,GAAlB,EAAuBC,GAAvB,EAA4B;AAAE;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAIC,OAAOC,UAAUC,MAArB;AACA,MAAIF,SAAS,CAAb,EAAgB;AACdF,UAAM,CAAN;AACAC,UAAM,UAAN;AACD,GAHD,MAGO,IAAIC,SAAS,CAAb,EAAgB;AACrB,UAAM,IAAIG,KAAJ,CAAU,0DAAV,CAAN;AACD,GAFM,MAEA;AACLL,UAAMM,SAASN,GAAT,EAAc,EAAd,CAAN;AACAC,UAAMK,SAASL,GAAT,EAAc,EAAd,CAAN;AACD;AACD,SAAOM,KAAKC,KAAL,CAAWD,KAAKE,MAAL,MAAiBR,MAAMD,GAAN,GAAY,CAA7B,CAAX,IAA8CA,GAArD;AACD,CAnBD","file":"mt_rand.js","sourcesContent":["module.exports = function mt_rand (min, max) { // eslint-disable-line camelcase\n  //  discuss at: http://locutus.io/php/mt_rand/\n  // original by: Onno Marsman (https://twitter.com/onnomarsman)\n  // improved by: Brett Zamir (http://brett-zamir.me)\n  //    input by: Kongo\n  //   example 1: mt_rand(1, 1)\n  //   returns 1: 1\n\n  var argc = arguments.length\n  if (argc === 0) {\n    min = 0\n    max = 2147483647\n  } else if (argc === 1) {\n    throw new Error('Warning: mt_rand() expects exactly 2 parameters, 1 given')\n  } else {\n    min = parseInt(min, 10)\n    max = parseInt(max, 10)\n  }\n  return Math.floor(Math.random() * (max - min + 1)) + min\n}\n"]}