Skip to content

Commit 11f7712

Browse files
Arthur Cinaderflovilmart
Arthur Cinader
authored andcommitted
Add no trailing whitespace and force eol at end of file. (#3154)
1 parent 7292fa7 commit 11f7712

22 files changed

+56
-54
lines changed

.eslintrc.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
},
1616
"rules": {
1717
"indent": ["error", 2],
18-
"linebreak-style": ["error", "unix"]
18+
"linebreak-style": ["error", "unix"],
19+
"no-trailing-spaces": 2,
20+
"eol-last": 2
1921
}
2022
}

src/AccountLockout.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ export class AccountLockout {
8484
}
8585

8686
/**
87-
* if the failed login count is greater than the threshold
88-
* then sets lockout expiration to 'currenttime + accountPolicy.duration', i.e., account is locked out for the next 'accountPolicy.duration' minutes
87+
* if the failed login count is greater than the threshold
88+
* then sets lockout expiration to 'currenttime + accountPolicy.duration', i.e., account is locked out for the next 'accountPolicy.duration' minutes
8989
* else do nothing
9090
*/
9191
_setLockoutExpiration() {
@@ -147,8 +147,8 @@ export class AccountLockout {
147147
* set and/or increment _failed_login_count
148148
* if _failed_login_count > threshold
149149
* set the _account_lockout_expires_at to current_time + accountPolicy.duration
150-
* else
151-
* do nothing
150+
* else
151+
* do nothing
152152
*/
153153
_handleFailedLoginAttempt() {
154154
return new Promise((resolve, reject) => {
@@ -175,7 +175,7 @@ export class AccountLockout {
175175
if (!this._config.accountLockout) {
176176
return Promise.resolve();
177177
}
178-
178+
179179
return new Promise((resolve, reject) => {
180180
this._notLocked()
181181
.then(() => {

src/Adapters/Analytics/AnalyticsAdapter.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*eslint no-unused-vars: "off"*/
22
export class AnalyticsAdapter {
3-
3+
44
/*
55
@param parameters: the analytics request body, analytics info will be in the dimensions property
66
@param req: the original http request
77
*/
88
appOpened(parameters, req) {
99
return Promise.resolve({});
1010
}
11-
11+
1212
/*
1313
@param eventName: the name of the custom eventName
1414
@param parameters: the analytics request body, analytics info will be in the dimensions property

src/Adapters/Email/MailAdapter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class MailAdapter {
1212
* - subject: the subject of the email
1313
*/
1414
sendMail(options) {}
15-
15+
1616
/* You can implement those methods if you want
1717
* to provide HTML templates etc...
1818
*/

src/Adapters/Storage/Mongo/MongoTransform.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const transformKey = (className, fieldName, schema) => {
1111
case 'updatedAt': return '_updated_at';
1212
case 'sessionToken': return '_session_token';
1313
}
14-
14+
1515
if (schema.fields[fieldName] && schema.fields[fieldName].__type == 'Pointer') {
1616
fieldName = '_p_' + fieldName;
1717
} else if (schema.fields[fieldName] && schema.fields[fieldName].type == 'Pointer') {
@@ -911,7 +911,7 @@ var BytesCoder = {
911911
};
912912
},
913913

914-
isValidDatabaseObject(object) {
914+
isValidDatabaseObject(object) {
915915
return (object instanceof mongodb.Binary) || this.isBase64Value(object);
916916
},
917917

src/Adapters/Storage/Postgres/PostgresStorageAdapter.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const handleDotFields = (object) => {
126126
value = undefined;
127127
}
128128
/* eslint-disable no-cond-assign */
129-
while(next = components.shift()) {
129+
while(next = components.shift()) {
130130
/* eslint-enable no-cond-assign */
131131
currentObj[next] = currentObj[next] || {};
132132
if (components.length === 0) {
@@ -149,7 +149,7 @@ const validateKeys = (object) => {
149149

150150
if(key.includes('$') || key.includes('.')){
151151
throw new Parse.Error(Parse.Error.INVALID_NESTED_KEY, "Nested keys should not contain the '$' or '.' characters");
152-
}
152+
}
153153
}
154154
}
155155
}
@@ -165,7 +165,7 @@ const joinTablesForSchema = (schema) => {
165165
});
166166
}
167167
return list;
168-
}
168+
}
169169

170170
const buildWhereClause = ({ schema, query, index }) => {
171171
let patterns = [];
@@ -174,8 +174,8 @@ const buildWhereClause = ({ schema, query, index }) => {
174174

175175
schema = toPostgresSchema(schema);
176176
for (let fieldName in query) {
177-
let isArrayField = schema.fields
178-
&& schema.fields[fieldName]
177+
let isArrayField = schema.fields
178+
&& schema.fields[fieldName]
179179
&& schema.fields[fieldName].type === 'Array';
180180
let initialPatternsLength = patterns.length;
181181
let fieldValue = query[fieldName];
@@ -186,14 +186,14 @@ const buildWhereClause = ({ schema, query, index }) => {
186186
if (fieldValue.$exists === false) {
187187
continue;
188188
}
189-
}
189+
}
190190

191191
if (fieldName.indexOf('.') >= 0) {
192192
let components = fieldName.split('.').map((cmpt, index) => {
193193
if (index === 0) {
194194
return `"${cmpt}"`;
195195
}
196-
return `'${cmpt}'`;
196+
return `'${cmpt}'`;
197197
});
198198
let name = components.slice(0, components.length-1).join('->');
199199
name+='->>'+components[components.length-1];
@@ -252,7 +252,7 @@ const buildWhereClause = ({ schema, query, index }) => {
252252
const isInOrNin = Array.isArray(fieldValue.$in) || Array.isArray(fieldValue.$nin);
253253
if (Array.isArray(fieldValue.$in) &&
254254
isArrayField &&
255-
schema.fields[fieldName].contents &&
255+
schema.fields[fieldName].contents &&
256256
schema.fields[fieldName].contents.type === 'String') {
257257
let inPatterns = [];
258258
let allowNull = false;
@@ -439,7 +439,7 @@ export class PostgresStorageAdapter {
439439
return this._client.tx(t => {
440440
const q1 = this.createTable(className, schema, t);
441441
const q2 = t.none('INSERT INTO "_SCHEMA" ("className", "schema", "isParseClass") VALUES ($<className>, $<schema>, true)', { className, schema });
442-
442+
443443
return t.batch([q1, q2]);
444444
})
445445
.then(() => {
@@ -680,7 +680,7 @@ export class PostgresStorageAdapter {
680680
delete object[fieldName];
681681
fieldName = 'authData';
682682
}
683-
683+
684684
columnsArray.push(fieldName);
685685
if (!schema.fields[fieldName] && className === '_User') {
686686
if (fieldName === '_email_verify_token' ||
@@ -726,7 +726,7 @@ export class PostgresStorageAdapter {
726726
} else {
727727
valuesArray.push(JSON.stringify(object[fieldName]));
728728
}
729-
break;
729+
break;
730730
case 'Object':
731731
case 'String':
732732
case 'Number':
@@ -843,7 +843,7 @@ export class PostgresStorageAdapter {
843843
// This recursively sets the json_object
844844
// Only 1 level deep
845845
let generate = (jsonb, key, value) => {
846-
return `json_object_set_key(COALESCE(${jsonb}, '{}'::jsonb), ${key}, ${value})::jsonb`;
846+
return `json_object_set_key(COALESCE(${jsonb}, '{}'::jsonb), ${key}, ${value})::jsonb`;
847847
}
848848
let lastKey = `$${index}:name`;
849849
let fieldNameIndex = index;
@@ -926,7 +926,7 @@ export class PostgresStorageAdapter {
926926
&& schema.fields[fieldName]
927927
&& schema.fields[fieldName].type === 'Object') {
928928
const keysToDelete = Object.keys(originalUpdate).filter(k => {
929-
// choose top level fields that have a delete operation set
929+
// choose top level fields that have a delete operation set
930930
return originalUpdate[k].__op === 'Delete' && k.split('.').length === 2
931931
}).map(k => k.split('.')[1]);
932932

@@ -990,7 +990,7 @@ export class PostgresStorageAdapter {
990990
let values = [className];
991991
let where = buildWhereClause({ schema, query, index: 2 })
992992
values.push(...where.values);
993-
993+
994994
const wherePattern = where.pattern.length > 0 ? `WHERE ${where.pattern}` : '';
995995
const limitPattern = hasLimit ? `LIMIT $${values.length + 1}` : '';
996996
if (hasLimit) {

src/Controllers/DatabaseController.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ DatabaseController.prototype.performInitizalization = function() {
903903
return Promise.reject(error);
904904
});
905905

906-
// Create tables for volatile classes
906+
// Create tables for volatile classes
907907
let adapterInit = this.adapter.performInitialization({ VolatileClassesSchemas: SchemaController.VolatileClassesSchemas });
908908
return Promise.all([usernameUniqueness, emailUniqueness, adapterInit]);
909909
}

src/LiveQuery/ParseLiveQueryServer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ class ParseLiveQueryServer {
518518
if (classSubscriptions.size === 0) {
519519
this.subscriptions.delete(className);
520520
}
521-
521+
522522
if (!notifyClient) {
523523
return;
524524
}

src/ParseServerRESTController.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function ParseServerRESTController(applicationId, router) {
3333
function handleRequest(method, path, data = {}, options = {}) {
3434
// Store the arguments, for later use if internal fails
3535
let args = arguments;
36-
36+
3737
let config = new Config(applicationId);
3838
let serverURL = URL.parse(config.serverURL);
3939
if (path.indexOf(serverURL.path) === 0) {

src/RestWrite.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ RestWrite.prototype.handleInstallation = function() {
674674
}
675675

676676
// Updating _Installation but not updating anything critical
677-
if (this.query && !this.data.deviceToken
677+
if (this.query && !this.data.deviceToken
678678
&& !installationId && !this.data.deviceType) {
679679
return;
680680
}

src/Routers/CloudCodeRouter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ export class CloudCodeRouter extends PromiseRouter {
1717
})
1818
});
1919
}
20-
}
20+
}

src/Routers/IAPValidationRouter.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const APP_STORE_ERRORS = {
1515
21005: "The receipt server is not currently available.",
1616
21006: "This receipt is valid but the subscription has expired.",
1717
21007: "This receipt is from the test environment, but it was sent to the production environment for verification. Send it to the test environment instead.",
18-
21008: "This receipt is from the production environment, but it was sent to the test environment for verification. Send it to the production environment instead."
18+
21008: "This receipt is from the production environment, but it was sent to the test environment for verification. Send it to the production environment instead."
1919
}
2020

2121
function appStoreError(status) {
@@ -49,7 +49,7 @@ function getFileForProductIdentifier(productIdentifier, req) {
4949
// Error not found or too many
5050
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Object not found.')
5151
}
52-
52+
5353
var download = products[0].download;
5454
return Promise.resolve({response: download});
5555
});
@@ -58,24 +58,24 @@ function getFileForProductIdentifier(productIdentifier, req) {
5858

5959

6060
export class IAPValidationRouter extends PromiseRouter {
61-
61+
6262
handleRequest(req) {
6363
let receipt = req.body.receipt;
6464
const productIdentifier = req.body.productIdentifier;
65-
65+
6666
if (!receipt || ! productIdentifier) {
6767
// TODO: Error, malformed request
6868
throw new Parse.Error(Parse.Error.INVALID_JSON, "missing receipt or productIdentifier");
6969
}
70-
70+
7171
// Transform the object if there
7272
// otherwise assume it's in Base64 already
7373
if (typeof receipt == "object") {
7474
if (receipt["__type"] == "Bytes") {
7575
receipt = receipt.base64;
7676
}
7777
}
78-
78+
7979
if (process.env.NODE_ENV == "test" && req.body.bypassAppStoreValidation) {
8080
return getFileForProductIdentifier(productIdentifier, req);
8181
}
@@ -87,9 +87,9 @@ export class IAPValidationRouter extends PromiseRouter {
8787
function errorCallback(error) {
8888
return Promise.resolve({response: appStoreError(error.status) });
8989
}
90-
90+
9191
return validateWithAppStore(IAP_PRODUCTION_URL, receipt).then( () => {
92-
92+
9393
return successCallback();
9494

9595
}, (error) => {
@@ -100,12 +100,12 @@ export class IAPValidationRouter extends PromiseRouter {
100100
return errorCallback(error);
101101
}
102102
);
103-
}
103+
}
104104

105105
return errorCallback(error);
106106
});
107107
}
108-
108+
109109
mountRoutes() {
110110
this.route("POST","/validate_purchase", this.handleRequest);
111111
}

src/authDataManager/OAuth1Client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,4 +221,4 @@ OAuth.signRequest = function(request, oauth_parameters, consumer_secret, auth_to
221221

222222
}
223223

224-
module.exports = OAuth;
224+
module.exports = OAuth;

src/authDataManager/google.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function validateAuthToken(id, token) {
2929
// Returns a promise that fulfills if this user id is valid.
3030
function validateAuthData(authData) {
3131
if (authData.id_token) {
32-
return validateIdToken(authData.id, authData.id_token);
32+
return validateIdToken(authData.id, authData.id_token);
3333
} else {
3434
return validateAuthToken(authData.id, authData.access_token).then(() => {
3535
// Validation with auth token worked

src/authDataManager/twitter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function validateAuthData(authData, options) {
1010
client.host = "api.twitter.com";
1111
client.auth_token = authData.auth_token;
1212
client.auth_token_secret = authData.auth_token_secret;
13-
13+
1414
return client.get("/1.1/account/verify_credentials.json").then((data) => {
1515
if (data && data.id_str == ''+authData.id) {
1616
return;

src/authDataManager/vkontakte.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ var Parse = require('parse/node').Parse;
77
var logger = require('../logger').default;
88

99
// Returns a promise that fulfills iff this user id is valid.
10-
function validateAuthData(authData, params) {
10+
function validateAuthData(authData, params) {
1111
return vkOAuth2Request(params).then(function (response) {
1212
if (response && response && response.access_token) {
1313
return request("api.vk.com", "method/secure.checkToken?token=" + authData.access_token + "&client_secret=" + params.appSecret + "&access_token=" + response.access_token).then(function (response) {
@@ -59,4 +59,4 @@ function request(host, path) {
5959
module.exports = {
6060
validateAppId: validateAppId,
6161
validateAuthData: validateAuthData
62-
};
62+
};

src/batch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function makeBatchRoutingPathFunction(originalUrl, serverURL, publicServerURL) {
3535
return path.posix.join('/', requestPath.slice(apiPrefix.length));
3636
}
3737

38-
if (serverURL && publicServerURL
38+
if (serverURL && publicServerURL
3939
&& (serverURL.path != publicServerURL.path)) {
4040
let localPath = serverURL.path;
4141
let publicPath = publicServerURL.path;

src/cli/utils/runner.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ export default function({
3535
start(program, options, function() {
3636
logStartupOptions(options);
3737
});
38-
}
38+
}

src/cloud-code/HTTPResponse.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default class HTTPResponse {
2020
} else if (!_text && _data) {
2121
_text = JSON.stringify(_data);
2222
}
23-
return _text;
23+
return _text;
2424
}
2525

2626
let getData = () => {

src/middlewares.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ export function handleParseHeaders(req, res, next) {
144144

145145
return Promise.resolve().then(() => {
146146
// handle the upgradeToRevocableSession path on it's own
147-
if (info.sessionToken &&
148-
req.url === '/upgradeToRevocableSession' &&
147+
if (info.sessionToken &&
148+
req.url === '/upgradeToRevocableSession' &&
149149
info.sessionToken.indexOf('r:') != 0) {
150150
return auth.getAuthForLegacySessionToken({ config: req.config, installationId: info.installationId, sessionToken: info.sessionToken })
151151
} else {

0 commit comments

Comments
 (0)