spamscanner 7.0.9 → 7.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -3234,6 +3234,7 @@ var MACRO_EXTENSIONS = /* @__PURE__ */ new Set(["docm", "dotm", "xlsm", "xltm",
3234
3234
  var DOCUMENT_EXTENSIONS = /* @__PURE__ */ new Set(["pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt", "rtf", "jpg", "jpeg", "png", "gif", "zip", "csv", "odt", "ods", "html", "htm", "mp3", "mp4", "mov", "wav", "eml", "msg", "xml", "json"]);
3235
3235
  var TEMPORARY_EXTENSIONS = /* @__PURE__ */ new Set(["tmp"]);
3236
3236
  var BIDI_CONTROLS = characterClass([[8234, 8238], [8294, 8297]], "u");
3237
+ var ALL_BIDI_CONTROLS = characterClass([[8234, 8238], [8294, 8297]], "gu");
3237
3238
  var ARCHIVE_TYPES = /* @__PURE__ */ new Set(["zip", "rar", "7z", "gz", "bz2", "xz", "cab", "iso", "tar", "zst", "lzh", "ace", "arj"]);
3238
3239
  function sniff(buffer) {
3239
3240
  if (!Buffer.isBuffer(buffer) || buffer.length < 4) {
@@ -3417,7 +3418,16 @@ function shorten(name, max = 100) {
3417
3418
  return characters.length <= max ? name : `${characters.slice(0, max - 41).join("")}\u2026${characters.slice(-40).join("")}`;
3418
3419
  }
3419
3420
  function extensionOf(name) {
3420
- const base = trimEndOf(String(name).toLowerCase().split(/[/\\]/).pop(), ". ");
3421
+ const base = trimEndOf(String(name).toLowerCase().replace(ALL_BIDI_CONTROLS, "").split(/[/\\]/).pop(), ". ");
3422
+ const whole = lastExtension(base);
3423
+ const file = base.replace(/^[a-z]:/, "");
3424
+ const colon = file.indexOf(":");
3425
+ if (colon !== -1 && /^(?::?\$data)?$/.test(file.slice(colon + 1))) {
3426
+ return lastExtension(trimEndOf(file.slice(0, colon), ". "));
3427
+ }
3428
+ return whole;
3429
+ }
3430
+ function lastExtension(base) {
3421
3431
  const dot = base.lastIndexOf(".");
3422
3432
  return dot === -1 ? "" : base.slice(dot + 1).trim();
3423
3433
  }
@@ -7068,7 +7078,7 @@ function scoreResults(results, options) {
7068
7078
  var package_default = {
7069
7079
  name: "spamscanner",
7070
7080
  description: "Spam, phishing and malware filter for email in any language: a trainable classifier, link and attachment checks, SPF/DKIM/DMARC, and an optional AI second opinion from any LLM, including local Ollama models. Works as a library, CLI, Postfix milter or HTTP API.",
7071
- version: "7.0.9",
7081
+ version: "7.0.10",
7072
7082
  author: "Forward Email (https://forwardemail.net)",
7073
7083
  bin: {
7074
7084
  spamscanner: "./dist/esm/cli.js"