aboutsummaryrefslogtreecommitdiff
path: root/src/tools/tool.ts
diff options
context:
space:
mode:
authorGravatar Corentin Thomasset <corentin.thomasset74@gmail.com> 2023-04-10 13:11:10 +0200
committerGravatar Corentin Thomasset <corentin.thomasset74@gmail.com> 2023-04-10 13:11:10 +0200
commit9fa4c26929116ad896ab81bb02edfca8685087a3 (patch)
tree4040a6db3d20d64ea616a3b67218673228da582f /src/tools/tool.ts
parent9d639edf2dde311989b2b5470594cf776ee88f0d (diff)
downloadit-tools-9fa4c26929116ad896ab81bb02edfca8685087a3.tar.gz
it-tools-9fa4c26929116ad896ab81bb02edfca8685087a3.tar.zst
it-tools-9fa4c26929116ad896ab81bb02edfca8685087a3.zip
refactor(config): removed new tools env config
Diffstat (limited to '')
-rw-r--r--src/tools/tool.ts11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/tools/tool.ts b/src/tools/tool.ts
index a5d157e..3bf4e4c 100644
--- a/src/tools/tool.ts
+++ b/src/tools/tool.ts
@@ -1,17 +1,10 @@
-import { config } from '@/config';
import { isAfter, subWeeks } from 'date-fns';
import type { Tool } from './tools.types';
type WithOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
-export function defineTool(
- tool: WithOptional<Tool, 'isNew'>,
- { newTools }: { newTools: string[] } = { newTools: config.tools.newTools },
-) {
- const isInNewToolConfig = newTools.includes(tool.name);
- const isRecentTool = tool.createdAt ? isAfter(tool.createdAt, subWeeks(new Date(), 2)) : false;
-
- const isNew = isInNewToolConfig || isRecentTool;
+export function defineTool(tool: WithOptional<Tool, 'isNew'>) {
+ const isNew = tool.createdAt ? isAfter(tool.createdAt, subWeeks(new Date(), 2)) : false;
return {
isNew,