UNPKG

generate-useragent-node

Version:
12 lines 437 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.userAgentFactory = userAgentFactory; const Chance = require("chance"); const devices = require("./useragent.json"); function userAgentFactory(seed) { const count = Object.keys(devices).length; const chance = new Chance(seed); const pick = chance.integer({ min: 0, max: count }); return devices[pick]; } //# sourceMappingURL=index.js.map