Date doesn't have to be type explicit

This commit is contained in:
Milan Steiner 2022-02-16 15:08:24 +01:00
parent a9bc07d4be
commit 5f0678764b

View File

@ -65,7 +65,7 @@ export class Webserver {
throw new HttpError(400, "Address is not in the expected format for this chain."); throw new HttpError(400, "Address is not in the expected format for this chain.");
} }
const entry: Date | undefined = this.addressCounter.get(address); const entry = this.addressCounter.get(address);
if (entry !== undefined) { if (entry !== undefined) {
if (entry.getDate() + 24 * 3600 > Date.now()) { if (entry.getDate() + 24 * 3600 > Date.now()) {
throw new HttpError( throw new HttpError(
@ -75,7 +75,7 @@ export class Webserver {
} }
} }
const availableTokens: string[] = await faucet.availableTokens(); const availableTokens = await faucet.availableTokens();
const matchingDenom = availableTokens.find((availableDenom) => availableDenom === denom); const matchingDenom = availableTokens.find((availableDenom) => availableDenom === denom);
if (matchingDenom === undefined) { if (matchingDenom === undefined) {
throw new HttpError(422, `Token is not available. Available tokens are: ${availableTokens}`); throw new HttpError(422, `Token is not available. Available tokens are: ${availableTokens}`);