Skip to content

fix: DEP0169#105

Merged
sjinks merged 2 commits intomainfrom
pltfrm-1195-deprecationwarning-passing-invalid-argument-types-to
Jul 3, 2025
Merged

fix: DEP0169#105
sjinks merged 2 commits intomainfrom
pltfrm-1195-deprecationwarning-passing-invalid-argument-types-to

Conversation

@sjinks
Copy link
Copy Markdown
Member

@sjinks sjinks commented Jul 3, 2025

This PR fixes the Passing invalid argument types to fs.existsSync is deprecated warning.

@sjinks sjinks self-assigned this Jul 3, 2025
@sjinks sjinks added bug Something isn't working [Status] Needs Review labels Jul 3, 2025
@sjinks sjinks requested a review from Copilot July 3, 2025 17:31

This comment was marked as outdated.

@sjinks sjinks requested a review from Copilot July 3, 2025 17:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses the deprecation warning triggered by calling fs.existsSync with non-string arguments by adding explicit type checks before invoking fs.existsSync.

  • Add typeof ... === 'string' guards before fs.existsSync calls in various filter chains in lib/lando.js.
  • Refactor the exports.loadFiles filter in lib/config.js to safely handle both string sources and objects with a file property.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
lib/lando.js Added string-type checks before calling fs.existsSync in multiple filter steps
lib/config.js Replaced simple fs.existsSync calls with a branch that validates source and source.file types
Comments suppressed due to low confidence (1)

lib/config.js:196

  • Consider adding unit tests for loadFiles to cover cases where inputs are non-strings or objects without a file property to ensure the filter logic behaves as expected.
    .filter(source => {

Comment thread lib/lando.js
Comment thread lib/config.js
@sjinks sjinks merged commit 25136fb into main Jul 3, 2025
24 checks passed
@sjinks sjinks deleted the pltfrm-1195-deprecationwarning-passing-invalid-argument-types-to branch July 3, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working [Status] Needs Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants