astro
Version:
Astro is a modern site builder with web best practices, performance, and DX front-of-mind.
17 lines (16 loc) • 416 B
JavaScript
import { typeHandlers } from "./types/index.js";
import { detector } from "./detector.js";
function lookup(input) {
const type = detector(input);
if (typeof type !== "undefined") {
const size = typeHandlers.get(type).calculate(input);
if (size !== void 0) {
size.type = size.type ?? type;
return size;
}
}
throw new TypeError("unsupported file type: " + type);
}
export {
lookup
};