import { SourceNodesArgs } from 'gatsby' ; export default function getPluginStatus ( args ) { return args . store . getState ( ) . status . plugins ?. [ `gatsby-source-sanity` ] ; } const LAST_BUILD_KEY = "lastBuildTime" ; export function getLastBuildTime ( args ) { try { return new Date ( getPluginStatus ( args ) [ LAST_BUILD_KEY ] ) ; } catch ( error ) { return ; } } export async function registerBuildTime ( args ) { args . actions . setPluginStatus ( { ... ( getPluginStatus ( args ) || { } ) , [ LAST_BUILD_KEY ] : new Date ( ) . toISOString ( ) , } ) ; }