Skip to content

Function: parse() ​

ts
function parse(url): ParsedChain;

Defined in: fluent/cdn.ts:90

Parses any CDN url into the matching chain (narrow by .kind). Config-free: the cdnBase comes from the url, so this needs no base bound.

Parameters ​

ParameterType
urlstring

Returns ​

ParsedChain

Example ​

ts
const chain = parse(`https://ucarecdn.com/${uuid}/-/crop/640x480/photo.jpg`)
if (chain.kind === 'file') chain.preview(400, 400).href