Skip to content

Commit e6a6354

Browse files
authored
Run Prettier JS (parse-community#6795)
1 parent ebb0727 commit e6a6354

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+315
-331
lines changed

package-lock.json

Lines changed: 35 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"license": "BSD-3-Clause",
2121
"dependencies": {
2222
"@apollographql/graphql-playground-html": "1.6.26",
23-
"@graphql-tools/stitch": "^6.0.1",
24-
"@graphql-tools/utils": "^6.0.1",
23+
"@graphql-tools/stitch": "6.0.1",
24+
"@graphql-tools/utils": "6.0.1",
2525
"@parse/fs-files-adapter": "1.0.1",
2626
"@parse/push-adapter": "3.2.0",
2727
"@parse/s3-files-adapter": "1.4.0",
@@ -36,7 +36,7 @@
3636
"follow-redirects": "1.12.1",
3737
"graphql": "15.1.0",
3838
"graphql-list-fields": "2.0.2",
39-
"graphql-relay": "^0.6.0",
39+
"graphql-relay": "0.6.0",
4040
"graphql-upload": "11.0.0",
4141
"intersect": "1.0.1",
4242
"jsonwebtoken": "8.5.1",
@@ -48,7 +48,7 @@
4848
"mongodb": "3.5.9",
4949
"parse": "2.14.0",
5050
"pg-promise": "10.5.7",
51-
"pluralize": "^8.0.0",
51+
"pluralize": "8.0.0",
5252
"redis": "3.0.2",
5353
"semver": "7.3.2",
5454
"subscriptions-transport-ws": "0.9.16",
@@ -80,7 +80,7 @@
8080
"eslint-plugin-flowtype": "5.1.3",
8181
"flow-bin": "0.119.1",
8282
"form-data": "3.0.0",
83-
"graphql-tag": "^2.10.1",
83+
"graphql-tag": "2.10.1",
8484
"husky": "4.2.5",
8585
"jasmine": "3.5.0",
8686
"jsdoc": "3.6.3",

spec/support/CustomAuth.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = {
2-
validateAppId: function() {
2+
validateAppId: function () {
33
return Promise.resolve();
44
},
5-
validateAuthData: function(authData) {
5+
validateAuthData: function (authData) {
66
if (authData.token == 'my-token') {
77
return Promise.resolve();
88
}

spec/support/CustomAuthFunction.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
module.exports = function(validAuthData) {
1+
module.exports = function (validAuthData) {
22
return {
3-
validateAppId: function() {
3+
validateAppId: function () {
44
return Promise.resolve();
55
},
6-
validateAuthData: function(authData) {
6+
validateAuthData: function (authData) {
77
if (authData.token == validAuthData.token) {
88
return Promise.resolve();
99
}

spec/support/CustomMiddleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function(req, res, next) {
1+
module.exports = function (req, res, next) {
22
res.set('X-Yolo', '1');
33
next();
44
};

src/Controllers/AnalyticsController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class AnalyticsController extends AdaptableController {
77
.then(() => {
88
return this.adapter.appOpened(req.body, req);
99
})
10-
.then(response => {
10+
.then((response) => {
1111
return { response: response || {} };
1212
})
1313
.catch(() => {
@@ -20,7 +20,7 @@ export class AnalyticsController extends AdaptableController {
2020
.then(() => {
2121
return this.adapter.trackEvent(req.params.eventName, req.body, req);
2222
})
23-
.then(response => {
23+
.then((response) => {
2424
return { response: response || {} };
2525
})
2626
.catch(() => {

src/Controllers/HooksController.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ export class HooksController {
2727
}
2828

2929
load() {
30-
return this._getHooks().then(hooks => {
30+
return this._getHooks().then((hooks) => {
3131
hooks = hooks || [];
32-
hooks.forEach(hook => {
32+
hooks.forEach((hook) => {
3333
this.addHookToTriggers(hook);
3434
});
3535
});
3636
}
3737

3838
getFunction(functionName) {
3939
return this._getHooks({ functionName: functionName }).then(
40-
results => results[0]
40+
(results) => results[0]
4141
);
4242
}
4343

@@ -49,7 +49,7 @@ export class HooksController {
4949
return this._getHooks({
5050
className: className,
5151
triggerName: triggerName,
52-
}).then(results => results[0]);
52+
}).then((results) => results[0]);
5353
}
5454

5555
getTriggers() {
@@ -75,8 +75,8 @@ export class HooksController {
7575
_getHooks(query = {}) {
7676
return this.database
7777
.find(DefaultHooksCollectionName, query)
78-
.then(results => {
79-
return results.map(result => {
78+
.then((results) => {
79+
return results.map((result) => {
8080
delete result.objectId;
8181
return result;
8282
});
@@ -156,7 +156,7 @@ export class HooksController {
156156

157157
createHook(aHook) {
158158
if (aHook.functionName) {
159-
return this.getFunction(aHook.functionName).then(result => {
159+
return this.getFunction(aHook.functionName).then((result) => {
160160
if (result) {
161161
throw new Parse.Error(
162162
143,
@@ -168,13 +168,11 @@ export class HooksController {
168168
});
169169
} else if (aHook.className && aHook.triggerName) {
170170
return this.getTrigger(aHook.className, aHook.triggerName).then(
171-
result => {
171+
(result) => {
172172
if (result) {
173173
throw new Parse.Error(
174174
143,
175-
`class ${aHook.className} already has trigger ${
176-
aHook.triggerName
177-
}`
175+
`class ${aHook.className} already has trigger ${aHook.triggerName}`
178176
);
179177
}
180178
return this.createOrUpdateHook(aHook);
@@ -187,7 +185,7 @@ export class HooksController {
187185

188186
updateHook(aHook) {
189187
if (aHook.functionName) {
190-
return this.getFunction(aHook.functionName).then(result => {
188+
return this.getFunction(aHook.functionName).then((result) => {
191189
if (result) {
192190
return this.createOrUpdateHook(aHook);
193191
}
@@ -198,7 +196,7 @@ export class HooksController {
198196
});
199197
} else if (aHook.className && aHook.triggerName) {
200198
return this.getTrigger(aHook.className, aHook.triggerName).then(
201-
result => {
199+
(result) => {
202200
if (result) {
203201
return this.createOrUpdateHook(aHook);
204202
}
@@ -211,7 +209,7 @@ export class HooksController {
211209
}
212210

213211
function wrapToHTTPRequest(hook, key) {
214-
return req => {
212+
return (req) => {
215213
const jsonBody = {};
216214
for (var i in req) {
217215
jsonBody[i] = req[i];
@@ -245,7 +243,7 @@ function wrapToHTTPRequest(hook, key) {
245243
'Making outgoing webhook request without webhookKey being set!'
246244
);
247245
}
248-
return request(jsonRequest).then(response => {
246+
return request(jsonRequest).then((response) => {
249247
let err;
250248
let result;
251249
let body = response.data;

src/Controllers/LoggerController.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class LoggerController extends AdaptableController {
6161
}
6262

6363
maskSensitive(argArray) {
64-
return argArray.map(e => {
64+
return argArray.map((e) => {
6565
if (!e) {
6666
return e;
6767
}
@@ -78,7 +78,7 @@ export class LoggerController extends AdaptableController {
7878
e.url = this.maskSensitiveUrl(e.url);
7979
} else if (Array.isArray(e.url)) {
8080
// for strings in array
81-
e.url = e.url.map(item => {
81+
e.url = e.url.map((item) => {
8282
if (typeof item === 'string') {
8383
return this.maskSensitiveUrl(item);
8484
}
@@ -115,7 +115,7 @@ export class LoggerController extends AdaptableController {
115115
args = this.maskSensitive([...args]);
116116
args = [].concat(
117117
level,
118-
args.map(arg => {
118+
args.map((arg) => {
119119
if (typeof arg === 'function') {
120120
return arg();
121121
}

src/Controllers/ParseGraphQLController.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ class ParseGraphQLController {
137137
}
138138
if (classConfigs !== null) {
139139
if (Array.isArray(classConfigs)) {
140-
classConfigs.forEach(classConfig => {
140+
classConfigs.forEach((classConfig) => {
141141
const errorMessage = this._validateClassConfig(classConfig);
142142
if (errorMessage) {
143143
errorMessages.push(
@@ -332,17 +332,17 @@ class ParseGraphQLController {
332332
}
333333
}
334334

335-
const isValidStringArray = function(array): boolean {
335+
const isValidStringArray = function (array): boolean {
336336
return Array.isArray(array)
337-
? !array.some(s => typeof s !== 'string' || s.trim().length < 1)
337+
? !array.some((s) => typeof s !== 'string' || s.trim().length < 1)
338338
: false;
339339
};
340340
/**
341341
* Ensures the obj is a simple JSON/{}
342342
* object, i.e. not an array, null, date
343343
* etc.
344344
*/
345-
const isValidSimpleObject = function(obj): boolean {
345+
const isValidSimpleObject = function (obj): boolean {
346346
return (
347347
typeof obj === 'object' &&
348348
!Array.isArray(obj) &&

0 commit comments

Comments
 (0)