Skip to content

Commit

Permalink
🎨 Update code to standard format
Browse files Browse the repository at this point in the history
  • Loading branch information
dtinth committed Sep 4, 2017
1 parent 742cd34 commit 183c426
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* promptpay-qr
* JavaScript library to generate PromptPay QR code
* <https://github.com/dtinth/promptpay-qr>
*
*
* Refs:
* - https://www.blognone.com/node/95133
* - Ehttps://www.emvco.com/emv-technologies/qrcodes/
Expand Down Expand Up @@ -65,7 +65,9 @@ function sanitizeTarget (id) {
}

function formatTarget (id) {
return id.length >= 13 ? sanitizeTarget(id) : ('0000000000000' + sanitizeTarget(id).replace(/^0/, '66')).slice(-13)
const numbers = sanitizeTarget(id)
if (numbers.length >= 13) return numbers
return ('0000000000000' + numbers.replace(/^0/, '66')).slice(-13)
}

function formatAmount (amount) {
Expand Down

0 comments on commit 183c426

Please sign in to comment.