UNPKG

metal-band-names

Version:
138 lines (115 loc) 3.5 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["metalBandNames"] = factory(); else root["metalBandNames"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _uniqueRandomArray = __webpack_require__(1); var _uniqueRandomArray2 = _interopRequireDefault(_uniqueRandomArray); var _metalBandNames = __webpack_require__(3); var _metalBandNames2 = _interopRequireDefault(_metalBandNames); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var getRandomItem = (0, _uniqueRandomArray2.default)(_metalBandNames2.default); var mainExport = { all: _metalBandNames2.default, random: random }; function random(number) { if (number === undefined) { return getRandomItem(); } else { var randomItems = []; for (var i = 0; i < number; i++) { randomItems.push(getRandomItem()); } return randomItems; } } exports.default = mainExport; module.exports = mainExport; // for CommonJS compatibility /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; var uniqueRandom = __webpack_require__(2); module.exports = function (arr) { var rand = uniqueRandom(0, arr.length - 1); return function () { return arr[rand()]; }; }; /***/ }, /* 2 */ /***/ function(module, exports) { 'use strict'; module.exports = function (min, max) { var prev; return function rand() { var num = Math.floor(Math.random() * (max - min + 1) + min); return prev = num === prev && min !== max ? rand() : num; }; }; /***/ }, /* 3 */ /***/ function(module, exports) { module.exports = [ "Megadeth" ]; /***/ } /******/ ]) }); ; //# sourceMappingURL=index.umd.js.map