Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fs = require("fs");
const util = require("util");
const demo = require("../demo");
const player_1 = require("../entities/player");
const colourReplacements = [
{ pattern: /\x01/g, ansi: ansiStyles.whiteBright.open },
{ pattern: /\x02/g, ansi: ansiStyles.red.open },
{ pattern: /\x03/g, ansi: ansiStyles.magenta.open },
{ pattern: /\x04/g, ansi: ansiStyles.greenBright.open },
{ pattern: /\x05/g, ansi: ansiStyles.green.open },
{ pattern: /\x06/g, ansi: ansiStyles.greenBright.open },
{ pattern: /\x07/g, ansi: ansiStyles.redBright.open },
{ pattern: /\x08/g, ansi: ansiStyles.gray.open },
{ pattern: /\x09/g, ansi: ansiStyles.yellowBright.open },
{ pattern: /\x0A/g, ansi: ansiStyles.white.open },
{ pattern: /\x0B/g, ansi: ansiStyles.blueBright.open },
{ pattern: /\x0C/g, ansi: ansiStyles.blue.open },
{ pattern: /\x0D/g, ansi: ansiStyles.magenta.open },
{ pattern: /\x0E/g, ansi: ansiStyles.magentaBright.open },
{ pattern: /\x0F/g, ansi: ansiStyles.red.open },
{ pattern: /\x10/g, ansi: ansiStyles.yellow.open } // Orange
];
const standardMessages = {
Cstrike_Chat_All: "\x03%s\x01 : %s",
Cstrike_Chat_AllDead: "*DEAD* \x03%s\x01 : %s",
Game_connected: "%s connected."
};
function teamNumberToAnsi(teamNum) {
if (teamNum === 2 /* Terrorists */) {
return ansiStyles.redBright.open;
}
if (teamNum === 3 /* CounterTerrorists */) {
function teamNumberToAnsi(teamNum) {
if (teamNum === 2 /* Terrorists */) {
return ansiStyles.redBright.open;
}
if (teamNum === 3 /* CounterTerrorists */) {
return ansiStyles.blueBright.open;
}
return ansiStyles.gray.open;
}
function parseDemoFile(path) {