From ecf1704eb19d8aea4be4233136c21330683fde60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Thu, 2 Apr 2026 20:31:45 +0300 Subject: [PATCH] add: add utils from conver enums --- lib/index.ts | 3 ++- lib/utils/conver-enum.ts | 6 ++++++ lib/utils/index.ts | 1 + package.json | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 lib/utils/conver-enum.ts create mode 100644 lib/utils/index.ts diff --git a/lib/index.ts b/lib/index.ts index fa2ae8b..ea0abe7 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1 +1,2 @@ -export * from "./enums"; +export * from './enums' +export * from './utils' diff --git a/lib/utils/conver-enum.ts b/lib/utils/conver-enum.ts new file mode 100644 index 0000000..02e772b --- /dev/null +++ b/lib/utils/conver-enum.ts @@ -0,0 +1,6 @@ +export function convertEnum( + target: T, + value: string +): T[keyof T] { + return (target as any)[value] +} diff --git a/lib/utils/index.ts b/lib/utils/index.ts new file mode 100644 index 0000000..3f301a3 --- /dev/null +++ b/lib/utils/index.ts @@ -0,0 +1 @@ +export * from './conver-enum' diff --git a/package.json b/package.json index c4b985f..7ef63a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lendry-erp/common", - "version": "1.0.1", + "version": "1.0.2", "description": "Core shared components for Lendry-ERP microservice ecosystem", "main": "dist/index.js", "type": "dist/index.d.ts",