Home / File/ noop.ts — astro Source File

noop.ts — astro Source File

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

File typescript CoreAstro RenderingEngine 2 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  9449a5dd_bc74_04e2_dc9e_8969fd129dc5["noop.ts"]
  885fe8eb_6b3c_f392_ce65_d81fa1101fb3["./imageKind.js"]
  9449a5dd_bc74_04e2_dc9e_8969fd129dc5 --> 885fe8eb_6b3c_f392_ce65_d81fa1101fb3
  af2a1f33_901c_456d_9c42_3a41fec45451["./services/service.js"]
  9449a5dd_bc74_04e2_dc9e_8969fd129dc5 --> af2a1f33_901c_456d_9c42_3a41fec45451
  style 9449a5dd_bc74_04e2_dc9e_8969fd129dc5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { isESMImportedImage } from '../utils/imageKind.js';
import { baseService, type LocalImageService, verifyOptions } from './service.js';

// Empty service used for platforms that don't support Sharp / users who don't want transformations.
const noopService: LocalImageService = {
	...baseService,
	propertiesToHash: ['src'],
	async validateOptions(options) {
		if (isESMImportedImage(options.src) && options.src.format === 'svg') {
			options.format = 'svg';
		} else {
			delete options.format;
		}

		verifyOptions(options);

		return options;
	},
	async transform(inputBuffer, transformOptions) {
		return {
			data: inputBuffer,
			format: transformOptions.format,
		};
	},
};

export default noopService;

Domain

Subdomains

Dependencies

  • ./imageKind.js
  • ./services/service.js

Frequently Asked Questions

What does noop.ts do?
noop.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 noop.ts?
noop.ts defines 2 function(s): noopService.transform, noopService.validateOptions.
What does noop.ts depend on?
noop.ts imports 2 module(s): ./imageKind.js, ./services/service.js.
Where is noop.ts in the architecture?
noop.ts is located at packages/astro/src/assets/services/noop.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/assets/services).

Analyze Your Own Codebase

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

Try Supermodel Free