file.exists() should return a bool instead of always truthy [bool] #825
Labels
api: storage
Issues related to the googleapis/nodejs-storage API.
type: question
Request for information or clarification. Not an issue.
As illustrated in the code comment, checking if a file exists can be done along these lines:
That's fantastically useful. However, the response from this method is not a bool as anyone looking at the function name would assume. Instead, it returns a bool wrapped in an array. This means the response always evaluates truthy.
Developers paying attention will realize something is wrong. Developers that do not test for missing files will ship broken code.
The text was updated successfully, but these errors were encountered: