10 lines
165 B
JavaScript
10 lines
165 B
JavaScript
export function normalizeAssetUrl(url) {
|
|
const normalized = url.trim();
|
|
|
|
if (/^(https?:|\/|#)/i.test(normalized)) {
|
|
return normalized;
|
|
}
|
|
|
|
return null;
|
|
}
|