diff --git a/src/analysis.ts b/src/analysis.ts index e8b27e77..88c9b83b 100644 --- a/src/analysis.ts +++ b/src/analysis.ts @@ -1,7 +1,7 @@ /* eslint-disable no-await-in-loop */ import omit from 'lodash.omit'; -import { AnalyzeFoldersOptions, prepareExtendingBundle, resolveBundleFilePath } from './files'; +import { AnalyzeFoldersOptions, prepareExtendingBundle, resolveBundleFilePath, calcHash } from './files'; import { POLLING_INTERVAL } from './constants'; import { GetAnalysisErrorCodes, @@ -111,6 +111,7 @@ export async function analyzeFolders(options: FileAnalysisOptions): Promise { - return crypto.createHash(HASH_ALGORITHM).update(content).digest(ENCODE_TYPE); - }; - let fileContent = ''; let fileHash = ''; if (!withContent && !!cache) { diff --git a/src/http.ts b/src/http.ts index 35ba6641..280219a0 100644 --- a/src/http.ts +++ b/src/http.ts @@ -382,6 +382,7 @@ const GET_ANALYSIS_ERROR_MESSAGES: { [P in GetAnalysisErrorCodes]: string } = { }; export interface AnalysisOptions { + readonly shard?: string; readonly severity?: number; readonly limitToFiles?: string[]; readonly prioritized?: boolean; @@ -407,6 +408,7 @@ export async function getAnalysis( type: 'file', hash: options.bundleHash, limitToFiles: options.limitToFiles || [], + ...(options.shard ? {shard: options.shard} : null), }, ...pick(options, ['severity', 'prioritized', 'legacy']), },