[TASK] Initial commit: basic firebase setup and part 1 almost solved (of-by-one)

This commit is contained in:
2021-12-01 09:23:36 +01:00
commit eb211e1ba3
18 changed files with 5033 additions and 0 deletions

19
functions/src/utils.ts Normal file
View File

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