[TASK] Finished Day 1
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user