yakovkhalinsky/backblaze-b2

filename vs fileName inconsistency

Closed this issue · 8 comments

The method b2.uploadFile() seems to use filename as an arg, while most (if not all) others like b2.deleteFileVersion() use fileName.

Perhaps we could change b2.uploadFile() to use fileName by default, but fallback to filename so we don't break the library for everyone?

A valid observation, thank you for the feedback @jamiesyme

@cbess However the B2 API uses fileName in it's responses so perhaps we should use that to be consistent.

cbess commented

Good point. Or perhaps they should match nodejs consistency :)

Yeah good question, having a quick look through our functions I can see that our b2.uploadFile() takes an object with a filename property and everywhere else we use the camel case fileName, I vote for keeping fileName and fixing instances that use filename.

How do you guys feel about that?

On a related note, I think this change should probably go into the next minor release 1.1.0

Sounds good to me. I'll make a PR.

cbess commented

makes sense