Home / File/ utils.ts — astro Source File

utils.ts — astro Source File

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

File typescript CoreAstro CoreMiddleware 3 imports 11 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  d8206fa8_f041_14e6_d043_1fc32953407c["utils.ts"]
  c52a5f83_66e3_37d7_9ebb_767f7129bc62["node:path"]
  d8206fa8_f041_14e6_d043_1fc32953407c --> c52a5f83_66e3_37d7_9ebb_767f7129bc62
  d9a92db9_c95e_9165_13ac_24b3d859d946["node:url"]
  d8206fa8_f041_14e6_d043_1fc32953407c --> d9a92db9_c95e_9165_13ac_24b3d859d946
  40286c5f_532d_1bd5_70e5_3dbec8398413["compiler"]
  d8206fa8_f041_14e6_d043_1fc32953407c --> 40286c5f_532d_1bd5_70e5_3dbec8398413
  38eb43bb_eb3b_a13c_c79f_a35b90ae04ef["caching.test.ts"]
  38eb43bb_eb3b_a13c_c79f_a35b90ae04ef --> d8206fa8_f041_14e6_d043_1fc32953407c
  4c7e91a1_f86d_6b8e_b0f0_4a15ccae8a23["completions.test.ts"]
  4c7e91a1_f86d_6b8e_b0f0_4a15ccae8a23 --> d8206fa8_f041_14e6_d043_1fc32953407c
  b47c660d_464d_f6b4_cbf1_a369558fa472["definitions.test.ts"]
  b47c660d_464d_f6b4_cbf1_a369558fa472 --> d8206fa8_f041_14e6_d043_1fc32953407c
  93e35a50_6bb5_f8d8_542c_bf8226444c1c["diagnostics.test.ts"]
  93e35a50_6bb5_f8d8_542c_bf8226444c1c --> d8206fa8_f041_14e6_d043_1fc32953407c
  2b5cae3f_5d71_9efa_3b70_0869ac653520["hover.test.ts"]
  2b5cae3f_5d71_9efa_3b70_0869ac653520 --> d8206fa8_f041_14e6_d043_1fc32953407c
  231647d3_e5a0_b4e9_e3ea_d72c35fb18d4["prettier-format.test.ts"]
  231647d3_e5a0_b4e9_e3ea_d72c35fb18d4 --> d8206fa8_f041_14e6_d043_1fc32953407c
  e7816cc0_2cb2_78e0_7913_a132534e0e56["caching.test.ts"]
  e7816cc0_2cb2_78e0_7913_a132534e0e56 --> d8206fa8_f041_14e6_d043_1fc32953407c
  dfee8dba_593e_d40c_5cc4_8b07ae7880b1["completions.test.ts"]
  dfee8dba_593e_d40c_5cc4_8b07ae7880b1 --> d8206fa8_f041_14e6_d043_1fc32953407c
  8515c467_ba4e_c0f9_a53d_1c6fb7a5b697["diagnostics.test.ts"]
  8515c467_ba4e_c0f9_a53d_1c6fb7a5b697 --> d8206fa8_f041_14e6_d043_1fc32953407c
  4794aa5e_b452_e14a_5cb3_4f1ab0d5922d["renames.test.ts"]
  4794aa5e_b452_e14a_5cb3_4f1ab0d5922d --> d8206fa8_f041_14e6_d043_1fc32953407c
  44361e29_2da0_de2c_a680_9777761cdb6c["parseAstro.test.ts"]
  44361e29_2da0_de2c_a680_9777761cdb6c --> d8206fa8_f041_14e6_d043_1fc32953407c
  style d8206fa8_f041_14e6_d043_1fc32953407c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import path from 'node:path';
import { fileURLToPath } from 'node:url';
import type { Point, Position } from '@astrojs/compiler';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

export const fixtureDir = path.join(__dirname, './fixture');

export function createCompilerPosition(start: Point, end: Point): Position {
	return {
		start,
		end,
	};
}

export function createCompilerPoint(line: number, column: number, offset: number): Point {
	return {
		line,
		column,
		offset,
	};
}

Domain

Subdomains

Dependencies

  • compiler
  • node:path
  • node:url

Frequently Asked Questions

What does utils.ts do?
utils.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, CoreMiddleware subdomain.
What functions are defined in utils.ts?
utils.ts defines 2 function(s): createCompilerPoint, createCompilerPosition.
What does utils.ts depend on?
utils.ts imports 3 module(s): compiler, node:path, node:url.
What files import utils.ts?
utils.ts is imported by 11 file(s): caching.test.ts, caching.test.ts, completions.test.ts, completions.test.ts, definitions.test.ts, diagnostics.test.ts, diagnostics.test.ts, hover.test.ts, and 3 more.
Where is utils.ts in the architecture?
utils.ts is located at packages/language-tools/language-server/test/utils.ts (domain: CoreAstro, subdomain: CoreMiddleware, directory: packages/language-tools/language-server/test).

Analyze Your Own Codebase

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

Try Supermodel Free