fix functions failing to build due to typescript

This commit is contained in:
Sidney Alcantara
2020-08-20 17:54:31 +10:00
parent b617a2dcc3
commit e7e095ec57
2 changed files with 5 additions and 5 deletions

View File

@@ -12,10 +12,11 @@ import * as imagemin from "imagemin";
import * as imageminMozjpeg from "imagemin-mozjpeg";
import imageminPngquant from "imagemin-pngquant";
import config from "../functionConfig";
import config_ from "../functionConfig";
const SUPPORTED_TYPES = ["image/jpeg", "image/png"];
const DEFAULT_SIZES = ["400x400", "200x200", "100x100"];
const config: any = config_;
const sizes =
config && Array.isArray(config.sizes) && typeof config.sizes[0] === "string"
? config.sizes

View File

@@ -38,8 +38,7 @@ const syncSubCollection = async (
) => {
const targetDocs = await db.collection(targetPath).get();
if (targetDocs.empty) return false;
for (let i = 0; i < targetDocs.docs.length; i++) {
const doc = targetDocs.docs[i];
for (const doc of targetDocs.docs) {
await doc.ref.update({
[snapshotField]: {
docPath: snapshot.ref.path,
@@ -75,7 +74,7 @@ const syncDocSnapshot = async (
const snapshotDocPath = snapshot.ref.path;
const oldSnapshot = _.find(oldSnapshotsArray, { docPath: snapshotDocPath });
const updatedSnapshotsArray = oldSnapshotsArray.filter(item => {
const updatedSnapshotsArray = oldSnapshotsArray.filter((item) => {
console.log({ snapshotDocPath, item });
return item.docPath !== snapshotDocPath;
});
@@ -156,7 +155,7 @@ const syncDocOnUpdate = (config: {
* returns 2 different trigger functions (onCreate,onUpdate) in an object
* @param config configuration object
*/
const snapshotSyncFnsGenerator = config =>
const snapshotSyncFnsGenerator = (config) =>
Object.entries({
onUpdate: config.onUpdate
? functions.firestore