Skip to content

Update typing for new TS versions #6365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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