UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

89 lines (88 loc) 1.55 kB
const l = [ ".awk", ".bat", ".btm", ".c", ".cmd", ".cpp", ".cxx", ".def", ".dlg", ".dpc", ".dpj", ".dtd", ".h", ".hdl", ".hpp", ".hrc", ".html", ".hxx", ".inc", ".ini", ".inl", ".ins", ".ipy", ".java", ".js", ".jsp", ".l", ".lgt", ".ll", ".par", ".pl", ".py", ".r", ".rc", ".rdb", ".res", ".s", ".sbl", ".scp", ".sh", ".sql", ".src", ".srs", ".xml", ".xrb", ".y", ".yaml", ".yxx" ], i = "text/plain", o = "text/csv", c = "text/tab-separated-values", r = "application/octet-stream", a = [".cwl", ".wdl", ".json"]; function d(t) { let n = !1; if (t != null) { const s = t.lastIndexOf("."); if (s > -1) { const e = t.substring(s).toLowerCase(); n = l.includes(e); } } return n; } function u(t) { if (t != null) { const n = t.lastIndexOf("."); if (n > -1) return t.substring(n + 1).toLowerCase(); } return null; } function x(t) { let n = !1; const s = u(t); return s != null && (n = a.includes("." + s)), n; } function E(t, n) { let s = t; const e = n.toLowerCase(); return (t == null || t.trim().length == 0) && (d(n) || x(n) || e.endsWith(".txt") ? s = i : e.endsWith(".tsv") || e.endsWith(".tab") ? s = c : e.endsWith(".csv") ? s = o : s = r), s; } export { r as APPLICATION_OCTET_STREAM, i as PLAIN_TEXT, o as TEXT_COMMA_SEPARATED_VALUES, c as TEXT_TAB_SEPARATED_VALUES, E as fixDefaultContentType, d as isRecognizedCodeFileName }; //# sourceMappingURL=ContentTypeUtils.js.map