Skip to content

Commit

Permalink
lint: fix tsc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Sep 4, 2021
1 parent 97b62f7 commit 7de4c7a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as Ads from './ads';
import server from './server';
dotenv.config();

const PORT = process.env.PORT || 1228;
const { PORT = 1228 } = process.env;

Ads.startup();

Expand Down
6 changes: 4 additions & 2 deletions app/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ import { Server } from 'socket.io';
import { logger } from '../logger';
import setRoutes from './routes';

const { CORS = 'http://localhost:1227' } = process.env;

const app = express();
const http = createServer(app);
export const io = new Server(http, {
cors: { origin: process.env.CORS || 'http://localhost:1227' }
cors: { origin: CORS }
});

app.use(cors({ origin: process.env.CORS || 'http://localhost:1227' }));
app.use(cors({ origin: CORS }));

setRoutes(app);

Expand Down
4 changes: 2 additions & 2 deletions app/src/steam/currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function replaceInvalid(str: string) {
function currency(
name: string,
currencyId: number,
/* [index at pos 0, index at last pos] */ [a, b]: number[]
[a, b]: [number, number]
): ICurrency {
return {
name,
Expand All @@ -33,7 +33,7 @@ function currency(
}

export function getCurrency(id: number): ICurrency {
for (let obj of Object.keys(CURRENCIES)) {
for (let obj of Object.keys(CURRENCIES) as (keyof typeof CURRENCIES)[]) {
const currency: ICurrency = CURRENCIES[obj];
if (currency.currencyId === id) {
return currency;
Expand Down

0 comments on commit 7de4c7a

Please sign in to comment.