Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const Chance = require('chance');
const express = require('express');
const matches = express.Router();
const constants = require('dotaconstants');
const matchPages = constants.match_pages;
const playerSlots = [0, 1, 2, 3, 4, 128, 129, 130, 131, 132];
const item_ids = Object.keys(constants.items);
const hero_ids = Object.keys(constants.heroes);
module.exports = function (db)
{
matches.get('/:player_id/:match_id/:info?', (req, res, cb) => {
console.time('hyperopia generate match');
db.first('personaname')
.from('players')
.where({
account_id: req.params.player_id,
})
.asCallback((err, p) => {
if (err)
{