* Returns true if the timestamped data is older than the expiry time; false otherwise.
(value: TimeStampedData, expiryTime: number)
| 79 | * Returns true if the timestamped data is older than the expiry time; false otherwise. |
| 80 | */ |
| 81 | public static valueHasExpired(value: TimeStampedData, expiryTime: number): boolean { |
| 82 | let lastUpdated = value && value.lastUpdated ? value.lastUpdated : 0; |
| 83 | return (Date.now() - lastUpdated >= expiryTime); |
| 84 | } |
| 85 | |
| 86 | /* |
| 87 | * Helper function that stores a value together with a timestamp as a json string. If |
no outgoing calls
no test coverage detected