From 6eba387d6ab7ef1d1f65330edbea15891dcec0b8 Mon Sep 17 00:00:00 2001 From: dblythy Date: Tue, 9 Feb 2021 20:30:15 +1100 Subject: [PATCH] run prettier --- spec/ParseQuery.spec.js | 6 +++--- src/Controllers/LiveQueryController.js | 3 +-- src/Controllers/UserController.js | 20 +++++++++++--------- src/RestQuery.js | 5 ++++- src/Routers/FilesRouter.js | 17 +++++++++-------- 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/spec/ParseQuery.spec.js b/spec/ParseQuery.spec.js index c2069241f0..085d178ab2 100644 --- a/spec/ParseQuery.spec.js +++ b/spec/ParseQuery.spec.js @@ -2048,9 +2048,9 @@ describe('Parse.Query testing', () => { const query = new Parse.Query(TestObject); query.matches( 'myString', - 'parse # First fragment. We\'ll write this in one case but match insensitively\n' + - '.com # Second fragment. This can be separated by any character, including newline;' + - 'however, this comment must end with a newline to recognize it as a comment\n', + "parse # First fragment. We'll write this in one case but match insensitively\n" + + '.com # Second fragment. This can be separated by any character, including newline;' + + 'however, this comment must end with a newline to recognize it as a comment\n', 'mixs' ); query.find().then( diff --git a/src/Controllers/LiveQueryController.js b/src/Controllers/LiveQueryController.js index ea71ade033..34cf28893f 100644 --- a/src/Controllers/LiveQueryController.js +++ b/src/Controllers/LiveQueryController.js @@ -9,8 +9,7 @@ export class LiveQueryController { if (!config || !config.classNames) { this.classNames = new Set(); } else if (config.classNames instanceof Array) { - const classNames = config.classNames - .map(name => new RegExp("^" + name + "$")); + const classNames = config.classNames.map(name => new RegExp('^' + name + '$')); this.classNames = new Set(classNames); } else { throw 'liveQuery.classes should be an array of string'; diff --git a/src/Controllers/UserController.js b/src/Controllers/UserController.js index 0b15134a08..de1aa7bced 100644 --- a/src/Controllers/UserController.js +++ b/src/Controllers/UserController.js @@ -308,15 +308,17 @@ export class UserController extends AdaptableController { // Mark this private function updateUserPassword(user, password, config) { - return rest.update( - config, - Auth.master(config), - '_User', - { objectId: user.objectId }, - { - password: password, - } - ).then(() => user); + return rest + .update( + config, + Auth.master(config), + '_User', + { objectId: user.objectId }, + { + password: password, + } + ) + .then(() => user); } function buildEmailLink(destination, username, token, config) { diff --git a/src/RestQuery.js b/src/RestQuery.js index 48dc9bcdb1..99025af464 100644 --- a/src/RestQuery.js +++ b/src/RestQuery.js @@ -100,7 +100,10 @@ function RestQuery( for (var option in restOptions) { switch (option) { case 'keys': { - const keys = restOptions.keys.split(',').filter(key => key.length > 0).concat(AlwaysSelectedKeys); + const keys = restOptions.keys + .split(',') + .filter(key => key.length > 0) + .concat(AlwaysSelectedKeys); this.keys = Array.from(new Set(keys)); break; } diff --git a/src/Routers/FilesRouter.js b/src/Routers/FilesRouter.js index 1a8b2ca50b..df768e6d0b 100644 --- a/src/Routers/FilesRouter.js +++ b/src/Routers/FilesRouter.js @@ -98,17 +98,18 @@ export class FilesRouter { const isMaster = req.auth.isMaster; const isLinked = user && Parse.AnonymousUtils.isLinked(user); if (!isMaster && !config.fileUpload.enableForAnonymousUser && isLinked) { - next(new Parse.Error( - Parse.Error.FILE_SAVE_ERROR, - 'File upload by anonymous user is disabled.' - )); + next( + new Parse.Error(Parse.Error.FILE_SAVE_ERROR, 'File upload by anonymous user is disabled.') + ); return; } if (!isMaster && !config.fileUpload.enableForAuthenticatedUser && !isLinked && user) { - next(new Parse.Error( - Parse.Error.FILE_SAVE_ERROR, - 'File upload by authenticated user is disabled.' - )); + next( + new Parse.Error( + Parse.Error.FILE_SAVE_ERROR, + 'File upload by authenticated user is disabled.' + ) + ); return; } if (!isMaster && !config.fileUpload.enableForPublic && !user) {