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

Fix hungry developer typo

This commit is contained in:
Ruben Bridgewater
2016-05-27 16:51:43 +02:00
parent a90b791295
commit 899f9b7fe4
3 changed files with 6 additions and 6 deletions

View File

@@ -57,14 +57,14 @@ function clone (obj) {
var elems = Object.keys(obj);
var elem;
while (elem = elems.pop()) {
// Accept camelCase options and convert them to snack_case
var snack_case = elem.replace(/[A-Z][^A-Z]/g, '_$&').toLowerCase();
// Accept camelCase options and convert them to snake_case
var snake_case = elem.replace(/[A-Z][^A-Z]/g, '_$&').toLowerCase();
// If camelCase is detected, pass it to the client, so all variables are going to be camelCased
// There are no deep nested options objects yet, but let's handle this future proof
if (snack_case !== elem.toLowerCase()) {
if (snake_case !== elem.toLowerCase()) {
camelCase = true;
}
copy[snack_case] = clone(obj[elem]);
copy[snake_case] = clone(obj[elem]);
}
return copy;
}