Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cases of PUT / DELETE HTTP methods #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions dist/hyperagent.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ define("hyperagent/properties",
// one large object for defineProperties first and call on that in the end
// and if that would make the code cleaner.
options = options || {};
if (Object(response) !== response) {
throw new Error('The Properties argument must be an object.');
if (!response) {
response = {};
}
// Overwrite the response object with the original properties if provided.
config._.defaults(response, options.original || {});
Expand Down Expand Up @@ -688,4 +688,4 @@ define("hyperagent/resource",
__exports__.LinkResource = LinkResource;
});
window.Hyperagent = requireModule('hyperagent');
}());
}());
4 changes: 2 additions & 2 deletions lib/hyperagent/properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export function Properties(response, options) {
// one large object for defineProperties first and call on that in the end
// and if that would make the code cleaner.
options = options || {};
if (Object(response) !== response) {
throw new Error('The Properties argument must be an object.');
if (!response) {
response = {};
}
// Overwrite the response object with the original properties if provided.
config._.defaults(response, options.original || {});
Expand Down