Skip to content
Merged
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
use .length to check for empty string
  • Loading branch information
gurgunday committed Oct 16, 2024
commit 5732d4dc99d6255efaf1dca95fa57bc330578b95
2 changes: 1 addition & 1 deletion lib/internal/modules/esm/fetch_module.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ allowList.addRange('127.0.0.1', '127.255.255.255');
async function isLocalAddress(hostname) {
try {
if (
hostname &&
hostname.length &&
hostname[0] === '[' &&
hostname[hostname.length - 1] === ']'
) {
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/process/per_thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ function buildAllowedFlags() {
}

function isAccepted(to) {
if (!to || to[0] !== '-' || to === '--') return true;
if (!to.length || to[0] !== '-' || to === '--') return true;
const recursiveExpansion = aliases.get(to);
if (recursiveExpansion) {
if (recursiveExpansion[0] === to)
Expand Down