Home / File/ tags.ts — astro Source File

tags.ts — astro Source File

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

File typescript CoreAstro RenderingEngine 3 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  20ee4011_0c81_9580_0d21_74d983d52182["tags.ts"]
  a4f2698c_5256_262a_ba7c_f72b51878d10["../core/app/types.js"]
  20ee4011_0c81_9580_0d21_74d983d52182 --> a4f2698c_5256_262a_ba7c_f72b51878d10
  10d4e39f_edb6_3e34_aa93_ae1211e7da05["../types/public/internal.js"]
  20ee4011_0c81_9580_0d21_74d983d52182 --> 10d4e39f_edb6_3e34_aa93_ae1211e7da05
  f6f0048c_504d_27bf_f669_9d6d4a931037["./util.js"]
  20ee4011_0c81_9580_0d21_74d983d52182 --> f6f0048c_504d_27bf_f669_9d6d4a931037
  style 20ee4011_0c81_9580_0d21_74d983d52182 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { StylesheetAsset } from '../../../core/app/types.js';
import type { SSRElement, SSRResult } from '../../../types/public/internal.js';
import { renderElement } from './util.js';

export function renderScriptElement({ props, children }: SSRElement) {
	return renderElement('script', {
		props,
		children,
	});
}

export function renderUniqueStylesheet(result: SSRResult, sheet: StylesheetAsset) {
	if (sheet.type === 'external') {
		if (Array.from(result.styles).some((s) => s.props.href === sheet.src)) return '';
		return renderElement('link', { props: { rel: 'stylesheet', href: sheet.src }, children: '' });
	}

	if (sheet.type === 'inline') {
		if (Array.from(result.styles).some((s) => s.children.includes(sheet.content))) return '';
		return renderElement('style', { props: {}, children: sheet.content });
	}
}

Domain

Subdomains

Dependencies

  • ../core/app/types.js
  • ../types/public/internal.js
  • ./util.js

Frequently Asked Questions

What does tags.ts do?
tags.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in tags.ts?
tags.ts defines 2 function(s): renderScriptElement, renderUniqueStylesheet.
What does tags.ts depend on?
tags.ts imports 3 module(s): ../core/app/types.js, ../types/public/internal.js, ./util.js.
Where is tags.ts in the architecture?
tags.ts is located at packages/astro/src/runtime/server/render/tags.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/runtime/server/render).

Analyze Your Own Codebase

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

Try Supermodel Free