s3-blob-store
s3-blob-store copied to clipboard
Refactor and docs
This PR brings in backward compatible public API changes to support passing optional s3opts param. JSDoc annotations are being added to support documentation generation. 🎉
Ok I'll bring them back and mark as deprecated with warning saying they'll be removed in upcoming v5 major version.
On Sun, Feb 16, 2020, 01:44 William Casarin [email protected] wrote:
@jb55 commented on this pull request.
In index.js https://github.com/jb55/s3-blob-store/pull/23#discussion_r379866278:
-S3BlobStore.prototype.uploadParams = function (opts) {
- opts = Object.assign({}, opts, {
- params: Object.assign({}, opts.params)
- });
- var filename = opts.name || opts.filename;
- var key = opts.key || filename;
- var contentType = opts.contentType;
- var params = opts.params;
- params.Bucket = params.Bucket || this.bucket;
- params.Key = params.Key || key;
- if (!contentType) {
- contentType = filename ? mime.lookup(filename) : mime.lookup(opts.key);
- }
- if (contentType) params.ContentType = contentType;
- return params; -};
-S3BlobStore.prototype.downloadParams = function (opts) {
- var params = this.uploadParams(opts);
- delete params.ContentType;
- return params; -};
unless the behavior is exactly the same I would consider it a breaking change, so we can push this as v5 if so
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jb55/s3-blob-store/pull/23?email_source=notifications&email_token=AAI5YCAWX3BNVNDNS4FJYFLRDCD7HA5CNFSM4KV3TKZKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCVVZXLQ#discussion_r379866278, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI5YCBDBQT2HYOOALC6N53RDCD7HANCNFSM4KV3TKZA .
can we have the docs separate from the refactor? I would like to pull the docs for now and perhaps the refactor later after I have more time to review.
Commit wise I'm thinking doc commits first and then refactor commits after (with doc adjustments if needed)
needs rebase
needs rebase
✅ Done
needs rebase
✅ Done
awesome, much easier to see the changes now. thanks! will take a look at it soon