Skip to content

Commit

Permalink
fixing linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ml054 committed May 17, 2022
1 parent 14c7fc5 commit 78a22ee
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Documents/Commands/MultiGet/MultiGetCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export class MultiGetCommand extends RavenCommand<GetResponse[]> implements IDis
// (include the IP and port of the old node), because of that the client
// needs to get those docs again from the new node.

for (let command of this._commands) {
for (const command of this._commands) {
delete command.headers[HEADERS.IF_NONE_MATCH];
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Documents/Identity/HiloIdGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class HiloIdGenerator {
// local range is not exhausted yet
const range = this._range;

let id = range.increment();
const id = range.increment();
if (id <= range.maxId) {
return id;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Documents/Session/AbstractDocumentQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2381,7 +2381,7 @@ export abstract class AbstractDocumentQuery<T extends object, TSelf extends Abst
this._revisionsIncludesTokens = [];
}

for (let changeVector of revisionsToIncludeByChangeVector) {
for (const changeVector of revisionsToIncludeByChangeVector) {
this._revisionsIncludesTokens.push(RevisionIncludesToken.createForPath(changeVector));
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/Documents/Session/Tokens/WhereToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,17 @@ export class WhereToken extends QueryToken {
}

public writeTo(writer): void {
// tslint:disable-next-line:triple-equals
if (this.options.boost != null) {
writer.append("boost(");
}

// tslint:disable-next-line:triple-equals
if (this.options.fuzzy != null) {
writer.append("fuzzy(");
}

// tslint:disable-next-line:triple-equals
if (this.options.proximity != null) {
writer.append("proximity(");
}
Expand Down Expand Up @@ -216,20 +219,23 @@ export class WhereToken extends QueryToken {
writer.append(")");
}

// tslint:disable-next-line:triple-equals
if (this.options.proximity != null) {
writer
.append(", ")
.append(this.options.proximity)
.append(")");
}

// tslint:disable-next-line:triple-equals
if (this.options.fuzzy != null) {
writer
.append(", ")
.append(this.options.fuzzy)
.append(")");
}

// tslint:disable-next-line:triple-equals
if (this.options.boost != null) {
writer
.append(", ")
Expand Down
2 changes: 1 addition & 1 deletion src/Documents/Subscriptions/SubscriptionWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export class SubscriptionWorker<T extends object> implements IDisposable {
if (connectionStatus.type !== "ConnectionStatus") {
let message = "Server returned illegal type message when expecting connection status, was:" + connectionStatus.type;

if (connectionStatus.type == "Error") {
if (connectionStatus.type === "Error") {
message += ". Exception: " + connectionStatus.exception;
}
throwError("InvalidOperationException", message);
Expand Down
1 change: 1 addition & 0 deletions src/Mapping/MetadataAsDictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class MetadataInternal {
}

private _metadataConvertValue(key, val) {
// tslint:disable-next-line:triple-equals
if (val == null) {
return null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Utility/TcpUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class TcpUtils {
for (const url of info.urls) {
try {
const socket = await this.connect(url, serverCertificate, clientCertificate);
const supportedFeatures = await this.invokeNegotiation(info, operationType, negotiationCallback, url, socket);
const supportedFeatures = await this._invokeNegotiation(info, operationType, negotiationCallback, url, socket);
return new ConnectSecuredTcpSocketResult(url, socket, supportedFeatures);
} catch {
// ignored
Expand All @@ -79,11 +79,11 @@ export class TcpUtils {
}

const socket = await this.connect(info.url, serverCertificate, clientCertificate);
const supportedFeatures = await this.invokeNegotiation(info, operationType, negotiationCallback, info.url, socket);
const supportedFeatures = await this._invokeNegotiation(info, operationType, negotiationCallback, info.url, socket);
return new ConnectSecuredTcpSocketResult(info.url, socket, supportedFeatures);
}

private static invokeNegotiation(info: TcpConnectionInfo, operationType: OperationTypes, negotiationCallback: NegotiationCallback, url: string, socket: Socket) {
private static _invokeNegotiation(info: TcpConnectionInfo, operationType: OperationTypes, negotiationCallback: NegotiationCallback, url: string, socket: Socket) {
switch (operationType) {
case "Subscription":
return negotiationCallback(url, info, socket);
Expand Down
2 changes: 1 addition & 1 deletion test/Documents/Commands/PutDocumentCommandTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe("PutDocumentCommand", function () {
user.name = nameWithEmojis;
user.age = 31;

let node = store.conventions.objectMapper.toObjectLiteral(user);
const node = store.conventions.objectMapper.toObjectLiteral(user);

const command = new PutDocumentCommand("users/2", null, node);
await store.getRequestExecutor().execute(command);
Expand Down
2 changes: 1 addition & 1 deletion test/Ported/HiLoTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ describe("HiLo", function () {
const usersIds = new Map<number, boolean>();
const productsIds = new Map<number, boolean>();

let count = 10;
const count = 10;
const tasks: Promise<void>[] = [];

for (let i = 0; i < count; i++) {
Expand Down

0 comments on commit 78a22ee

Please sign in to comment.