Skip to content

Commit

Permalink
feat(sdd): code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
milan-bc committed Dec 23, 2020
1 parent b358129 commit 38c6823
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ export const normalizeCreditCardExpiry = (value, previousValue) => {
} else {
if (onlyNumsOrSlash.length === 2) {
return onlyNumsOrSlash + '/'
} else {
if (onlyNumsOrSlash.length === 4 && !onlyNumsOrSlash.includes('/')) {
return onlyNumsOrSlash.replace(/(?<=^.{2})/, '/')
}
return onlyNumsOrSlash
}
if (onlyNumsOrSlash.length === 4 && !onlyNumsOrSlash.includes('/')) {
return onlyNumsOrSlash.replace(/(?<=^.{2})/, '/')
}
return onlyNumsOrSlash
}
}

Expand Down

0 comments on commit 38c6823

Please sign in to comment.