Skip to content

Commit

Permalink
code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Nov 25, 2023
1 parent 509233a commit 7cfc1be
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/registry/event-catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class EventCatalog {
if (!utils.match(ctx.eventName, list.name)) return;
if (
ctx.eventGroups == null ||
ctx.eventGroups.length == 0 ||
ctx.eventGroups.length === 0 ||
ctx.eventGroups.indexOf(list.group) !== -1
) {
if (isBroadcast) {
Expand Down
8 changes: 4 additions & 4 deletions src/tracing/exporters/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ class ConsoleTraceExporter extends BaseTraceExporter {
if (item.children.length > 0) {
item.children.forEach((spanID, idx) => {
const span = this.spans[spanID];
span.first = idx == 0;
span.last = idx == item.children.length - 1;
span.first = idx === 0;
span.last = idx === item.children.length - 1;
check(span, item.level + 1, [].concat(item.parents, [item]));
});
}
Expand Down Expand Up @@ -250,8 +250,8 @@ class ConsoleTraceExporter extends BaseTraceExporter {
if (spanItem.children.length > 0)
spanItem.children.forEach((spanID, idx) =>
this.printSpanTime(this.spans[spanID], mainItem, level + 1, spanItem, {
first: idx == 0,
last: idx == spanItem.children.length - 1
first: idx === 0,
last: idx === spanItem.children.length - 1
})
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/tracing/tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class Tracer {

if (this.opts.sampling.rate === 0) return false;

if (this.opts.sampling.rate == 1) return true;
if (this.opts.sampling.rate === 1) return true;

if (++this.sampleCounter * this.opts.sampling.rate >= 1.0) {
this.sampleCounter = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/transit.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ class Transit {
}
}

return stream && payload.seq == 0 ? stream : null;
return stream && payload.seq === 0 ? stream : null;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/transporters/tcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class TcpTransporter extends Transporter {
if (s.startsWith("tcp://")) s = s.replace("tcp://", "");

const p = s.split("/");
if (p.length != 2) {
if (p.length !== 2) {
this.logger.warn("Invalid endpoint URL. Missing nodeID. URL:", s);
return;
}
Expand Down

0 comments on commit 7cfc1be

Please sign in to comment.