summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar tony-sull <tony-sull@users.noreply.github.com> 2022-07-18 19:45:31 +0000
committerGravatar fredkbot <fred+astrobot@astro.build> 2022-07-18 19:45:31 +0000
commitf6d61e6e72183cb99e33fe0473d2d4227d179e1b (patch)
tree1e0400dcfdb8863744d982d1bdb8239bbc72ace9
parent2a7dd040e8a65d62fbb3bbd7308f523bd48deda5 (diff)
downloadastro-f6d61e6e72183cb99e33fe0473d2d4227d179e1b.tar.gz
astro-f6d61e6e72183cb99e33fe0473d2d4227d179e1b.tar.zst
astro-f6d61e6e72183cb99e33fe0473d2d4227d179e1b.zip
[ci] format
Diffstat (limited to '')
-rw-r--r--packages/integrations/image/src/get-image.ts6
-rw-r--r--packages/integrations/image/src/index.ts11
2 files changed, 7 insertions, 10 deletions
diff --git a/packages/integrations/image/src/get-image.ts b/packages/integrations/image/src/get-image.ts
index 83ac2e5ba..10de5c039 100644
--- a/packages/integrations/image/src/get-image.ts
+++ b/packages/integrations/image/src/get-image.ts
@@ -113,7 +113,7 @@ export async function getImage(
const isDev = globalThis.astroImage.command === 'dev';
const isLocalImage = !isRemoteImage(resolved.src);
-
+
const _loader = isDev && isLocalImage ? globalThis.astroImage.ssrLoader : loader;
if (!_loader) {
@@ -130,8 +130,8 @@ export async function getImage(
}
const src = globalThis?.astroImage
- ? globalThis.astroImage.filenameFormat(resolved, searchParams)
- : `${ROUTE_PATTERN}?${searchParams.toString()}`;
+ ? globalThis.astroImage.filenameFormat(resolved, searchParams)
+ : `${ROUTE_PATTERN}?${searchParams.toString()}`;
return {
...attributes,
diff --git a/packages/integrations/image/src/index.ts b/packages/integrations/image/src/index.ts
index da1ec1d4b..7c5176133 100644
--- a/packages/integrations/image/src/index.ts
+++ b/packages/integrations/image/src/index.ts
@@ -54,13 +54,10 @@ const createIntegration = (options: IntegrationOptions = {}): AstroIntegration =
// Added to globalThis to share the same map in Node and Vite
function addStaticImage(transform: TransformOptions) {
staticImages.set(propsToFilename(transform), transform);
- };
+ }
// TODO: Add support for custom, user-provided filename format functions
- function filenameFormat(
- transform: TransformOptions,
- searchParams: URLSearchParams
- ) {
+ function filenameFormat(transform: TransformOptions, searchParams: URLSearchParams) {
if (mode === 'ssg') {
return isRemoteImage(transform.src)
? path.join(OUTPUT_DIR, path.basename(propsToFilename(transform)))
@@ -72,7 +69,7 @@ const createIntegration = (options: IntegrationOptions = {}): AstroIntegration =
} else {
return `${ROUTE_PATTERN}?${searchParams.toString()}`;
}
- };
+ }
// Initialize the integration's globalThis namespace
// This is needed to share scope between Node and Vite
@@ -82,7 +79,7 @@ const createIntegration = (options: IntegrationOptions = {}): AstroIntegration =
command,
addStaticImage,
filenameFormat,
- }
+ };
if (mode === 'ssr') {
injectRoute({