From b81af00ad8a5141fbf2423a6423db9df12dd091d Mon Sep 17 00:00:00 2001 From: decaffeinate <14625260+Bkucera@users.noreply.github.com> Date: Thu, 13 Feb 2020 13:14:01 -0500 Subject: [PATCH] decaffeinate: Run post-processing cleanups on browser.coffee --- packages/driver/src/cypress/browser.js | 37 ++++++++++++-------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/packages/driver/src/cypress/browser.js b/packages/driver/src/cypress/browser.js index e9ff8fb58fd1..e86eb11c5301 100644 --- a/packages/driver/src/cypress/browser.js +++ b/packages/driver/src/cypress/browser.js @@ -1,29 +1,26 @@ -/* - * decaffeinate suggestions: - * DS102: Remove unnecessary code created because of implicit returns - * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md - */ -const _ = require("lodash"); -const $utils = require("./utils"); +const _ = require('lodash') +const $utils = require('./utils') -const isBrowser = function(config, obj='') { +const isBrowser = function (config, obj = '') { if (_.isString(obj)) { - const name = obj.toLowerCase(); - const currentName = config.browser.name.toLowerCase(); + const name = obj.toLowerCase() + const currentName = config.browser.name.toLowerCase() - return name === currentName; + return name === currentName } if (_.isObject(obj)) { - return _.isMatch(config.browser, obj); + return _.isMatch(config.browser, obj) } - return $utils.throwErrByPath("browser.invalid_arg", { - args: { method: 'isBrowser', obj: $utils.stringify(obj) } - }); -}; + $utils.throwErrByPath('browser.invalid_arg', { + args: { method: 'isBrowser', obj: $utils.stringify(obj) }, + }) +} -module.exports = config => ({ - browser: config.browser, - isBrowser: _.partial(isBrowser, config) -}); +module.exports = (config) => { + return { + browser: config.browser, + isBrowser: _.partial(isBrowser, config), + } +}