Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
ascorbic authored and astrobot-houston committed Jun 18, 2024
1 parent 9a08d74 commit 080156f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/astro/src/assets/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { AstroError, AstroErrorData } from '../core/errors/index.js';
import { DEFAULT_HASH_PROPS } from './consts.js';
import { type ImageService, isLocalService } from './services/service.js';
import {
isImageMetadata,
type GetImageResult,
type ImageTransform,
type SrcSetValue,
type UnresolvedImageTransform,
isImageMetadata,
} from './types.js';
import { isESMImportedImage, isRemoteImage, resolveSrc } from './utils/imageKind.js';
import { probe } from './utils/remoteProbe.js';
Expand Down Expand Up @@ -51,8 +51,8 @@ export async function getImage(
),
});
}
if(isImageMetadata(options)) {

if (isImageMetadata(options)) {
throw new AstroError(AstroErrorData.ExpectedNotESMImage);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/content/runtime-assets.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { PluginContext } from 'rollup';
import { z } from 'zod';
import type { ImageMetadata, OmitBrand } from '../assets/types.js';
import { emitESMImage } from '../assets/utils/emitAsset.js';
import type { OmitBrand, ImageMetadata } from '../assets/types.js';

export function createImage(
pluginContext: PluginContext,
Expand Down
7 changes: 4 additions & 3 deletions packages/astro/src/core/errors/errors-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ export const ExpectedImageOptions = {
* - [Images](https://docs.astro.build/en/guides/images/)
* @description
* An ESM-imported image cannot be passed directly to `getImage()`. Instead, pass an object with the image in the `src` property.
*
*
* ```diff
* import { getImage } from "astro:assets";
* import myImage from "../assets/my_image.png";
Expand All @@ -680,8 +680,9 @@ export const ExpectedImageOptions = {
export const ExpectedNotESMImage = {
name: 'ExpectedNotESMImage',
title: 'Expected image options, not an ESM-imported image.',
message: 'An ESM-imported image cannot be passed directly to `getImage()`. Instead, pass an object with the image in the `src` property.',
hint: 'Try changing `getImage(myImage)` to `getImage({ src: myImage })`'
message:
'An ESM-imported image cannot be passed directly to `getImage()`. Instead, pass an object with the image in the `src` property.',
hint: 'Try changing `getImage(myImage)` to `getImage({ src: myImage })`',
} satisfies ErrorData;

/**
Expand Down

0 comments on commit 080156f

Please sign in to comment.