[go: up one dir, main page]

Skip to content

Commit

Permalink
Update typing for new TS version (#6365)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwyfrequency committed Jun 17, 2022
1 parent efe2000 commit d87d3a8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
11 changes: 7 additions & 4 deletions packages/analytics/src/get-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ async function attemptFetchDynamicConfigWithRetry(
logger.warn(
`Timed out fetching this Firebase app's measurement ID from the server.` +
` Falling back to the measurement ID ${measurementId}` +
` provided in the "measurementId" field in the local Firebase config. [${e.message}]`
` provided in the "measurementId" field in the local Firebase config. [${
(e as Error)?.message
}]`
);
return { appId, measurementId };
}
Expand All @@ -203,13 +205,14 @@ async function attemptFetchDynamicConfigWithRetry(

return response;
} catch (e) {
if (!isRetriableError(e)) {
const error = e as Error;
if (!isRetriableError(error)) {
retryData.deleteThrottleMetadata(appId);
if (measurementId) {
logger.warn(
`Failed to fetch this Firebase app's measurement ID from the server.` +
` Falling back to the measurement ID ${measurementId}` +
` provided in the "measurementId" field in the local Firebase config. [${e.message}]`
` provided in the "measurementId" field in the local Firebase config. [${error?.message}]`
);
return { appId, measurementId };
} else {
Expand All @@ -218,7 +221,7 @@ async function attemptFetchDynamicConfigWithRetry(
}

const backoffMillis =
Number(e.customData.httpStatus) === 503
Number(error?.customData?.httpStatus) === 503
? calculateBackoffMillis(
backoffCount,
retryData.intervalMillis,
Expand Down
2 changes: 1 addition & 1 deletion packages/messaging/src/internals/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export async function requestDeleteToken(
}
} catch (err) {
throw ERROR_FACTORY.create(ErrorCode.TOKEN_UNSUBSCRIBE_FAILED, {
errorInfo: err
errorInfo: (err as Error)?.toString()
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions repo-scripts/size-analysis/analyze-all-bundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export async function generateReportForBundles(
input: version ? `${outputDir}/${bundle}` : `${definitionDir}/${bundle}`,
bundler: Bundler.Rollup,
mode: version ? Mode.Npm : Mode.Local,
output: output,
output,
debug: true
};
console.log(`Running for bundle "${bundle}" with mode "${option.mode}".`);
Expand All @@ -78,7 +78,7 @@ function overwriteVersion(
bundle: string,
temp: string,
version: string
) {
): void {
const definitions = JSON.parse(
fs.readFileSync(`${definitionDir}/${bundle}`, { encoding: 'utf-8' })
);
Expand All @@ -93,7 +93,7 @@ function overwriteVersion(
});
}

function parseAnalysisOutput(product: string, output: string) {
function parseAnalysisOutput(product: string, output: string): Report[] {
const analyses = JSON.parse(fs.readFileSync(output, { encoding: 'utf-8' }));
const results: Report[] = [];
for (const analysis of analyses) {
Expand Down
2 changes: 1 addition & 1 deletion repo-scripts/size-analysis/test/size-analysis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe('extractExports', () => {
describe('extractAllTopLevelSymbols', () => {
let subsetExportsBundleFile: string;
let extractedDeclarations: MemberList;
before(function () {
before(() => {
const start = Date.now();
subsetExportsBundleFile = getSubsetExportsBundleFilePath();
extractedDeclarations = extractAllTopLevelSymbols(subsetExportsBundleFile);
Expand Down

0 comments on commit d87d3a8

Please sign in to comment.