[TASK] Finished Day 1

This commit is contained in:
2021-12-01 23:57:22 +01:00
parent 0d3991428f
commit e710494170
4 changed files with 24 additions and 11 deletions

View File

@@ -1,18 +1,16 @@
import {Request} from "firebase-functions/lib/common/providers/https";
import { Request } from "firebase-functions";
class Utils {
static parseInput(request: Request): string[] {
const body = request.body;
if (typeof body === 'string') {
return body.split('\n');
if (typeof body === "string") {
return body.split("\n");
} else if (body.constructor === Array) {
return body;
} else {
throw Error("Invalid request");
}
}
}