fix: Switch converted to Object Literal (#940)

* updating a switch into object literal and fixed a couple linter errors

* added a comment about weird formatting

* style: use lodash get

* fix: pass eslint + puglint + jest
This commit is contained in:
rbtprograms
2019-08-04 13:31:13 -07:00
committed by Nicolas Giard
parent 2142b5f674
commit 0f9ddf1e5d
28 changed files with 701 additions and 59 deletions

View File

@@ -1,6 +1,3 @@
/* global WIKI */
module.exports = {
// Query: {
// comments(obj, args, context, info) {

View File

@@ -1,6 +1,3 @@
/* global WIKI */
module.exports = {
// Query: {
// folders(obj, args, context, info) {

View File

@@ -74,7 +74,7 @@ module.exports = {
}
},
async update(obj, args) {
if(_.some(args.pageRules, pr => {
if (_.some(args.pageRules, pr => {
return pr.match === 'REGEX' && !safeRegex(pr.path)
})) {
throw new gql.GraphQLError('Some Page Rules contains unsafe or exponential time regex.')

View File

@@ -51,7 +51,7 @@ module.exports = {
return {
responseResult: graphHelper.generateSuccess('Telemetry state updated successfully')
}
} catch(err) {
} catch (err) {
return graphHelper.generateError(err)
}
},
@@ -63,7 +63,7 @@ module.exports = {
return {
responseResult: graphHelper.generateSuccess('Telemetry Client ID has been reset successfully')
}
} catch(err) {
} catch (err) {
return graphHelper.generateError(err)
}
}

View File

@@ -1,8 +1,3 @@
/* global WIKI */
const gql = require('graphql')
module.exports = {
// Query: {
// tags(obj, args, context, info) {