Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit a8b2bc8

Browse files
authored
refactor: update helpers (#1055)
* refactor: update helpers * chore: updates after review
1 parent 1da8666 commit a8b2bc8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

helpers.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,17 @@ export function trackDownloadProgress(destinationStream: NodeJS.WritableStream,
7777
return progressStream;
7878
}
7979

80+
export function isAllowedFinalFile(item: string): RegExpMatchArray {
81+
return item.match(/.*\.aar/) ||
82+
item.match(".*include.gradle");
83+
}
84+
85+
export function isRecommendedAarFile(foundAarFile: string, packageJsonPluginName: string): boolean {
86+
const filename = foundAarFile.replace(/^.*[\\\/]/, '');
87+
packageJsonPluginName = packageJsonPluginName.replace(/[\-]/g, "_");
88+
return `${packageJsonPluginName}.aar` === filename;
89+
}
90+
8091
export async function executeActionByChunks<T>(initialData: T[] | IDictionary<T>, chunkSize: number, elementAction: (element: T, key?: string | number) => Promise<any>): Promise<void> {
8192
let arrayToChunk: (T | string)[];
8293
let action: (key: string | T) => Promise<any>;

0 commit comments

Comments
 (0)