Skip to content
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

Add overridden type annotations on normalise_file() to remove @ts-i… #4315

Merged
merged 2 commits into from
May 29, 2023
Merged
Changes from 1 commit
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
20 changes: 17 additions & 3 deletions client/js/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -708,10 +708,25 @@ function transform_output(
return transformed_data;
}

export function normalise_file(
file: Array<FileData> | FileData | string | null,
function normalise_file(
file: Array<FileData>,
root: string,
root_url: string | null
): Array<FileData>;
function normalise_file(
file: FileData | string,
root: string,
root_url: string | null
): FileData;
function normalise_file(
file: null,
root: string,
root_url: string | null
): null;
function normalise_file(
file,
root,
root_url
): Array<FileData> | FileData | null {
if (file == null) return null;
if (typeof file === "string") {
Expand All @@ -726,7 +741,6 @@ export function normalise_file(
if (x === null) {
normalized_file.push(null);
} else {
//@ts-ignore
normalized_file.push(normalise_file(x, root, root_url));
}
}
Expand Down