starwars-names
Version:
Get random Star Wars names
222 lines (202 loc) • 4.87 kB
JavaScript
(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["starWarsNames"] = factory();
else
root["starWarsNames"] = 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';
var _uniqueRandomArray = __webpack_require__(1);
var _uniqueRandomArray2 = _interopRequireDefault(_uniqueRandomArray);
var _starwarsNames = __webpack_require__(3);
var _starwarsNames2 = _interopRequireDefault(_starwarsNames);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var getRandomItem = (0, _uniqueRandomArray2.default)(_starwarsNames2.default);
module.exports = {
all: _starwarsNames2.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;
}
}
/***/ },
/* 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 = [
"4-LOM",
"Aayla Secura",
"Admiral Ackbar",
"Admiral Thrawn",
"Ahsoka Tano",
"Anakin Solo",
"Asajj Ventress",
"Aurra Sing",
"Senator Bail Organa",
"Barriss Offee",
"Bastila Shan",
"Ben Skywalker",
"Bib Fortuna",
"Biggs Darklighter",
"Boba Fett",
"Bossk",
"Brakiss",
"C-3PO",
"Cad Bane",
"Cade Skywalker",
"Callista Ming",
"Captain Rex",
"Carnor Jax",
"Chewbacca",
"Clone Commander Cody",
"Count Dooku",
"Darth Bane",
"Darth Krayt",
"Darth Maul",
"Darth Nihilus",
"Darth Vader",
"Dash Rendar",
"Dengar",
"Durge",
"Emperor Palpatine",
"Exar Kun",
"Galen Marek",
"General Crix Madine",
"General Dodonna",
"General Grievous",
"General Veers",
"Gilad Pellaeon",
"Grand Moff Tarkin",
"Greedo",
"Han Solo",
"IG 88",
"Jabba The Hutt",
"Jacen Solo",
"Jaina Solo",
"Jango Fett",
"Jarael",
"Jerec",
"Joruus C'Baoth",
"Ki-Adi-Mundi",
"Kir Kanos",
"Kit Fisto",
"Kyle Katarn",
"Kyp Durron",
"Lando Calrissian",
"Luke Skywalker",
"Luminara Unduli",
"Lumiya",
"Mace Windu",
"Mara Jade",
"Mission Vao",
"Natasi Daala",
"Nom Anor",
"Obi-Wan Kenobi",
"Padmé Amidala",
"Plo Koon",
"Pre Vizsla",
"Prince Xizor",
"Princess Leia",
"PROXY",
"Qui-Gon Jinn",
"Quinlan Vos",
"R2-D2",
"Rahm Kota",
"Revan",
"Satele Shan",
"Savage Opress",
"Sebulba",
"Shaak Ti",
"Shmi Skywalker",
"Talon Karrde",
"Ulic Qel-Droma",
"Visas Marr",
"Watto",
"Wedge Antilles",
"Yoda",
"Zam Wesell",
"Zayne Carrick",
"Zuckuss"
];
/***/ }
/******/ ])
});
;
//# sourceMappingURL=index.umd.js.map