Skip to content

Run Prettier JS #6795

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 35 additions & 51 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"license": "BSD-3-Clause",
"dependencies": {
"@apollographql/graphql-playground-html": "1.6.26",
"@graphql-tools/stitch": "^6.0.1",
"@graphql-tools/utils": "^6.0.1",
"@graphql-tools/stitch": "6.0.1",
"@graphql-tools/utils": "6.0.1",
"@parse/fs-files-adapter": "1.0.1",
"@parse/push-adapter": "3.2.0",
"@parse/s3-files-adapter": "1.4.0",
Expand All @@ -36,7 +36,7 @@
"follow-redirects": "1.12.1",
"graphql": "15.1.0",
"graphql-list-fields": "2.0.2",
"graphql-relay": "^0.6.0",
"graphql-relay": "0.6.0",
"graphql-upload": "11.0.0",
"intersect": "1.0.1",
"jsonwebtoken": "8.5.1",
Expand All @@ -48,7 +48,7 @@
"mongodb": "3.5.9",
"parse": "2.14.0",
"pg-promise": "10.5.7",
"pluralize": "^8.0.0",
"pluralize": "8.0.0",
"redis": "3.0.2",
"semver": "7.3.2",
"subscriptions-transport-ws": "0.9.16",
Expand Down Expand Up @@ -80,7 +80,7 @@
"eslint-plugin-flowtype": "5.1.3",
"flow-bin": "0.119.1",
"form-data": "3.0.0",
"graphql-tag": "^2.10.1",
"graphql-tag": "2.10.1",
"husky": "4.2.5",
"jasmine": "3.5.0",
"jsdoc": "3.6.3",
Expand Down
4 changes: 2 additions & 2 deletions spec/support/CustomAuth.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
validateAppId: function() {
validateAppId: function () {
return Promise.resolve();
},
validateAuthData: function(authData) {
validateAuthData: function (authData) {
if (authData.token == 'my-token') {
return Promise.resolve();
}
Expand Down
6 changes: 3 additions & 3 deletions spec/support/CustomAuthFunction.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = function(validAuthData) {
module.exports = function (validAuthData) {
return {
validateAppId: function() {
validateAppId: function () {
return Promise.resolve();
},
validateAuthData: function(authData) {
validateAuthData: function (authData) {
if (authData.token == validAuthData.token) {
return Promise.resolve();
}
Expand Down
2 changes: 1 addition & 1 deletion spec/support/CustomMiddleware.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function(req, res, next) {
module.exports = function (req, res, next) {
res.set('X-Yolo', '1');
next();
};
4 changes: 2 additions & 2 deletions src/Controllers/AnalyticsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export class AnalyticsController extends AdaptableController {
.then(() => {
return this.adapter.appOpened(req.body, req);
})
.then(response => {
.then((response) => {
return { response: response || {} };
})
.catch(() => {
Expand All @@ -20,7 +20,7 @@ export class AnalyticsController extends AdaptableController {
.then(() => {
return this.adapter.trackEvent(req.params.eventName, req.body, req);
})
.then(response => {
.then((response) => {
return { response: response || {} };
})
.catch(() => {
Expand Down
28 changes: 13 additions & 15 deletions src/Controllers/HooksController.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ export class HooksController {
}

load() {
return this._getHooks().then(hooks => {
return this._getHooks().then((hooks) => {
hooks = hooks || [];
hooks.forEach(hook => {
hooks.forEach((hook) => {
this.addHookToTriggers(hook);
});
});
}

getFunction(functionName) {
return this._getHooks({ functionName: functionName }).then(
results => results[0]
(results) => results[0]
);
}

Expand All @@ -49,7 +49,7 @@ export class HooksController {
return this._getHooks({
className: className,
triggerName: triggerName,
}).then(results => results[0]);
}).then((results) => results[0]);
}

getTriggers() {
Expand All @@ -75,8 +75,8 @@ export class HooksController {
_getHooks(query = {}) {
return this.database
.find(DefaultHooksCollectionName, query)
.then(results => {
return results.map(result => {
.then((results) => {
return results.map((result) => {
delete result.objectId;
return result;
});
Expand Down Expand Up @@ -156,7 +156,7 @@ export class HooksController {

createHook(aHook) {
if (aHook.functionName) {
return this.getFunction(aHook.functionName).then(result => {
return this.getFunction(aHook.functionName).then((result) => {
if (result) {
throw new Parse.Error(
143,
Expand All @@ -168,13 +168,11 @@ export class HooksController {
});
} else if (aHook.className && aHook.triggerName) {
return this.getTrigger(aHook.className, aHook.triggerName).then(
result => {
(result) => {
if (result) {
throw new Parse.Error(
143,
`class ${aHook.className} already has trigger ${
aHook.triggerName
}`
`class ${aHook.className} already has trigger ${aHook.triggerName}`
);
}
return this.createOrUpdateHook(aHook);
Expand All @@ -187,7 +185,7 @@ export class HooksController {

updateHook(aHook) {
if (aHook.functionName) {
return this.getFunction(aHook.functionName).then(result => {
return this.getFunction(aHook.functionName).then((result) => {
if (result) {
return this.createOrUpdateHook(aHook);
}
Expand All @@ -198,7 +196,7 @@ export class HooksController {
});
} else if (aHook.className && aHook.triggerName) {
return this.getTrigger(aHook.className, aHook.triggerName).then(
result => {
(result) => {
if (result) {
return this.createOrUpdateHook(aHook);
}
Expand All @@ -211,7 +209,7 @@ export class HooksController {
}

function wrapToHTTPRequest(hook, key) {
return req => {
return (req) => {
const jsonBody = {};
for (var i in req) {
jsonBody[i] = req[i];
Expand Down Expand Up @@ -245,7 +243,7 @@ function wrapToHTTPRequest(hook, key) {
'Making outgoing webhook request without webhookKey being set!'
);
}
return request(jsonRequest).then(response => {
return request(jsonRequest).then((response) => {
let err;
let result;
let body = response.data;
Expand Down
6 changes: 3 additions & 3 deletions src/Controllers/LoggerController.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class LoggerController extends AdaptableController {
}

maskSensitive(argArray) {
return argArray.map(e => {
return argArray.map((e) => {
if (!e) {
return e;
}
Expand All @@ -78,7 +78,7 @@ export class LoggerController extends AdaptableController {
e.url = this.maskSensitiveUrl(e.url);
} else if (Array.isArray(e.url)) {
// for strings in array
e.url = e.url.map(item => {
e.url = e.url.map((item) => {
if (typeof item === 'string') {
return this.maskSensitiveUrl(item);
}
Expand Down Expand Up @@ -115,7 +115,7 @@ export class LoggerController extends AdaptableController {
args = this.maskSensitive([...args]);
args = [].concat(
level,
args.map(arg => {
args.map((arg) => {
if (typeof arg === 'function') {
return arg();
}
Expand Down
8 changes: 4 additions & 4 deletions src/Controllers/ParseGraphQLController.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class ParseGraphQLController {
}
if (classConfigs !== null) {
if (Array.isArray(classConfigs)) {
classConfigs.forEach(classConfig => {
classConfigs.forEach((classConfig) => {
const errorMessage = this._validateClassConfig(classConfig);
if (errorMessage) {
errorMessages.push(
Expand Down Expand Up @@ -332,17 +332,17 @@ class ParseGraphQLController {
}
}

const isValidStringArray = function(array): boolean {
const isValidStringArray = function (array): boolean {
return Array.isArray(array)
? !array.some(s => typeof s !== 'string' || s.trim().length < 1)
? !array.some((s) => typeof s !== 'string' || s.trim().length < 1)
: false;
};
/**
* Ensures the obj is a simple JSON/{}
* object, i.e. not an array, null, date
* etc.
*/
const isValidSimpleObject = function(obj): boolean {
const isValidSimpleObject = function (obj): boolean {
return (
typeof obj === 'object' &&
!Array.isArray(obj) &&
Expand Down
Loading