Skip to content

Commit

Permalink
decaffeinate: Run post-processing cleanups on browser.coffee
Browse files Browse the repository at this point in the history
  • Loading branch information
kuceb committed Feb 13, 2020
1 parent f2f06be commit b81af00
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions packages/driver/src/cypress/browser.js
Original file line number Diff line number Diff line change
@@ -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),
}
}

0 comments on commit b81af00

Please sign in to comment.