util: Fix spelling mistake.

This commit is contained in:
Aman Agrawal
2025-05-02 15:40:46 +05:30
committed by Tim Abbott
parent b8923128c9
commit 903e65aba8
5 changed files with 8 additions and 8 deletions

View File

@@ -319,7 +319,7 @@ function format_dm(
const context = {
conversation_key: user_ids_string,
is_direct: true,
rendered_dm_with: util.format_array_as_list_with_conjuction(rendered_dm_with, "long"),
rendered_dm_with: util.format_array_as_list_with_conjunction(rendered_dm_with, "long"),
is_group: recipient_ids.length > 1,
user_circle_class,
is_bot,

View File

@@ -469,7 +469,7 @@ export function format_recipients(
users_ids_string: string,
join_strategy: "long" | "narrow",
): string {
const formatted_recipients_string = util.format_array_as_list_with_conjuction(
const formatted_recipients_string = util.format_array_as_list_with_conjunction(
get_recipients(users_ids_string),
join_strategy,
);

View File

@@ -88,7 +88,7 @@ export function get_pygments_typeahead_list_for_settings(query: string): Map<str
}
for (const [key, values] of map_pygments_pretty_name_to_aliases) {
const formatted_string = util.format_array_as_list_with_conjuction(values, "narrow");
const formatted_string = util.format_array_as_list_with_conjunction(values, "narrow");
language_labels.set(key, key + " (" + formatted_string + ")");
}

View File

@@ -441,7 +441,7 @@ export function format_array_as_list(
return list_formatter.format(array);
}
export function format_array_as_list_with_conjuction(
export function format_array_as_list_with_conjunction(
array: string[],
// long uses "and", narrow uses commas.
join_strategy: "long" | "narrow",

View File

@@ -374,11 +374,11 @@ run_test("format_array_as_list", () => {
// Conjunction format
assert.equal(
util.format_array_as_list_with_conjuction(array, "narrow"),
util.format_array_as_list_with_conjunction(array, "narrow"),
"apple, banana, orange",
);
assert.equal(
util.format_array_as_list_with_conjuction(array, "long"),
util.format_array_as_list_with_conjunction(array, "long"),
"apple, banana, and orange",
);
@@ -395,11 +395,11 @@ run_test("format_array_as_list", () => {
);
assert.equal(
util.format_array_as_list_with_conjuction(array, "narrow"),
util.format_array_as_list_with_conjunction(array, "narrow"),
"apple, banana, orange",
);
assert.equal(
util.format_array_as_list_with_conjuction(array, "long"),
util.format_array_as_list_with_conjunction(array, "long"),
"apple, banana, orange",
);
});