1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

chore - remove standard and use individual config

Standard is not as up to date and still uses a old eslint version.
Instead, use the airbnb default with a couple of modifications.

All required changes are included.
This commit is contained in:
Ruben Bridgewater
2017-11-28 21:38:21 -02:00
parent 0206ecbf51
commit 2b4ab10305
97 changed files with 888 additions and 673 deletions

View File

@@ -5,9 +5,9 @@ const URL = require('url')
// TODO: Improve the unify performance by checking for the arguments length
// before trying to access that argument.
function unifyOptions (portArg, hostArg, options) {
function unifyOptions(portArg, hostArg, options) {
if (typeof portArg === 'number' || (typeof portArg === 'string' && /^\d+$/.test(portArg))) {
var host
let host
if (typeof hostArg === 'string') {
host = hostArg
} else {
@@ -24,6 +24,7 @@ function unifyOptions (portArg, hostArg, options) {
const parsed = URL.parse(portArg.url || portArg, true, true)
// eslint-disable-next-line
// [redis:]//[[user][:password]@][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]
if (parsed.slashes) { // We require slashes
if (parsed.auth) {
@@ -42,11 +43,9 @@ function unifyOptions (portArg, hostArg, options) {
options.port = parsed.port
}
if (parsed.search !== '') {
for (var elem in parsed.query) {
/* istanbul ignore if */
if (!Object.prototype.hasOwnProperty.call(parsed.query, elem)) {
continue
}
const keys = Object.keys(parsed.query)
for (var i = 0; i < keys.length; i++) {
const elem = keys[i]
// If options are passed twice, only the parsed options will be used
if (elem in options) {
if (options[elem] === parsed.query[elem]) {