File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
packages/platform-ios/src/config Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1010
1111import glob from 'glob' ;
1212import path from 'path' ;
13- import { memoize } from 'lodash' ;
1413
1514/**
1615 * Glob pattern to look for xcodeproj
@@ -38,10 +37,9 @@ const GLOB_EXCLUDE_PATTERN = ['**/@(Pods|node_modules)/**'];
3837 *
3938 * Returns first match if files are found or null
4039 *
41- * Note: `./ios/*.xcodeproj` are returned regardless of the name.
42- * Note2: Globbing is expensive and often repeated on the same folder, hence memoizing
40+ * Note: `./ios/*.xcodeproj` are returned regardless of the name
4341 */
44- export default memoize ( function findProject ( folder : string ) : string | null {
42+ export default function findProject ( folder : string ) : string | null {
4543 const projects = glob
4644 . sync ( GLOB_PATTERN , {
4745 cwd : folder ,
@@ -58,4 +56,4 @@ export default memoize(function findProject(folder: string): string | null {
5856 }
5957
6058 return projects [ 0 ] ;
61- } ) ;
59+ }
Original file line number Diff line number Diff line change 99 */
1010
1111import path from 'path' ;
12+ import { memoize } from 'lodash' ;
1213import findProject from './findProject' ;
1314import findPodfilePath from './findPodfilePath' ;
1415import findPodspec from './findPodspec' ;
1516import type { UserConfigT } from 'types' ;
1617
18+ const memoizedFindProject = memoize ( findProject ) ;
19+
1720/**
1821 * For libraries specified without an extension, add '.tbd' for those that
1922 * start with 'lib' and '.framework' to the rest.
@@ -37,7 +40,7 @@ export function projectConfig(
3740 if ( ! userConfig ) {
3841 return ;
3942 }
40- const project = userConfig . project || findProject ( folder ) ;
43+ const project = userConfig . project || memoizedFindProject ( folder ) ;
4144
4245 /**
4346 * No iOS config found here
You can’t perform that action at this time.
0 commit comments