[File] [PATCH] JavaScript source

FC Stegerman flx at obfusk.net
Wed Jan 11 10:16:13 UTC 2023


Hi!

I've attached a patch for detecting JavaScript files based on common
code patterns that are hopefully sufficiently unique; I've tried to
limit false positives as much as possible, but I can't guarantee I've
avoided e.g. false positives for programming languages I'm unfamiliar
with (though I'm familiar with more than 20, so that helps).

It also fixes detection of Node.js scripts as binary instead of text.

See [1] for my test results.

- FC

[1] https://gist.github.com/obfusk/8117be542a56268d80e1ee986ff46756
-------------- next part --------------
A non-text attachment was scrubbed...
Name: js.patch
Type: text/x-diff
Size: 3216 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20230111/76e82912/attachment.bin>


More information about the File mailing list