Skip to content

Commit

Permalink
Fix validator so that empty last lines are accepted as valid JSONL (#84)
Browse files Browse the repository at this point in the history
* Fix validator so that empty last lines are accepted as valid JSONL

* Update validator.js

Keep positive condition instead

---------

Co-authored-by: Baptiste Pernet-Mugnier <[email protected]>
  • Loading branch information
leoalho and sp4ce authored Feb 6, 2024
1 parent 5e474e2 commit cd27e5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion javascripts/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $(document).ready(() => {
let errors = [];
for (let i = 0; i < lines.length; i++) {
let line = lines[i]
if (i !== lines.length - 1 || lines !== '') {
if (i !== lines.length - 1 || lines[i] !== '') {
try {
JSON.parse(line);
} catch (e) {
Expand Down

0 comments on commit cd27e5e

Please sign in to comment.