Environment
Node 20.17.0, pathe 1.1.2
Reproduction
const { filename } = require("pathe/utils")
console.log(filename('/Users/connor/foo/bar')) // 'bar' ✅
console.log(filename('/Users/connor.pearson/foo/bar.js')) // 'bar' ✅
console.log(filename('/Users/connor.pearson/foo/bar')) // 'connor' ❌ (Expected 'bar')
Describe the bug
When given a path where the file does not have an extension, and an ancestor directory contains a period, the filename function returns the first segment of the ancestor directory rather than the file.
Additional context
No response
Logs
No response