Skip to content

Commit

Permalink
Update validation.js
Browse files Browse the repository at this point in the history
  • Loading branch information
PaneruVipin authored Dec 22, 2022
1 parent 3149e1a commit 77f68a0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ const validation = (body, rules) => {
ruleKeys?.forEach((key, i) => {
const schemaList = rules?.[key].split("|").map((str) =>
str
?.split(" ")
?.filter((subStr) => subStr != false)
.join("")
?.trim()
);
let returnedValue;
schemaList?.forEach((schema, i) => {
const rule = schema?.split(":")?.[0];
const ruleValue = schema?.split(":")?.[1];
const rule = schema?.split(":")?.[0]?.trim();
const ruleValue = schema?.split(":")?.[1]?.trim();
if (i) {
if(schemaList.includes("trim")){
const newData = ruleHandlers?.["trim"](
Expand Down

0 comments on commit 77f68a0

Please sign in to comment.