Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alcaeus

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alcaeus - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

lib/es/helpers/MergeHeaders.js

15

CHANGELOG.md

@@ -5,2 +5,17 @@ # Changelog

### [0.9.1](https://github.com/wikibus/alcaeus/compare/v0.9.0...v0.9.1) (2019-08-16)
### Bug Fixes
* headers do not get properly overridden when casing differs ([7f3a62e](https://github.com/wikibus/alcaeus/commit/7f3a62e))
* warn about unsupported media type ([661c966](https://github.com/wikibus/alcaeus/commit/661c966)), closes [#47](https://github.com/wikibus/alcaeus/issues/47)
### Tests
* make sure header merging accepts arrays ([93723f8](https://github.com/wikibus/alcaeus/commit/93723f8))
## [0.9.0](https://github.com/wikibus/alcaeus/compare/v0.8.1...v0.9.0) (2019-08-15)

@@ -7,0 +22,0 @@

7

lib/es/alcaeus.js
// tslint:disable no-console
import { Core } from './Constants';
import * as FetchUtil from './FetchUtil';
import { merge } from './helpers/MergeHeaders';
import { create } from './HydraResponse';

@@ -12,2 +13,3 @@ const getHydraResponse = async (alcaeus, response, uri, apiDocumentation) => {

}
console.warn(`No processor found for media type ${response.mediaType}`);
return create(uri, response);

@@ -85,8 +87,5 @@ };

const defaultHeaders = typeof this.defaultHeaders === 'function' ? this.defaultHeaders() : this.defaultHeaders;
return {
...(defaultHeaders || {}),
...headers,
};
return merge(defaultHeaders, headers);
}
}
//# sourceMappingURL=alcaeus.js.map
import 'isomorphic-fetch';
import * as Constants from './Constants';
import { ResponseWrapper } from './ResponseWrapper';
import { merge } from './helpers/MergeHeaders';
// tslint:disable:max-line-length

@@ -17,6 +18,3 @@ const requestAcceptHeaders = Constants.MediaTypes.jsonLd + ', ' + Constants.MediaTypes.ntriples + ', ' + Constants.MediaTypes.nquads;

}
requestInit.headers = new Headers({
...defaultHeaders,
...headers,
});
requestInit.headers = new Headers(merge(defaultHeaders, headers));
const res = await fetch(uri, requestInit);

@@ -23,0 +21,0 @@ return new ResponseWrapper(uri, res);

@@ -13,2 +13,3 @@ "use strict";

const FetchUtil = __importStar(require("./FetchUtil"));
const MergeHeaders_1 = require("./helpers/MergeHeaders");
const HydraResponse_1 = require("./HydraResponse");

@@ -22,2 +23,3 @@ const getHydraResponse = async (alcaeus, response, uri, apiDocumentation) => {

}
console.warn(`No processor found for media type ${response.mediaType}`);
return HydraResponse_1.create(uri, response);

@@ -95,3 +97,3 @@ };

const defaultHeaders = typeof this.defaultHeaders === 'function' ? this.defaultHeaders() : this.defaultHeaders;
return Object.assign({}, (defaultHeaders || {}), headers);
return MergeHeaders_1.merge(defaultHeaders, headers);
}

@@ -98,0 +100,0 @@ }

@@ -13,2 +13,3 @@ "use strict";

const ResponseWrapper_1 = require("./ResponseWrapper");
const MergeHeaders_1 = require("./helpers/MergeHeaders");
// tslint:disable:max-line-length

@@ -27,3 +28,3 @@ const requestAcceptHeaders = Constants.MediaTypes.jsonLd + ', ' + Constants.MediaTypes.ntriples + ', ' + Constants.MediaTypes.nquads;

}
requestInit.headers = new Headers(Object.assign({}, defaultHeaders, headers));
requestInit.headers = new Headers(MergeHeaders_1.merge(defaultHeaders, headers));
const res = await fetch(uri, requestInit);

@@ -30,0 +31,0 @@ return new ResponseWrapper_1.ResponseWrapper(uri, res);

{
"name": "alcaeus",
"version": "0.9.0",
"version": "0.9.1",
"description": "Hydra Core hypermedia-aware client library",

@@ -22,2 +22,3 @@ "main": "lib/node/index.js",

"build:gitbook": "gitbook install; gitbook build . docs/latest",
"gitbook": "gitbook serve",
"lint": "eslint . --ext .ts --quiet",

@@ -50,2 +51,7 @@ "prepare": "rm -rf lib; npm run build",

"es6-url-template": "^1.0.3",
"gitbook-plugin-advanced-emoji": "^0.2.2",
"gitbook-plugin-etoc": "^1.2.2",
"gitbook-plugin-forkmegithub": "^2.2.0",
"gitbook-plugin-hints": "^1.0.2",
"gitbook-plugin-runkit": "0.0.1",
"isomorphic-fetch": "^2.2.1",

@@ -52,0 +58,0 @@ "jsonld": "^1.4.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc