From 0db1778562d37377ca3517b26feb70183ba94712 Mon Sep 17 00:00:00 2001 From: amith-skyflow <168510106+amith-skyflow@users.noreply.github.com> Date: Tue, 12 Nov 2024 18:15:35 +0530 Subject: [PATCH] SK-1734: bug fix for validations (#490) * SK-1734: bug fix (#489) --- package.json | 2 +- src/libs/element-options.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8b97abef..fa4b5206 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "skyflow-js", "preferGlobal": true, "analyze": false, - "version": "1.38.1", + "version": "1.38.1-dev.00a909d", "author": "Skyflow", "description": "Skyflow JavaScript SDK", "homepage": "https://github.com/skyflowapi/skyflow-js", diff --git a/src/libs/element-options.ts b/src/libs/element-options.ts index 2dbff89d..c50c60fb 100644 --- a/src/libs/element-options.ts +++ b/src/libs/element-options.ts @@ -218,9 +218,10 @@ export const getValueAndItsUnit = ( return [string.slice(0, index), string.slice(index)]; }; -export const formatValidations = (validations?: IValidationRule[]): IValidationRule[] => { +export const formatValidations = (validations?: IValidationRule[]): +IValidationRule[] | undefined => { if (!validations || !Array.isArray(validations) || validations.length === 0) { - return []; + return validations; } return validations.map((validationRule: IValidationRule, index: number) => {