kylefarris / clamscan

A robust ClamAV virus scanning library supporting scanning files, directories, and streams with local sockets, local/remote TCP, and local clamscan/clamdscan binaries (with failover).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: Assignment to constant variable.

vdanyliv opened this issue · comments

After trying to check directory got this error

viruses = Array.from(new Set(viruses));
TypeError: Assignment to constant variable.

And after some investigation, I found an issue in scan_files method.

line 1087

let viruses = [];

line 1093

const viruses = stdout.trim().split(String.fromCharCode(10)).map(v => /FOUND\n?$/.test(v) ? v.replace(/(.+):\s+(.+)FOUND\n?$/, "$2").trim() : null).filter(v => !!v);

line 1119

viruses = Array.from(new Set(viruses));

A pretty easy solution will be to rename a variable in the line 1093

This bug is fixed in v1.0.4. Thanks for the bug report.