alexei / sprintf.js

sprintf.js is a complete open source JavaScript sprintf implementation
BSD 3-Clause "New" or "Revised" License
2.11k stars 290 forks source link

Coding problem #185

Open rechmbrs opened 4 years ago

rechmbrs commented 4 years ago

I believe that line: pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' ' should be: pad_character = ph.pad_char ? (ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1)) : ' '

Missing parenthesis.

RONC

alexei commented 4 years ago

Hey @rechmbrs, thanks for your input. If you think that line is erroneous, please provide a test or two as proof.

rechmbrs commented 4 years ago

Alexandru, The line would not pass a Lint test. I haven't gotten the file to work yet and went to Lint to make sure I have a chance of it working. I'll try some more but there is still a problem overall. I don't know if the suggestion I make is correct but it passes the Lint test. RONC

On Mon, Jan 6, 2020 at 4:26 AM Alexandru Mărășteanu < notifications@github.com> wrote:

Hey @rechmbrs https://github.com/rechmbrs, thanks for your input. If you think that line is erroneous, please provide a test or two as proof.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alexei/sprintf.js/issues/185?email_source=notifications&email_token=ABAYIOUO3KDEVLFGEGXY353Q4MBORA5CNFSM4KCWX2WKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIFBOBI#issuecomment-571086597, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAYIOTGL3IITBATOAGARDDQ4MBORANCNFSM4KCWX2WA .

--

*Ronald E Chambers1713 Twila LnConroe, TX 77301-1175C - 713.806.6304E

alexei commented 4 years ago

You can open a PR, though the current linter doesn't mind that line