Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Nov 27, 2022
1 parent 6e24bff commit 7ec3ba3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/babel-helper-compilation-targets/src/index.ts
Expand Up @@ -173,13 +173,13 @@ function resolveTargets(queries: Browsers, env?: string): Targets {
const targetsCache = new LruCache(64);

function resolveTargetsCached(queries: Browsers, env?: string): Targets {
const cacheKey = JSON.stringify(queries) + env;
let cached = targetsCache.get(cacheKey);
const cacheKey = typeof queries === "string" ? queries : queries.join() + env;
let cached = targetsCache.get(cacheKey) as Targets | undefined;
if (!cached) {
cached = resolveTargets(queries, env);
targetsCache.set(cacheKey, cached);
}
return cached;
return { ...cached };
}

type GetTargetsOption = {
Expand Down

0 comments on commit 7ec3ba3

Please sign in to comment.