cordova-plugin-file
cordova-plugin-file copied to clipboard
getParent returns always root directory
Bug Report
Problem
getParent() returns always the root directory instead of the parent directory.
What is expected to happen?
getParent() on directory /documents/upload/foobar/ should return /documents/upload/
What does actually happen?
getParent() return /
Information
Command or Code
https://github.com/apache/cordova-plugin-file/blob/master/src/windows/FileProxy.js#L553
(new RegExp('/[^/]*/?$')).test(path)
is always true
Environment, Platform, Device
UWP Windows 10 18362.449
Version information
cordova: 8.1.2 cordova-windows: 6.0.1 cordova-plugin-file: 5.00
Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
Adding a leading ^to the pattern would fix the issue.
(new RegExp('^/[^/]*/?$')).test(path)
Is there a better place to post issues than here?