Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = function(config) {

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai'],
frameworks: ['jasmine'],


// list of files / patterns to load in the browser
Expand Down
137 changes: 11 additions & 126 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,17 @@
"devDependencies": {
"@babel/core": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"chai": "^4.1.2",
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.16.0",
"karma": "^4.2.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-mocha": "^1.3.0",
"mocha": "^5.2.0",
"karma-jasmine": "^4.0.1",
"prettier": "^1.16.4",
"puppeteer": "^1.18.1",
"rollup": "^0.63.2",
"rollup-plugin-babel": "^4.0.3"
}
},
"dependencies": {}
}
11 changes: 9 additions & 2 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ class DICOMwebClient {
}

if (requestInterceptors) {
console.debug('yes')
const metadata = { method, url };
const pipeRequestInterceptors = functions => (args) => functions.reduce((args, fn) => fn(args, metadata), args);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest adding a couple of runtime checks here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Let me know if I should add more. Thanks.

const pipedRequest = pipeRequestInterceptors(requestInterceptors);
Expand All @@ -212,7 +213,10 @@ class DICOMwebClient {
* @private
*/
_httpGet(url, headers, responseType, progressCallback) {
return this._httpRequest(url, "get", headers, { responseType, progressCallback });
return this._httpRequest(url, "get", headers, {
responseType,
progressCallback
});
}

/**
Expand Down Expand Up @@ -648,7 +652,10 @@ class DICOMwebClient {
* @returns {Promise} Response
*/
_httpPost(url, headers, data, progressCallback) {
return this._httpRequest(url, "post", headers, { data, progressCallback });
return this._httpRequest(url, "post", headers, {
data,
progressCallback
});
}

/**
Expand Down
Loading