hasPreset
function hasPreset(asset, preset): boolean;Defined in: packages/asset-client/src/index.ts:315
Did the processor actually generate this preset?
Reads dto.presets — the compact 1-char code string the server always sends. Prefer this over
the variants array, which is documented as present on admin responses and, measured
2026-08-15, comes back EMPTY even with an admin key while the database row holds the variants.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
asset |
Pick<AssetDTO, "presets"> |
preset |
VariantPreset |
Returns
Section titled “Returns”boolean
Example
Section titled “Example”import { hasPreset } from "@aquienpz/asset-client";
hasPreset({ presets: "oq" }, "original"); // → true ("o" = original, "q" = thumb)hasPreset({ presets: "oq" }, "lg"); // → false — do not link to ithasPreset({ presets: "pv" }, "aiproxy"); // → false — video without the AI proxy