@noeldemartin/faker
Version:
Generate massive amounts of fake contextual data
2 lines (1 loc) • 1.97 kB
JavaScript
;var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var u=(n,e)=>{for(var t in e)i(n,t,{get:e[t],enumerable:!0})},f=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of l(e))!h.call(n,s)&&s!==t&&i(n,s,{get:()=>e[s],enumerable:!(o=m(e,s))||o.enumerable});return n};var g=n=>f(i({},"__esModule",{value:!0}),n);var b={};u(b,{WordModule:()=>a});module.exports=g(b);var r=require("./filterWordListByLength");class a{constructor(e){this.faker=e;for(const t of Object.getOwnPropertyNames(a.prototype))t==="constructor"||typeof this[t]!="function"||(this[t]=this[t].bind(this))}adjective(e={}){const t=typeof e=="number"?{length:e}:e;return this.faker.helpers.arrayElement((0,r.filterWordListByLength)({...t,wordList:this.faker.definitions.word.adjective}))}adverb(e={}){const t=typeof e=="number"?{length:e}:e;return this.faker.helpers.arrayElement((0,r.filterWordListByLength)({...t,wordList:this.faker.definitions.word.adverb}))}conjunction(e={}){const t=typeof e=="number"?{length:e}:e;return this.faker.helpers.arrayElement((0,r.filterWordListByLength)({...t,wordList:this.faker.definitions.word.conjunction}))}interjection(e={}){const t=typeof e=="number"?{length:e}:e;return this.faker.helpers.arrayElement((0,r.filterWordListByLength)({...t,wordList:this.faker.definitions.word.interjection}))}noun(e={}){const t=typeof e=="number"?{length:e}:e;return this.faker.helpers.arrayElement((0,r.filterWordListByLength)({...t,wordList:this.faker.definitions.word.noun}))}preposition(e={}){const t=typeof e=="number"?{length:e}:e;return this.faker.helpers.arrayElement((0,r.filterWordListByLength)({...t,wordList:this.faker.definitions.word.preposition}))}verb(e={}){const t=typeof e=="number"?{length:e}:e;return this.faker.helpers.arrayElement((0,r.filterWordListByLength)({...t,wordList:this.faker.definitions.word.verb}))}}0&&(module.exports={WordModule});