Skip to content
Closed
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
4 changes: 2 additions & 2 deletions lib/bindings/http/emitter_binary_0_1.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ HTTPBinary.prototype.emit = function(cloudevent){
Object.keys(headerByGetter)
.filter((getter) => cloudevent[getter]())
.forEach((getter) => {
let header = headerByGetter[getter];
const header = headerByGetter[getter];
_headers[header.name] =
header.parser(
cloudevent[getter]()
Expand All @@ -82,7 +82,7 @@ HTTPBinary.prototype.emit = function(cloudevent){
Object.keys(exts)
.filter((ext) => Object.hasOwnProperty.call(exts, ext))
.forEach((ext) => {
let capsExt = ext.charAt(0).toUpperCase() + ext.slice(1);
const capsExt = ext.charAt(0).toUpperCase() + ext.slice(1);
_headers["CE-X-" + capsExt] = exts[ext];
});

Expand Down
4 changes: 2 additions & 2 deletions lib/bindings/http/receiver_binary.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ BinaryHTTPReceiver.prototype.check = function(payload, headers) {
};

function parserFor(parsersByEncoding, cloudevent, headers){
let encoding = cloudevent.spec.payload["datacontentencoding"];
const encoding = cloudevent.spec.payload["datacontentencoding"];
return parsersByEncoding[encoding][headers[Constants.HEADER_CONTENT_TYPE]];
}

Expand Down Expand Up @@ -108,7 +108,7 @@ BinaryHTTPReceiver.prototype.parse = function(payload, headers) {
});

// Parses the payload
let parsedPayload =
const parsedPayload =
parserFor(this.parsersByEncoding, cloudevent, sanityHeaders)
.parse(payload);

Expand Down
4 changes: 2 additions & 2 deletions lib/bindings/http/receiver_structured.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ StructuredHTTPReceiver.prototype.parse = function(payload, headers) {
Array.from(Object.keys(this.setterByAttribute))
.filter((attribute) => event[attribute])
.forEach((attribute) => {
let setterName = this.setterByAttribute[attribute].name;
let parserFun = this.setterByAttribute[attribute].parser;
const setterName = this.setterByAttribute[attribute].name;
const parserFun = this.setterByAttribute[attribute].parser;

// invoke the setter function
cloudevent[setterName](parserFun(event[attribute]));
Expand Down
6 changes: 3 additions & 3 deletions lib/specs/spec_0_3.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Spec03.prototype.check = function(ce){
.filter((tc) => tc["datacontentencoding"])
.filter((tc) => (typeof tc.data) === "string")
.map((tc) => {
let newtc = clone(tc);
const newtc = clone(tc);
newtc.datacontentencoding =
newtc.datacontentencoding.toLocaleLowerCase("en-US");

Expand Down Expand Up @@ -210,8 +210,8 @@ Spec03.prototype.data = function(_data){
return this;
};
Spec03.prototype.getData = function() {
let dct = this.payload["datacontenttype"];
let dce = this.payload["datacontentencoding"];
const dct = this.payload["datacontenttype"];
const dce = this.payload["datacontentencoding"];

if(dct && !dce){
this.payload["data"] = asData(this.payload["data"], dct);
Expand Down
6 changes: 3 additions & 3 deletions lib/specs/spec_1.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ function Spec1(_caller) {
this.spec.check();

// Check before getData() call
let isbin = isBinary(this.spec.payload[RESERVED_ATTRIBUTES.data]);
const isbin = isBinary(this.spec.payload[RESERVED_ATTRIBUTES.data]);

// May be used, if isbin==true
let payload = clone(this.spec.payload);
const payload = clone(this.spec.payload);

// To run asData()
this.getData();
Expand Down Expand Up @@ -190,7 +190,7 @@ Spec1.prototype.data = function(_data){
return this;
};
Spec1.prototype.getData = function() {
let dct = this.payload["datacontenttype"];
const dct = this.payload["datacontenttype"];

if(dct){
this.payload["data"] = asData(this.payload["data"], dct);
Expand Down