Home / File/ test-image-service.js — astro Source File

test-image-service.js — astro Source File

Architecture documentation for test-image-service.js, a javascript file in the astro codebase. 2 imports, 1 dependents.

File javascript CoreAstro CoreMiddleware 2 imports 1 dependents 3 functions

Entity Profile

Dependency Diagram

graph LR
  a3a5023c_de7a_7c20_72d6_00f3eb2909c6["test-image-service.js"]
  d9a92db9_c95e_9165_13ac_24b3d859d946["node:url"]
  a3a5023c_de7a_7c20_72d6_00f3eb2909c6 --> d9a92db9_c95e_9165_13ac_24b3d859d946
  01c5fbc2_ddb6_180b_d98d_2ff488540314["assets"]
  a3a5023c_de7a_7c20_72d6_00f3eb2909c6 --> 01c5fbc2_ddb6_180b_d98d_2ff488540314
  2bae0dfc_575f_cb82_cf58_1af1b47c1f9f["astro.config.mjs"]
  2bae0dfc_575f_cb82_cf58_1af1b47c1f9f --> a3a5023c_de7a_7c20_72d6_00f3eb2909c6
  style a3a5023c_de7a_7c20_72d6_00f3eb2909c6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { fileURLToPath } from 'node:url';
import { baseService } from 'astro/assets';

/**
 * stub image service that returns images as-is without optimization
 * @param {{ foo?: string }} [config]
 */
export function testImageService(config = {}) {
	return {
		entrypoint: fileURLToPath(import.meta.url),
		config,
	};
}

/** @type {import("../dist/@types/astro").LocalImageService} */
export default {
	...baseService,
	propertiesToHash: [...baseService.propertiesToHash, 'data-custom'],
	getHTMLAttributes(options, serviceConfig) {
		options['data-service'] = 'my-custom-service';
		if (serviceConfig.service.config.foo) {
			options['data-service-config'] = serviceConfig.service.config.foo;
		}
		return baseService.getHTMLAttributes(options);
	},
	async transform(buffer, transform) {
		return {
			data: buffer,
			format: transform.format,
		};
	},
};

Domain

Subdomains

Dependencies

  • assets
  • node:url

Frequently Asked Questions

What does test-image-service.js do?
test-image-service.js is a source file in the astro codebase, written in javascript. It belongs to the CoreAstro domain, CoreMiddleware subdomain.
What functions are defined in test-image-service.js?
test-image-service.js defines 3 function(s): default.getHTMLAttributes, default.transform, testImageService.
What does test-image-service.js depend on?
test-image-service.js imports 2 module(s): assets, node:url.
What files import test-image-service.js?
test-image-service.js is imported by 1 file(s): astro.config.mjs.
Where is test-image-service.js in the architecture?
test-image-service.js is located at packages/integrations/vercel/test/test-image-service.js (domain: CoreAstro, subdomain: CoreMiddleware, directory: packages/integrations/vercel/test).

Analyze Your Own Codebase

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

Try Supermodel Free