mirror of
https://github.com/hashicorp/vault.git
synced 2026-04-21 06:09:01 -04:00
* license: update headers to IBM Corp. * `make proto` * update offset because source file changed Signed-off-by: Ryan Cragun <me@ryan.ec> Co-authored-by: Ryan Cragun <me@ryan.ec>
20 lines
511 B
JavaScript
20 lines
511 B
JavaScript
/**
|
|
* Copyright IBM Corp. 2016, 2025
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
/**
|
|
* Use this instead of new Date() throughout the app so that time-related logic is easier to test.
|
|
*/
|
|
const timestamp = {
|
|
// Method defined within an object so it can be stubbed
|
|
/**
|
|
* * Use timestamp.now to create a date for the current moment. In testing context, stub this method so it returns an expected value
|
|
* @returns Date object
|
|
*/
|
|
now: () => {
|
|
return new Date();
|
|
},
|
|
};
|
|
|
|
export default timestamp;
|