Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (o instanceof ImageSeed) {
var bucket = admin.storage().bucket();
p.push(o.upload(bucket, parentDocID).then(url => {
filteredObject = url;
}));
} else if (o instanceof DocumentRefSeed) {
filteredObject = firestore.collection(o.collection).doc(o.document);
} else if (o instanceof SubcollectionSeed) {
const subcollectionRef = self.getCollection(firestore).doc(context.doc.id).collection(key!);
const subcollection = new CollectionSeed(o.docs, () => subcollectionRef);
filteredObject = DELETE;
context.postDocActions.push(() => subcollection.importDocuments(admin));
} else if (o instanceof GeoPointSeed) {
filteredObject = new GeoPoint(o.latitude, o.longitude);
} else if (o instanceof Date) {
filteredObject = Timestamp.fromDate(o);
} else if (o instanceof Timestamp) {
filteredObject = o;
} else if (o instanceof Array || o instanceof Object) {
filteredObject = o instanceof Array ? Array(o.length) : {};
for (let i in o) {
p.push(filterObject(context, i, o[i]).then(filteredChild => {
if (filteredChild !== DELETE) {
filteredObject[i] = filteredChild;
}
}));
}
}
return Promise.all(p).then(() => {
return new Promise((resolve, reject) => {
resolve(filteredObject);
});
return resp.map((release: any) => {
return {
org,
repo,
url: release.html_url,
tag_name: release.tag_name,
created_at: Timestamp.fromDate(new Date(release.created_at))
};
});
});