We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e56417 commit b3e1715Copy full SHA for b3e1715
src/utils/index.ts
@@ -1 +1,5 @@
1
-// utils
+// utils
2
+
3
+export const getCurrentTimestamp = () => {
4
+ return Math.floor(Date.now() / 1000)
5
+}
tests/utils/utils.spec.ts
@@ -0,0 +1,9 @@
+import { getCurrentTimestamp } from '@/utils';
+describe('Utils', () => {
+ it('Get current timestamp', () => {
+ const timestamp = getCurrentTimestamp();
6
+ const now = Math.floor(Date.now() / 1000);
7
+ expect(timestamp).toBe(now);
8
+ });
9
+});
tsconfig.json
@@ -21,7 +21,7 @@
21
"forceConsistentCasingInFileNames": false,
22
"noFallthroughCasesInSwitch": false,
23
"paths": {
24
- "@/*": ["./src/*"]
+ "@/*": ["src/*"]
25
}
26
},
27
"ts-node": {
0 commit comments