UNPKG

pompelmi

Version:

RFI-safe file uploads for Node.js — Express/Koa/Next.js middleware with deep ZIP inspection, MIME/size checks, and optional YARA scanning.

19 lines (18 loc) 502 B
export type Severity = 'clean' | 'suspicious' | 'malicious'; export type Match = { rule: string; meta?: Record<string, any>; }; export type Verdict = { severity: Severity; reasons: string[]; matches: Match[]; mime?: string; }; export type Policy = { includeExtensions: string[]; allowedMimeTypes: string[]; maxFileSizeBytes: number; denyScriptableSvg?: boolean; }; export declare function prefilter(bytes: Uint8Array, origName: string, policy: Policy): Verdict;