UNPKG

asana-phrase

Version:

Random error phrase generator used by Asana

1 lines 18.8 kB
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.AsanaPhrase=e()}}(function(){return function e(t,r,n){function o(s,a){if(!r[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[s]={exports:{}};t[s][0].call(c.exports,function(e){var r=t[s][1][e];return o(r?r:e)},c,c.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(e,t,r){var n=e("./lib/factory"),o=e("./lib/dictionary"),i=e("./lib/number_range"),s=e("./lib/word_generator"),a=e("./lib/dictionaries"),u=new n([new i(5,2),new o(a.adjectives),new o(a.subjects),new o(a.verbs),new o(a.adverbs)]);t.exports={default32BitFactory:function(){return u},Factory:n,WordGenerator:s,Dictionary:o,NumberRange:i,dictionaries:a}},{"./lib/dictionaries":3,"./lib/dictionary":4,"./lib/factory":5,"./lib/number_range":6,"./lib/word_generator":7}],2:[function(e,t,r){function n(e){a.equal(typeof e,"number");var t=e;return function(){return t>0?(t--,Math.random()>=.5?1:0):null}}function o(e){a.equal(typeof e,"number"),a.equal(e,Math.floor(e),"value is not an integer"),a(e<Math.pow(2,53),"value too large to be integer");var t=!1,r=e;return function(){if(r>0||!t){var e=r%2;return r>>=1,t=!0,e}return null}}function i(e){a.equal(typeof e,"string"),a(/^[0-9a-fA-F]+$/.test(e),"value is not a hex number");var t=!1,r=e,n=0,o=0;return function(){if(n++%4===0&&r.length>0&&(o=parseInt(r.substr(-1),16),r=r.substr(0,r.length-1)),o>0||r.length>0||!t){var e=o%2;return o>>=1,t=!0,e}return null}}function s(e){a.equal(typeof e,"string"),a(/^[01]+$/.test(e),"value is not a string of binary digits");var t=!1,r=e;return function(){var e=0;return r?(e=r.charCodeAt(r.length-1)-48,r=r.substr(0,r.length-1),t=!0,e):t?null:(t=!0,0)}}var a=e("assert");t.exports={random:n,"int":o,hex:i,binaryDigit:s}},{assert:8}],3:[function(e,t,r){var n=["aardvarks","alpacas","ants","apes","baboons","badgers","bats","bears","beavers","bees","birds","bison","bobcats","bullfrogs","bulls","bunnies","buzzards","camels","catfish","cats","cattle","cheetahs","chickens","chipmunks","cobras","cougars","crabs","crickets","crows","deer","dogs","dolphins","donkeys","doves","ducks","eagles","eels","elephants","elk","emus","ewoks","falcons","ferrets","fish","fleas","flies","foxes","frogs","gazelle","geese","gerbils","giraffes","goats","goblins","gorillas","groundhogs","hawks","hippos","hogs","horses","hounds","jackals","jaguars","kittens","klingons","lambs","leeches","lemmings","leopards","ligers","lions","lizards","llamas","lobsters","marmots","mice","monkeys","moose","mules","newts","orcs","otters","owls","oysters","pandas","peacocks","penguins","pidgeons","pigs","pumas","puppies","quails","rabbits","raccoons","rats","reindeer","rhinos","roosters","salmon","seals","sharks","sheep","shrimp","skunks","slugs","snails","snakes","spiders","squid","squirrels","starfish","stingrays","swans","tigers","toads","trout","tuna","turkeys","turtles","urchins","vipers","vultures","warthogs","whales","wolves","woodchucks","yaks","zebras"],o=["awful","bad","bashful","berserk","big","bizarre","black","blue","boring","brawny","bright","bumpy","burly","cagey","cheerful","chilly","chubby","classy","clumsy","cold","crazy","creepy","cuddly","dashing","dirty","dizzy","drunk","dry","dull","dusty","eager","evil","fancy","fast","fat","faulty","fearless","filthy","foamy","friendly","funny","gentle","giant","glossy","good","goofy","great","greedy","green","groovy","grumpy","guilty","hairy","handsome","happy","healthy","heavy","helpful","high","huge","hungry","icky","itchy","jazzy","jealous","jolly","jumpy","kind","large","lazy","lean","little","lively","lucky","macho","magenta","magic","massive","meek","mighty","mindless","nasty","needy","new","nice","noisy","odd","old","orange","pretty","prickly","proud","puffy","purple","quick","quiet","rabid","rebel","red","righteous","round","sad","sassy","scary","sedate","shallow","short","silly","skillful","skinny","sloppy","slow","small","smelly","sneaky","snobby","strange","tacky","tall","tan","tough","tricky","ugly","wicked","wise","yellow","young","zany"],i=["agree","applaud","argue","arise","arrive","attack","awaken","bake","bathe","beg","behave","bite","blink","blush","bounce","breathe","burrow","buzz","charge","chat","cheer","chuckle","chew","clap","cry","dance","dig","dive","drink","eat","feed","fight","flap","flee","float","fly","gather","glow","grunt","hang","hide","howl","hunt","itch","jog","joke","jostle","jump","kick","kneel","knit","krump","laugh","leap","leave","look","lope","march","mix","moan","nuzzle","observe","plan","play","plead","point","pray","punch","push","race","rejoice","relax","retire","return","roar","rub","rumble","run","rush","sail","scare","scrape","scratch","scream","scrub","search","shake","shiver","shrink","shrug","sigh","sing","sit","skip","slap","sleep","slide","slip","smash","snore","spar","speak","spit","stand","stare","step","sting","stomp","stretch","strike","study","stumble","swim","talk","think","tickle","travel","trot","twist","wait","walk","wander","watch","wave","whine","whisper","work","wriggle"],s=["ably","always","angrily","badly","blindly","boldly","bravely","briefly","brightly","busily","calmly","clearly","cruelly","daily","easily","equally","exactly","fast","fiercely","fondly","gently","gladly","greedily","happily","hastily","honestly","hourly","hungrily","joyously","justly","kindly","lazily","loosely","loudly","madly","merrily","monthly","neatly","often","poorly","promptly","quickly","quietly","rarely","roughly","rudely","sadly","safely","sharply","shyly","slowly","smoothly","softly","soon","sternly","swiftly","tensely","tightly","too","warmly","weakly","well","wildly","yearly"];t.exports={subjects:n,adjectives:o,verbs:i,adverbs:s}},{}],4:[function(e,t,r){function n(e){var t=e.length;this._numBits=0;for(var r=t;r>1;r>>=1){if(r%2===1)throw new Error("Dictionary size is not an even power of two: "+t);this._numBits++}i.equal(e.length,this.size()),this._words=e}var o=e("./word_generator"),i=e("assert"),s=e("util");s.inherits(n,o),n.prototype.numBits=function(){return this._numBits},n.prototype.word=function(e){return i.equal(typeof e,"number"),i(e>=0),i(e<this.size()),""+this._words[e]},t.exports=n},{"./word_generator":7,assert:8,util:12}],5:[function(e,t,r){function n(e){var t=0;e.forEach(function(e){o(e instanceof s),t+=e.numBits()}),o(t>0),this.generators=e,this._numBits=t}var o=e("assert"),i=e("./bit_generator"),s=e("./word_generator");n.prototype.randomPhrase=function(){return this.phraseFromBits(i.random(this._numBits))},n.prototype.phraseFromInt=function(e){return this.phraseFromBits(i["int"](e))},n.prototype.phraseFromHex=function(e){return this.phraseFromBits(i.hex(e))},n.prototype.phraseFromBits=function(e){o.equal(typeof e,"function");var t=[];return this.generators.forEach(function(r){for(var n=r.numBits(),o=0,i=0;n>i;i++){var s=e()||0;o+=s<<i,console.log(s,o)}t.push(r.word(o))}),t},n.prototype.numPossiblePhrases=function(){return Math.pow(2,this._numBits)},t.exports=n},{"./bit_generator":2,"./word_generator":7,assert:8}],6:[function(e,t,r){function n(e,t){this._numBits=e,this._offset=t||0}var o=e("./word_generator"),i=e("assert"),s=e("util");s.inherits(n,o),n.prototype.numBits=function(){return this._numBits},n.prototype.word=function(e){return i.equal(typeof e,"number"),i(e>=0),i(e<this.size()),""+(e+this._offset)},t.exports=n},{"./word_generator":7,assert:8,util:12}],7:[function(e,t,r){function n(){}n.prototype.numBits=function(){throw new Error("not implemented")},n.prototype.word=function(){throw new Error("not implemented")},n.prototype.size=function(){return 1<<this.numBits()},t.exports=n},{}],8:[function(e,t,r){function n(e,t){return y.isUndefined(t)?""+t:y.isNumber(t)&&!isFinite(t)?t.toString():y.isFunction(t)||y.isRegExp(t)?t.toString():t}function o(e,t){return y.isString(e)?e.length<t?e:e.slice(0,t):e}function i(e){return o(JSON.stringify(e.actual,n),128)+" "+e.operator+" "+o(JSON.stringify(e.expected,n),128)}function s(e,t,r,n,o){throw new d.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:o})}function a(e,t){e||s(e,!0,t,"==",d.ok)}function u(e,t){if(e===t)return!0;if(y.isBuffer(e)&&y.isBuffer(t)){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return y.isDate(e)&&y.isDate(t)?e.getTime()===t.getTime():y.isRegExp(e)&&y.isRegExp(t)?e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase:y.isObject(e)||y.isObject(t)?c(e,t):e==t}function l(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function c(e,t){if(y.isNullOrUndefined(e)||y.isNullOrUndefined(t))return!1;if(e.prototype!==t.prototype)return!1;if(y.isPrimitive(e)||y.isPrimitive(t))return e===t;var r=l(e),n=l(t);if(r&&!n||!r&&n)return!1;if(r)return e=g.call(e),t=g.call(t),u(e,t);var o,i,s=m(e),a=m(t);if(s.length!=a.length)return!1;for(s.sort(),a.sort(),i=s.length-1;i>=0;i--)if(s[i]!=a[i])return!1;for(i=s.length-1;i>=0;i--)if(o=s[i],!u(e[o],t[o]))return!1;return!0}function f(e,t){return e&&t?"[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t?!0:t.call({},e)===!0?!0:!1:!1}function p(e,t,r,n){var o;y.isString(r)&&(n=r,r=null);try{t()}catch(i){o=i}if(n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!o&&s(o,r,"Missing expected exception"+n),!e&&f(o,r)&&s(o,r,"Got unwanted exception"+n),e&&o&&r&&!f(o,r)||!e&&o)throw o}var y=e("util/"),g=Array.prototype.slice,h=Object.prototype.hasOwnProperty,d=t.exports=a;d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=i(this),this.generatedMessage=!0);var t=e.stackStartFunction||s;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,o=t.name,a=n.indexOf("\n"+o);if(a>=0){var u=n.indexOf("\n",a+1);n=n.substring(u+1)}this.stack=n}}},y.inherits(d.AssertionError,Error),d.fail=s,d.ok=a,d.equal=function(e,t,r){e!=t&&s(e,t,r,"==",d.equal)},d.notEqual=function(e,t,r){e==t&&s(e,t,r,"!=",d.notEqual)},d.deepEqual=function(e,t,r){u(e,t)||s(e,t,r,"deepEqual",d.deepEqual)},d.notDeepEqual=function(e,t,r){u(e,t)&&s(e,t,r,"notDeepEqual",d.notDeepEqual)},d.strictEqual=function(e,t,r){e!==t&&s(e,t,r,"===",d.strictEqual)},d.notStrictEqual=function(e,t,r){e===t&&s(e,t,r,"!==",d.notStrictEqual)},d["throws"]=function(e,t,r){p.apply(this,[!0].concat(g.call(arguments)))},d.doesNotThrow=function(e,t){p.apply(this,[!1].concat(g.call(arguments)))},d.ifError=function(e){if(e)throw e};var m=Object.keys||function(e){var t=[];for(var r in e)h.call(e,r)&&t.push(r);return t}},{"util/":12}],9:[function(e,t,r){t.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],10:[function(e,t,r){function n(){c=!1,a.length?l=a.concat(l):f=-1,l.length&&o()}function o(){if(!c){var e=setTimeout(n);c=!0;for(var t=l.length;t;){for(a=l,l=[];++f<t;)a[f].run();f=-1,t=l.length}a=null,c=!1,clearTimeout(e)}}function i(e,t){this.fun=e,this.array=t}function s(){}var a,u=t.exports={},l=[],c=!1,f=-1;u.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new i(e,t)),1!==l.length||c||setTimeout(o,0)},i.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=s,u.addListener=s,u.once=s,u.off=s,u.removeListener=s,u.removeAllListeners=s,u.emit=s,u.binding=function(e){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(e){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],11:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],12:[function(e,t,r){(function(t,n){function o(e,t){var n={seen:[],stylize:s};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),h(t)?n.showHidden=t:t&&r._extend(n,t),k(n.showHidden)&&(n.showHidden=!1),k(n.depth)&&(n.depth=2),k(n.colors)&&(n.colors=!1),k(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=i),u(n,e,n.depth)}function i(e,t){var r=o.styles[t];return r?"["+o.colors[r][0]+"m"+e+"["+o.colors[r][1]+"m":e}function s(e,t){return e}function a(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function u(e,t,n){if(e.customInspect&&t&&O(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(n,e);return w(o)||(o=u(e,o,n)),o}var i=l(e,t);if(i)return i;var s=Object.keys(t),h=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),z(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return c(t);if(0===s.length){if(O(t)){var d=t.name?": "+t.name:"";return e.stylize("[Function"+d+"]","special")}if(x(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(E(t))return e.stylize(Date.prototype.toString.call(t),"date");if(z(t))return c(t)}var m="",b=!1,v=["{","}"];if(g(t)&&(b=!0,v=["[","]"]),O(t)){var k=t.name?": "+t.name:"";m=" [Function"+k+"]"}if(x(t)&&(m=" "+RegExp.prototype.toString.call(t)),E(t)&&(m=" "+Date.prototype.toUTCString.call(t)),z(t)&&(m=" "+c(t)),0===s.length&&(!b||0==t.length))return v[0]+m+v[1];if(0>n)return x(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var j;return j=b?f(e,t,n,h,s):s.map(function(r){return p(e,t,n,h,r,b)}),e.seen.pop(),y(j,m,v)}function l(e,t){if(k(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):h(t)?e.stylize(""+t,"boolean"):d(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,r,n,o){for(var i=[],s=0,a=t.length;a>s;++s)i.push(D(t,String(s))?p(e,t,r,n,String(s),!0):"");return o.forEach(function(o){o.match(/^\d+$/)||i.push(p(e,t,r,n,o,!0))}),i}function p(e,t,r,n,o,i){var s,a,l;if(l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},l.get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),D(n,o)||(s="["+o+"]"),a||(e.seen.indexOf(l.value)<0?(a=d(r)?u(e,l.value,null):u(e,l.value,r-1),a.indexOf("\n")>-1&&(a=i?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),k(s)){if(i&&o.match(/^\d+$/))return a;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function y(e,t,r){var n=0,o=e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function g(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function d(e){return null===e}function m(e){return null==e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function v(e){return"symbol"==typeof e}function k(e){return void 0===e}function x(e){return j(e)&&"[object RegExp]"===q(e)}function j(e){return"object"==typeof e&&null!==e}function E(e){return j(e)&&"[object Date]"===q(e)}function z(e){return j(e)&&("[object Error]"===q(e)||e instanceof Error)}function O(e){return"function"==typeof e}function S(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function q(e){return Object.prototype.toString.call(e)}function _(e){return 10>e?"0"+e.toString(10):e.toString(10)}function B(){var e=new Date,t=[_(e.getHours()),_(e.getMinutes()),_(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function D(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var N=/%[sdj%]/g;r.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(o(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,i=n.length,s=String(e).replace(N,function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}}),a=n[r];i>r;a=n[++r])s+=d(a)||!j(a)?" "+a:" "+o(a);return s},r.deprecate=function(e,o){function i(){if(!s){if(t.throwDeprecation)throw new Error(o);t.traceDeprecation?console.trace(o):console.error(o),s=!0}return e.apply(this,arguments)}if(k(n.process))return function(){return r.deprecate(e,o).apply(this,arguments)};if(t.noDeprecation===!0)return e;var s=!1;return i};var A,F={};r.debuglog=function(e){if(k(A)&&(A=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!F[e])if(new RegExp("\\b"+e+"\\b","i").test(A)){var n=t.pid;F[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else F[e]=function(){};return F[e]},r.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=g,r.isBoolean=h,r.isNull=d,r.isNullOrUndefined=m,r.isNumber=b,r.isString=w,r.isSymbol=v,r.isUndefined=k,r.isRegExp=x,r.isObject=j,r.isDate=E,r.isError=z,r.isFunction=O,r.isPrimitive=S,r.isBuffer=e("./support/isBuffer");var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",B(),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!j(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":11,_process:10,inherits:9}]},{},[1])(1)});