Skip to content

fix: Add changes for skoda usecase#71

Draft
swetabar wants to merge 1 commit intomainfrom
skoda-usecase
Draft

fix: Add changes for skoda usecase#71
swetabar wants to merge 1 commit intomainfrom
skoda-usecase

Conversation

@swetabar
Copy link
Contributor

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

const pathSegments = u.pathname.split('/').filter(Boolean);

// Look for a segment with an extension (e.g., "diabetologie.svg" in path)
let filename = null;
Copy link
Contributor

@atopper atopper Oct 27, 2025

Choose a reason for hiding this comment

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

Could you get the filename by doing something like:
const filenameWithExtension = u.pathname.split('/').pop();
Similar to line 204 but gets the last immedately.

Then extension:
const fileExtension = filenameWithExtension.split('.').pop();

I see the loop goes backwards (handling periods in path segments), which works but might be a little awkward to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants