I'm working on a validation function.
Is there a way to check if an object is a firestore.Timestamp ?
I'm using the firebase JS SDK and also using Typescript.
import * as firebase from "firebase/app";
const blogPost = {
title: "",
createdAt: firebase.firestore.Timestamp.now()
}
function validateBlogPostCreationDate(blogPost) {
// SOMETHING LIKE THIS:
return blogPost.createdAt is a Timestamp ?
true : false;
}