Comparing version 3.0.0 to 3.1.0
@@ -18,2 +18,13 @@ /** | ||
function extend(obj) { | ||
var i, prop, source; | ||
for (i = 1; i < arguments.length; ++i) { | ||
source = arguments[i]; | ||
for (prop in source) { | ||
obj[prop] = source[prop]; | ||
} | ||
} | ||
return obj; | ||
} | ||
function Client(apiRoot, options) { | ||
@@ -82,3 +93,3 @@ if (typeof apiRoot === 'undefined') { | ||
this._descriptorCache[uri] = xhr(options) | ||
this._descriptorCache[uri] = xhr(extend({}, this._options.walkOptions, options)) | ||
.then(function(descriptor) { | ||
@@ -85,0 +96,0 @@ return new Resource(descriptor, this._options.requestOptions); |
{ | ||
"name": "be-hippo", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "A PropositionH hypermedia consumer", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -61,2 +61,14 @@ define(['chai-as-promised', 'lib/client', 'lib/resource'], function(chaiAsPromised, Client, Resource) { | ||
it('passes walk options to the walk request', function() { | ||
var options = { walkOptions: { headers: { foo: 'hello' } } }; | ||
var client = new Client('/v1/foo', options); | ||
server.respondWith('OPTIONS', '/v1/foo', function(req) { | ||
expect(req.requestHeaders.foo).to.eql('hello'); | ||
req.respond.apply(req, response); | ||
}); | ||
return client.walk(); | ||
}); | ||
it('passes request options to created resources', function() { | ||
@@ -63,0 +75,0 @@ var options = { requestOptions: { headers: { foo: 'hello' } } }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79129
2010