[File] checkFile fails if file does not exist, instead of resolve boolean.
Closed this issue · 2 comments
fudom commented
Bug Report
Current behavior:
checkFile
rejects if file does not exist.
Expected behavior:
Resolve to boolean as described in type Promise<boolean>
. false
: Does not exist. true
: File exists.
Steps to reproduce:
const exists = await this.file.checkFile(path, name);
Android 13, cordova-plugin-file 8.0.1, @awesome-cordova-plugins/file 6.4.0
fudom commented
What is this? I mean code like Promise.reject<boolean>(new Error())
. In what world is an Error a Boolean? And why define return type Boolean (in Promise) when you reject instead of resolve(false)? Use Promise<void>
instead or do it right. It's messy. Or what is the reason behind?
awesome-cordova-plugins/src/@awesome-cordova-plugins/plugins/file/index.ts
Lines 957 to 973 in bddafc7
github-actions commented
There has been no recent activity and this issue has been marked inactive.