From 00fd5846aa6ab871e3f315701ee415ec763a3f23 Mon Sep 17 00:00:00 2001 From: robonen Date: Sat, 5 Oct 2024 05:43:13 +0700 Subject: [PATCH] feat(packages/stdlib): add timestamp and noop utils --- packages/stdlib/src/index.ts | 1 + packages/stdlib/src/utils/index.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 packages/stdlib/src/utils/index.ts diff --git a/packages/stdlib/src/index.ts b/packages/stdlib/src/index.ts index 58694d8..94b37ef 100644 --- a/packages/stdlib/src/index.ts +++ b/packages/stdlib/src/index.ts @@ -5,3 +5,4 @@ export * from './bits'; export * from './structs'; export * from './arrays'; export * from './types'; +export * from './utils' diff --git a/packages/stdlib/src/utils/index.ts b/packages/stdlib/src/utils/index.ts new file mode 100644 index 0000000..479adc6 --- /dev/null +++ b/packages/stdlib/src/utils/index.ts @@ -0,0 +1,13 @@ +/** + * Returns the current timestamp + * + * @returns {number} The current timestamp + */ +export const timestamp = () => Date.now(); + +/** + * No operation function + * + * @returns {void} Nothing + */ +export const noop = () => {};