FUNCTION

parse_icon_url

function parse_icon_url(icon_url: text): text

Tests whether an asset icon URL is invalid. It will not try to resolve the URL, but it will remove trailing and leading whitespace and check that the string looks like an URL.

Throws "INVALID ASSET URL" if the URL is over 2048 characters or it does not match this regex pattern: ^\S+:\/\/[^\s$.?#].[^\s]*$

Parameters

  • icon_url — the URL to trim and check

Returns

the URL with whitespace removed.

© 2024 Chromia