File tree Expand file tree Collapse file tree
packages/react-native/scripts/ios-prebuild Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const pipeline = promisify(stream.pipeline);
1919const hermesLog = createLogger ( 'Hermes' ) ;
2020const MAVEN_CENTRAL_REPOSITORY = 'https://repo1.maven.org/maven2' ;
2121const REACT_NATIVE_MAVEN_CACHE_REPOSITORY = 'https://rnmaven.swmtest.xyz' ;
22- const artifactExistenceCache = new Map ( ) ;
22+ const artifactExistenceCache /*: Map<string, boolean> */ = new Map ( ) ;
2323
2424/*::
2525import type {BuildFlavor, Destination, Platform} from './types';
@@ -243,8 +243,9 @@ function getMavenRepositoryUrls() /*: Array<string> */ {
243243async 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 {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const pipeline = promisify(stream.pipeline);
2222const dependencyLog = createLogger ( 'ReactNativeDependencies' ) ;
2323const MAVEN_CENTRAL_REPOSITORY = 'https://repo1.maven.org/maven2' ;
2424const 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(
250250async 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 {
You can’t perform that action at this time.
0 commit comments