Home / Function/ matchPattern() — astro Function Reference

matchPattern() — astro Function Reference

Architecture documentation for the matchPattern() function in remote.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  2c106453_076d_2939_b71b_64bda08efedf["matchPattern()"]
  be14f71c_abe1_1789_62c6_249b28c23bcc["remote.ts"]
  2c106453_076d_2939_b71b_64bda08efedf -->|defined in| be14f71c_abe1_1789_62c6_249b28c23bcc
  7d71a8a1_3fbe_5f98_fd7b_39e56b5f23b0["isRemoteAllowed()"]
  7d71a8a1_3fbe_5f98_fd7b_39e56b5f23b0 -->|calls| 2c106453_076d_2939_b71b_64bda08efedf
  04b0d476_b2fb_33ff_c363_f4b0c875716a["matchProtocol()"]
  2c106453_076d_2939_b71b_64bda08efedf -->|calls| 04b0d476_b2fb_33ff_c363_f4b0c875716a
  61517f52_0061_a7c8_31ee_a33231f85f7a["matchHostname()"]
  2c106453_076d_2939_b71b_64bda08efedf -->|calls| 61517f52_0061_a7c8_31ee_a33231f85f7a
  7abc6f68_41bc_c543_41cf_f9498aeb3196["matchPort()"]
  2c106453_076d_2939_b71b_64bda08efedf -->|calls| 7abc6f68_41bc_c543_41cf_f9498aeb3196
  e4d6b9d5_a708_a09a_a75b_8c97ce8d3630["matchPathname()"]
  2c106453_076d_2939_b71b_64bda08efedf -->|calls| e4d6b9d5_a708_a09a_a75b_8c97ce8d3630
  style 2c106453_076d_2939_b71b_64bda08efedf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/internal-helpers/src/remote.ts lines 15–22

export function matchPattern(url: URL, remotePattern: RemotePattern): boolean {
	return (
		matchProtocol(url, remotePattern.protocol) &&
		matchHostname(url, remotePattern.hostname, true) &&
		matchPort(url, remotePattern.port) &&
		matchPathname(url, remotePattern.pathname, true)
	);
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does matchPattern() do?
matchPattern() is a function in the astro codebase, defined in packages/internal-helpers/src/remote.ts.
Where is matchPattern() defined?
matchPattern() is defined in packages/internal-helpers/src/remote.ts at line 15.
What does matchPattern() call?
matchPattern() calls 4 function(s): matchHostname, matchPathname, matchPort, matchProtocol.
What calls matchPattern()?
matchPattern() is called by 1 function(s): isRemoteAllowed.

Analyze Your Own Codebase

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

Try Supermodel Free