I wonder if the "if (!line) return;" in the loop function is allowing blank barcodes through? I added some logging and that does seem to be the problem.
Moving the "if (!line) return;" to below the regex seems to solve this issue for me. But I don't get why. What is that regex doing to an empty string that fixes the logical not check?
It looks like the code that processes the file of barcodes is at /git.evergreen- ils.org/ ?p=Evergreen. git;a=blob; f=Open- ILS/web/ js/ui/default/ staff/cat/ item/app. js;hb=bb6495dd8 e2e7a8c8cee4577 799b14b061261f2 1#l285
https:/
I wonder if the "if (!line) return;" in the loop function is allowing blank barcodes through? I added some logging and that does seem to be the problem.
Array(18) [ "50723000443123", "50723010107874", "", "50723010116834", "50723000013827", "50723010092811", "50723010155386", "", "50723010108526", "50723010005771", … ]
Blank barcodes are getting through.
Moving the "if (!line) return;" to below the regex seems to solve this issue for me. But I don't get why. What is that regex doing to an empty string that fixes the logical not check?
Josh