Enable prefer-const lint rule (#3202)
This commit is contained in:
committed by
Florent Vilmart
parent
a6c988176e
commit
ca286b7108
@@ -3,7 +3,7 @@ import logger from '../logger';
|
||||
import type { FlattenedObjectData } from './Subscription';
|
||||
export type Message = { [attr: string]: any };
|
||||
|
||||
let dafaultFields = ['className', 'objectId', 'updatedAt', 'createdAt', 'ACL'];
|
||||
const dafaultFields = ['className', 'objectId', 'updatedAt', 'createdAt', 'ACL'];
|
||||
|
||||
class Client {
|
||||
id: number;
|
||||
@@ -63,7 +63,7 @@ class Client {
|
||||
|
||||
_pushEvent(type: string): Function {
|
||||
return function(subscriptionId: number, parseObjectJSON: any): void {
|
||||
let response: Message = {
|
||||
const response: Message = {
|
||||
'op' : type,
|
||||
'clientId' : this.id
|
||||
};
|
||||
@@ -85,11 +85,11 @@ class Client {
|
||||
if (!fields) {
|
||||
return parseObjectJSON;
|
||||
}
|
||||
let limitedParseObject = {};
|
||||
for (let field of dafaultFields) {
|
||||
const limitedParseObject = {};
|
||||
for (const field of dafaultFields) {
|
||||
limitedParseObject[field] = parseObjectJSON[field];
|
||||
}
|
||||
for (let field of fields) {
|
||||
for (const field of fields) {
|
||||
if (field in parseObjectJSON) {
|
||||
limitedParseObject[field] = parseObjectJSON[field];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user