UNPKG

question-generator

Version:

Package to generate interview style questions

43 lines (31 loc) 1.92 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.questionGenerator = factory()); }(this, (function () { 'use strict'; var sanitize = function sanitize(input) { var result = input; result = toLowerCase(result); result = trimString(result); return result; }; var toLowerCase = function toLowerCase(input) { return input.toLowerCase(); }; var trimString = function trimString(input) { return input.trim(); }; var interview = function interview(input) { if (!input) return ""; var keyword = sanitize(input); var questions = ["Would you consider to work with " + keyword + "?", "Would you be interested working with " + keyword + "?", "Would you consider work related to " + keyword + "?", "Would you enjoy work related to " + keyword + "?", "Would you want to pursue work related to " + keyword + "?", "Is working with " + keyword + " something that interests you?", "Is working with " + keyword + " something you would consider doing?", "Is working with " + keyword + " be something you would enjoy?", "Is working with " + keyword + " be something you want to do?", "Does working with " + keyword + " seem like something you would enjoy?", "Does working with " + keyword + " seem like something you would consider?", "Does working with " + keyword + " sound like something you are interested in?", "Have you ever shown interest in " + keyword + "?", "Have you ever considered working with " + keyword + "?", "Have you ever considered work in " + keyword + "?", "Have you ever had any interest working with " + keyword + "?"]; var getRandomIndex = function getRandomIndex() { return Math.floor(Math.random() * questions.length); }; return questions[getRandomIndex()]; }; var index = { interview: interview }; return index; })));