UNPKG

filepond

Version:

FilePond, where files go to stretch their bits.

39 lines (38 loc) • 910 B
/*! * FilePond v5.0.2 * Copyright (c) 2017-2026 Pqina B.V. * Released under the MIT License * https://filepond.com */ import { getExtensionFromMimeType as u } from "../utils/file.js"; function r(e, t) { return "Untitled"; } function a(e, t, n) { return u(t.type, n.mimeTypeMap); } function m(e, t, n) { const s = (n.getBasename ?? r)(e, t), i = (n.getExtension ?? a)(e, t, { mimeTypeMap: n.mimeTypeMap }); return `${s}${i}`; } function l(e) { return e.filter((t) => t.status).map((t) => t.status); } function f(e, t) { const n = e.filter((s) => s.status).find( (s) => t.includes( //@ts-ignore (we only get extensions that have a status) s.status.code ) ); return n ? n.status : t.includes(null) ? { progress: null } : null; } export { r as getBasename, a as getExtension, f as getExtensionStateByStatusCode, l as getExtensionStatusItems, m as getFilename };