Home / File/ path.test.js — astro Source File

path.test.js — astro Source File

Architecture documentation for path.test.js, a javascript file in the astro codebase. 3 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  21e1c711_998a_a241_4b40_f4ec69cff7d5["path.test.js"]
  54dba242_5732_60bb_10eb_cb3394dc37ba["../dist/path.js"]
  21e1c711_998a_a241_4b40_f4ec69cff7d5 --> 54dba242_5732_60bb_10eb_cb3394dc37ba
  e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607["strict"]
  21e1c711_998a_a241_4b40_f4ec69cff7d5 --> e1e2fac7_5a95_7a88_cb1e_0a3b91c4e607
  6b0635f9_51ea_77aa_767b_7857878e98a6["node:test"]
  21e1c711_998a_a241_4b40_f4ec69cff7d5 --> 6b0635f9_51ea_77aa_767b_7857878e98a6
  style 21e1c711_998a_a241_4b40_f4ec69cff7d5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
import { isParentDirectory, isRemotePath, normalizePathname } from '../dist/path.js';

describe('isRemotePath', () => {
	const remotePaths = [
		// Standard remote protocols
		'https://example.com/foo/bar.js',
		'http://example.com/foo/bar.js',
		'//example.com/foo/bar.js',
		'ws://example.com/foo/bar.js',
		'wss://example.com/foo/bar.js',
		'ftp://example.com/foo/bar.js',
		'sftp://example.com/foo/bar.js',
		'mailto:example@example.com',
		'data:someCode',
		'data:image/png;base64,iVBORw0KGgo',
		'data:text/html,<script>alert(1)</script>',

		// Backslash bypass attempts
		'\\\\example.com/foo/bar.js',
		'\\example.com/foo/bar.js',
		'\\\\\\example.com/foo/bar.js',
		'\\\\\\\\example.com/foo/bar.js',
		'\\raw.githubusercontent.com/test.svg',
		'\\\\raw.githubusercontent.com/test.svg',

		// URL-encoded backslash attempts
		'%5C%5Cexample.com/foo/bar.js',
		'%5Cexample.com/foo/bar.js',
		'%5c%5cexample.com/foo/bar.js',
		'%5cexample.com/foo/bar.js',
		'%5C%5C%5Cexample.com/foo/bar.js',
		'%5C%5C%5C%5Cexample.com/foo/bar.js',

		// Mixed encoding
		'%5C\\example.com/foo/bar.js',
		'\\%5Cexample.com/foo/bar.js',
		'%5c\\example.com/test',

		// Mixed forward and backslashes
		'\\//example.com/foo/bar.js',
		'\\//\\example.com/foo/bar.js',
		'/\\example.com/foo/bar.js', // Forward then backslash - suspicious
		'/\\\\example.com/foo/bar.js', // Forward then double backslash - suspicious

		// Protocol with backslashes
		'http:\\\\example.com/foo/bar.js',
		'https:\\\\example.com/foo/bar.js',
		'http:\\example.com/foo/bar.js',
		'https:\\example.com/foo/bar.js',
		'ftp:\\\\example.com/foo/bar.js',
		'ws:\\\\example.com/foo/bar.js',
		'wss:\\\\example.com/test', // WSS with backslashes
		'sftp:\\\\example.com/test', // SFTP with backslashes
		'HTTP:\\\\example.com/test',
		'HtTp:\\\\example.com/test',

		// Unicode escapes
		'\u005C\u005Cexample.com/test',
// ... (777 more lines)

Domain

Dependencies

  • ../dist/path.js
  • node:test
  • strict

Frequently Asked Questions

What does path.test.js do?
path.test.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain.
What does path.test.js depend on?
path.test.js imports 3 module(s): ../dist/path.js, node:test, strict.
Where is path.test.js in the architecture?
path.test.js is located at packages/internal-helpers/test/path.test.js (domain: CoreAstro, directory: packages/internal-helpers/test).

Analyze Your Own Codebase

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

Try Supermodel Free