You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// lib/core/file.jsfunctionisDirectoryEmpty(path){returnnewPromise((resolve,reject)=>{
...
resolve(noFilesPresent,path);// I think this is impossible?
...
});}
I don't think that native promises can be resolved with more than one value. I would expect path to be lost here without fail. I caught this while trying to experimenting with adding Flow type annotations for some inline documentation.
@chalkers, do you know if that's right? Haven't chased the thread here yet to see what the expected behavior is.
You're right: A promise can only yield one result. I believe a method named isDirectoryEmpty should return exactly that: A boolean value indicating whether the directory is empty or not. If you really want to return the path as well, you may return an object instead:
I don't think that native promises can be resolved with more than one value. I would expect path to be lost here without fail. I caught this while trying to experimenting with adding Flow type annotations for some inline documentation.
@chalkers, do you know if that's right? Haven't chased the thread here yet to see what the expected behavior is.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then
The text was updated successfully, but these errors were encountered: