Skip to content

Commit

Permalink
chore(lint): Prettier fix
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 26, 2022
1 parent 2c75a4a commit c0cc7a7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/core/lib/context.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
interface AstroRequest extends Request {}

const sprites = new WeakMap<AstroRequest, Set<string>>()
const sprites = new WeakMap<AstroRequest, Set<string>>();

export function trackSprite(request: AstroRequest, name: string): void {
let currentSet = sprites.get(request)
let currentSet = sprites.get(request);
if (!currentSet) {
currentSet = new Set([name])
currentSet = new Set([name]);
} else {
currentSet.add(name)
currentSet.add(name);
}
sprites.set(request, currentSet)
sprites.set(request, currentSet);
}

const warned = new Set();
export async function getUsedSprites(request: AstroRequest): Promise<string[]> {
const currentSet = sprites.get(request)
const currentSet = sprites.get(request);
if (currentSet) {
return Array.from(currentSet)
return Array.from(currentSet);
}
if (!warned.has(request)) {
const {pathname} = new URL(request.url)
const { pathname } = new URL(request.url);
console.log(`[astro-icon] No sprites found while rendering "${pathname}"`);
warned.add(request);
}
Expand Down

2 comments on commit c0cc7a7

@vercel
Copy link

@vercel vercel bot commented on c0cc7a7 Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

api-astroicon – ./packages/service

api-astroicon-git-main-nmoo.vercel.app
api.astroicon.dev
api-astroicon-nmoo.vercel.app

@vercel
Copy link

@vercel vercel bot commented on c0cc7a7 Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

astroicon – ./packages/www/

www.astroicon.dev
astroicon-git-main-nmoo.vercel.app
astro-icon-www.vercel.app
astroicon-nmoo.vercel.app
astroicon.dev

Please sign in to comment.