Skip to content

Commit

Permalink
js [nfc]: Remove some useless param defaulting
Browse files Browse the repository at this point in the history
I caught these while experimenting with a new(ish) eslint rule:
  https://eslint.org/docs/rules/default-param-last
  • Loading branch information
chrisbobbe committed May 26, 2022
1 parent e6824f3 commit ace1ab2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/users/userHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const filterUserList = (

export const filterUserStartWith = (
users: $ReadOnlyArray<AutocompleteOption>,
filter: string = '',
filter: string,
ownUserId: UserId,
): $ReadOnlyArray<AutocompleteOption> => {
const loweredFilter = filter.toLowerCase();
Expand All @@ -92,7 +92,7 @@ export const filterUserStartWith = (

export const filterUserThatContains = (
users: $ReadOnlyArray<AutocompleteOption>,
filter: string = '',
filter: string,
ownUserId: UserId,
): $ReadOnlyArray<AutocompleteOption> => {
const loweredFilter = filter.toLowerCase();
Expand All @@ -105,7 +105,7 @@ export const filterUserThatContains = (

export const filterUserMatchesEmail = (
users: $ReadOnlyArray<AutocompleteOption>,
filter: string = '',
filter: string,
ownUserId: UserId,
): $ReadOnlyArray<AutocompleteOption> =>
users.filter(
Expand All @@ -128,7 +128,7 @@ export const getUsersAndWildcards = (

export const getAutocompleteSuggestion = (
users: $ReadOnlyArray<AutocompleteOption>,
filter: string = '',
filter: string,
ownUserId: UserId,
mutedUsers: MutedUsersState,
): $ReadOnlyArray<AutocompleteOption> => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/internalLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { pmKeyRecipientsFromIds } from './recipient';

// TODO: Work out what this does, write a jsdoc for its interface, and
// reimplement using URL object (not just for the realm)
const getPathsFromUrl = (url: string = '', realm: URL) => {
const getPathsFromUrl = (url: string, realm: URL) => {
const paths = url
.split(realm.toString())
.pop()
Expand Down
2 changes: 1 addition & 1 deletion src/utils/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const tryParseUrl = (url: string, base?: string | URL): URL | void => {

// TODO: Work out what this does, write a jsdoc for its interface, and
// reimplement using URL object (not just for the realm)
export const isUrlOnRealm = (url: string = '', realm: URL): boolean =>
export const isUrlOnRealm = (url: string, realm: URL): boolean =>
url.startsWith('/') || url.startsWith(realm.toString()) || !/^(http|www.)/i.test(url);

const getResourceWithAuth = (uri: string, auth: Auth) => ({
Expand Down

0 comments on commit ace1ab2

Please sign in to comment.