Skip to content

Commit 899f9b7

Browse files
author
Ruben Bridgewater
committed
Fix hungry developer typo
1 parent a90b791 commit 899f9b7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ Object.defineProperty(RedisClient.prototype, 'offline_queue_length', {
10421042
});
10431043

10441044
// Add support for camelCase by adding read only properties to the client
1045-
// All known exposed snack_case variables are added here
1045+
// All known exposed snake_case variables are added here
10461046
Object.defineProperty(RedisClient.prototype, 'retryDelay', {
10471047
get: function () {
10481048
return this.retry_delay;

lib/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ function clone (obj) {
5757
var elems = Object.keys(obj);
5858
var elem;
5959
while (elem = elems.pop()) {
60-
// Accept camelCase options and convert them to snack_case
61-
var snack_case = elem.replace(/[A-Z][^A-Z]/g, '_$&').toLowerCase();
60+
// Accept camelCase options and convert them to snake_case
61+
var snake_case = elem.replace(/[A-Z][^A-Z]/g, '_$&').toLowerCase();
6262
// If camelCase is detected, pass it to the client, so all variables are going to be camelCased
6363
// There are no deep nested options objects yet, but let's handle this future proof
64-
if (snack_case !== elem.toLowerCase()) {
64+
if (snake_case !== elem.toLowerCase()) {
6565
camelCase = true;
6666
}
67-
copy[snack_case] = clone(obj[elem]);
67+
copy[snake_case] = clone(obj[elem]);
6868
}
6969
return copy;
7070
}

test/utils.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('utils.js', function () {
2929
assert.strictEqual(Object.keys(b).length, 0);
3030
});
3131

32-
it('transform camelCase options to snack_case and add the camel_case option', function () {
32+
it('transform camelCase options to snake_case and add the camel_case option', function () {
3333
var a = utils.clone({
3434
optionOneTwo: true,
3535
retryStrategy: false,

0 commit comments

Comments
 (0)