Skip to content

Commit

Permalink
SK-1734: bug fix for validations (#490)
Browse files Browse the repository at this point in the history
* SK-1734: bug fix (#489)
  • Loading branch information
amith-skyflow authored Nov 12, 2024
1 parent 01be73d commit 0db1778
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/libs/element-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 0db1778

Please sign in to comment.