UNPKG

@scalar/api-client

Version:

the open source API testing client

19 lines (18 loc) 320 B
const m = (e) => { try { return decodeURIComponent(e); } catch { return e; } }; function c(e) { let a = ""; if (e) { const t = e.match(/filename\*=UTF-8''([^;]+)/)?.[1] ?? e.match(/filename\s*=\s*"?([^";]+)"?/)?.[1]; t && (a = m(t.trim())); } return a; } export { c as extractFilename };