Home / File/ assets.ts — astro Source File

assets.ts — astro Source File

Architecture documentation for assets.ts, a typescript file in the astro codebase. 3 imports, 0 dependents.

File typescript CoreAstro RoutingSystem 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  8e71015c_a9d5_1a10_cdd9_b37b3d71b846["assets.ts"]
  e4df8f29_fb2f_3d70_a962_fdf6a3670b22["path"]
  8e71015c_a9d5_1a10_cdd9_b37b3d71b846 --> e4df8f29_fb2f_3d70_a962_fdf6a3670b22
  21f9daf1_9979_0313_afee_bbb8465c9f69["remote"]
  8e71015c_a9d5_1a10_cdd9_b37b3d71b846 --> 21f9daf1_9979_0313_afee_bbb8465c9f69
  f16d8c76_2866_6150_bd14_0347b59abfe9["astro"]
  8e71015c_a9d5_1a10_cdd9_b37b3d71b846 --> f16d8c76_2866_6150_bd14_0347b59abfe9
  style 8e71015c_a9d5_1a10_cdd9_b37b3d71b846 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { isRemotePath } from '@astrojs/internal-helpers/path';
import { matchHostname, matchPattern } from '@astrojs/internal-helpers/remote';
import type { AstroConfig } from 'astro';

export function isRemoteAllowed(
	src: string,
	{
		domains = [],
		remotePatterns = [],
	}: Partial<Pick<AstroConfig['image'], 'domains' | 'remotePatterns'>>,
): boolean {
	if (!isRemotePath(src)) return false;

	const url = new URL(src);
	return (
		domains.some((domain) => matchHostname(url, domain)) ||
		remotePatterns.some((remotePattern) => matchPattern(url, remotePattern))
	);
}

Domain

Subdomains

Functions

Dependencies

  • astro
  • path
  • remote

Frequently Asked Questions

What does assets.ts do?
assets.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RoutingSystem subdomain.
What functions are defined in assets.ts?
assets.ts defines 1 function(s): isRemoteAllowed.
What does assets.ts depend on?
assets.ts imports 3 module(s): astro, path, remote.
Where is assets.ts in the architecture?
assets.ts is located at packages/integrations/cloudflare/src/utils/assets.ts (domain: CoreAstro, subdomain: RoutingSystem, directory: packages/integrations/cloudflare/src/utils).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free