Skip to content

Commit

Permalink
change _.isUndefined to === undefined
Browse files Browse the repository at this point in the history
Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
  • Loading branch information
shirady committed Jun 13, 2024
1 parent c8c6e4f commit 7aa9ded
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/sdk/accountspace_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,15 +481,15 @@ class AccountSpaceFS {
}

_check_root_account(account) {
if (_.isUndefined(account.owner) ||
if (account.owner === undefined ||
account.owner === account._id) {
return true;
}
return false;
}

_check_root_account_owns_user(root_account, user_account) {
if (_.isUndefined(user_account.owner)) return false;
if (user_account.owner === undefined) return false;
return root_account._id === user_account.owner;
}

Expand Down Expand Up @@ -528,7 +528,7 @@ class AccountSpaceFS {
if (entry.name.includes(config.NSFS_TEMP_CONF_DIR_NAME)) return undefined;
if (this._check_root_account_owns_user(requesting_account, account_data)) {
if (should_filter_by_prefix) {
if (_.isUndefined(account_data.iam_path)) return undefined;
if (account_data.iam_path === undefined) return undefined;
if (!account_data.iam_path.startsWith(iam_path_prefix)) return undefined;
}
const user_data = {
Expand Down Expand Up @@ -655,7 +655,7 @@ class AccountSpaceFS {
return { is_root_account_or_user_on_itself, requester};
}
// user (on himself) - username can be undefined
if (_.isUndefined(username) || requesting_account_name === username) {
if (username === undefined || requesting_account_name === username) {
const username_to_use = username ?? requesting_account_name;
requester = {
name: username_to_use,
Expand All @@ -679,7 +679,7 @@ class AccountSpaceFS {

_get_available_index_for_access_key(access_keys) {
// empty array or array with 1 access keys in index 1
if (access_keys.length === 0 || _.isUndefined(access_keys[0])) {
if (access_keys.length === 0 || access_keys[0] === undefined) {
return 0;
}
return 1;
Expand Down

0 comments on commit 7aa9ded

Please sign in to comment.