1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +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

@@ -2,20 +2,15 @@
const Command = require('./command')
function addCommand (clientProto, multiProto, command) {
function addCommand(clientProto, multiProto, command) {
// Some rare Redis commands use special characters in their command name
// Convert those to a underscore to prevent using invalid function names
const commandName = command.replace(/(?:^([0-9])|[^a-zA-Z0-9_$])/g, '_$1')
// Do not override existing functions
if (!clientProto[command]) {
clientProto[commandName] = function () {
const len = arguments.length
const arr = new Array(len)
for (var i = 0; i < len; i += 1) {
arr[i] = arguments[i]
}
return this.internalSendCommand(new Command(command, arr))
clientProto[commandName] = function (...args) {
return this.internalSendCommand(new Command(command, args))
}
if (!clientProto[commandName].name) {
Object.defineProperty(clientProto[commandName], 'name', {
@@ -32,13 +27,8 @@ function addCommand (clientProto, multiProto, command) {
// Do not override existing functions
if (!multiProto[command] && command !== 'multi') {
multiProto[commandName] = function () {
const len = arguments.length
const arr = new Array(len)
for (var i = 0; i < len; i += 1) {
arr[i] = arguments[i]
}
this._queue.push(new Command(command, arr))
multiProto[commandName] = function (...args) {
this._queue.push(new Command(command, args))
return this
}
if (!multiProto[commandName].name) {