-
Notifications
You must be signed in to change notification settings - Fork 12
Add CI and unit tests #29
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All methods and functions in javascript that are not constructors should be named using camel case and not pascal case - this is the industry standard. If we are refactoring this SDK then it might be a good idea to change those sooner than later.
src/download.js
Outdated
@@ -24,4 +30,4 @@ function DownloadFile(path, skylink, opts) { | |||
}); | |||
} | |||
|
|||
module.exports = { DownloadFile }; | |||
module.exports = { DefaultDownloadOptions, DownloadFile }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to export DefaultDownloadOptions
- they will be merged in if customOptions
are specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are already exporting these (I'm just changing how we export it for consistency, there is apparently more than one way in JS...) so removing it would be a breaking change. Also, I think it's worthwhile for these to be exported so that developers can access the defaults if they want. If you disagree, write an issue on the skynet-docs repo so we remember to apply the change to all the SDKs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These variables should follow camel case convention then.
src/upload.js
Outdated
}) | ||
.catch((error) => { | ||
reject(error); | ||
}); | ||
}); | ||
} | ||
|
||
module.exports = { UploadFile, UploadDirectory }; | ||
module.exports = { DefaultUploadOptions, UploadFile, UploadDirectory }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as with DefaultDownloadOptions
, we don't need to expose DefaultUploadOptions
since they will be merged in with the customOptions
anyway
src/download.js
Outdated
@@ -24,4 +30,4 @@ function DownloadFile(path, skylink, opts) { | |||
}); | |||
} | |||
|
|||
module.exports = { DownloadFile }; | |||
module.exports = { DefaultDownloadOptions, DownloadFile }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These variables should follow camel case convention then.
No description provided.