Home / File/ utils.js — astro Source File

utils.js — astro Source File

Architecture documentation for utils.js, a javascript file in the astro codebase. 0 imports, 2 dependents.

File javascript IntegrationAdapters SsrAdapters 2 dependents 1 functions 5 classes

Entity Profile

Dependency Diagram

graph LR
  cf581885_d0e2_b165_a30e_db299dd301a8["utils.js"]
  ea0af6c5_d045_60b6_c577_5153cfcaa580["core.test.js"]
  ea0af6c5_d045_60b6_c577_5153cfcaa580 --> cf581885_d0e2_b165_a30e_db299dd301a8
  d5696fe9_c690_827d_2f8a_53f43d6035fe["infra.test.js"]
  d5696fe9_c690_827d_2f8a_53f43d6035fe --> cf581885_d0e2_b165_a30e_db299dd301a8
  style cf581885_d0e2_b165_a30e_db299dd301a8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

// @ts-check

/**
 * @import { Hasher, FontMetricsResolver, Storage, FontResolver, StringMatcher } from '../../../../dist/assets/fonts/definitions'
 */

/** @implements {Storage} */
export class SpyStorage {
	/** @type {Map<string, any>} */
	#store = new Map();

	get store() {
		return this.#store;
	}

	/**
	 * @param {string} key
	 * @returns {Promise<any | null>}
	 */
	async getItem(key) {
		return this.#store.get(key) ?? null;
	}

	/**
	 * @param {string} key
	 * @returns {Promise<any | null>}
	 */
	async getItemRaw(key) {
		return this.#store.get(key) ?? null;
	}

	/**
	 * @param {string} key
	 * @param {any} value
	 * @returns {Promise<void>}
	 */
	async setItemRaw(key, value) {
		this.#store.set(key, value);
	}

	/**
	 * @param {string} key
	 * @param {any} value
	 * @returns {Promise<void>}
	 */
	async setItem(key, value) {
		this.#store.set(key, value);
	}
}

/** @implements {Hasher} */
export class FakeHasher {
	/** @type {string | undefined} */
	#value;

	/**
	 * @param {string | undefined} [value=undefined]
	 */
	constructor(value = undefined) {
		this.#value = value;
// ... (107 more lines)

Subdomains

Functions

Frequently Asked Questions

What does utils.js do?
utils.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain, SsrAdapters subdomain.
What functions are defined in utils.js?
utils.js defines 1 function(s): markdownBold.
What files import utils.js?
utils.js is imported by 2 file(s): core.test.js, infra.test.js.
Where is utils.js in the architecture?
utils.js is located at packages/astro/test/units/assets/fonts/utils.js (domain: IntegrationAdapters, subdomain: SsrAdapters, directory: packages/astro/test/units/assets/fonts).

Analyze Your Own Codebase

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

Try Supermodel Free