Skip to content

groupImageVariants

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/packages/doc-automation/src/v2/stages/stage-13-upload/upload.service.ts

Group a flat { refPath → blobUrl } map into { <desktopBlobUrl>: ImageVariantSet }.

PURE and exported for direct unit testing. Only base images that (a) resolved to a blob URL AND (b) actually have at least one companion (tablet/mobile/crop) produce an entry — a lone desktop shot needs no picker. Crops are ordered by their N. Keyed by the desktop blob URL because that is the exact URL the rendered <img src> carries (minus any #atloria-annotations= fragment), so the reader joins without content parsing.

Signature

ts
function groupImageVariants(refToUrl: Record<string, string>): Record<string, ImageVariantSet>

Parameters

NameType
refToUrlRecord<string, string>

Returns: Record<string, ImageVariantSet>

Was this page helpful?

Download as PDF