function parseImageWidth
parseImageWidth(raw: string | null): ImageWidth | null

Returns the width a ?w= value asks for, snapped to IMAGE_WIDTHS, or null when it is absent or not a positive number, which asks for the image as it is.

Parameters

raw: string | null

Return Type

ImageWidth | null

Usage

import { parseImageWidth } from "shared/image.ts";