Skip to content

Commit db9f786

Browse files
committed
fix lint issues
1 parent fa22164 commit db9f786

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

packages/react-native/scripts/ios-prebuild/hermes.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const pipeline = promisify(stream.pipeline);
1919
const hermesLog = createLogger('Hermes');
2020
const MAVEN_CENTRAL_REPOSITORY = 'https://repo1.maven.org/maven2';
2121
const REACT_NATIVE_MAVEN_CACHE_REPOSITORY = 'https://rnmaven.swmtest.xyz';
22-
const artifactExistenceCache = new Map();
22+
const artifactExistenceCache /*: Map<string, boolean> */ = new Map();
2323

2424
/*::
2525
import type {BuildFlavor, Destination, Platform} from './types';
@@ -243,8 +243,9 @@ function getMavenRepositoryUrls() /*: Array<string> */ {
243243
async function hermesArtifactExists(
244244
tarballUrl /*: string */,
245245
) /*: Promise<boolean> */ {
246-
if (artifactExistenceCache.has(tarballUrl)) {
247-
return artifactExistenceCache.get(tarballUrl);
246+
const cached = artifactExistenceCache.get(tarballUrl);
247+
if (cached != null) {
248+
return cached;
248249
}
249250

250251
try {

packages/react-native/scripts/ios-prebuild/reactNativeDependencies.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const pipeline = promisify(stream.pipeline);
2222
const dependencyLog = createLogger('ReactNativeDependencies');
2323
const MAVEN_CENTRAL_REPOSITORY = 'https://repo1.maven.org/maven2';
2424
const REACT_NATIVE_MAVEN_CACHE_REPOSITORY = 'https://rnmaven.swmtest.xyz';
25-
const artifactExistenceCache = new Map();
25+
const artifactExistenceCache /*: Map<string, boolean> */ = new Map();
2626

2727
/**
2828
* Downloads ReactNativeDependencies artifacts from the specified version and build type. If you want to specify a specific
@@ -250,8 +250,9 @@ async function getNightlyTarballUrl(
250250
async function reactNativeDependenciesArtifactExists(
251251
tarballUrl /*: string */,
252252
) /*: Promise<boolean> */ {
253-
if (artifactExistenceCache.has(tarballUrl)) {
254-
return artifactExistenceCache.get(tarballUrl);
253+
const cached = artifactExistenceCache.get(tarballUrl);
254+
if (cached != null) {
255+
return cached;
255256
}
256257

257258
try {

0 commit comments

Comments
 (0)