Updated HGETALL return type

This commit is contained in:
斟酌 鵬兄 2023-02-01 07:53:28 +08:00
parent deb18f0eb5
commit 6f9fd7b88c

View File

@ -43,13 +43,11 @@ class Session extends EventEmitter
{
if( err ) throw err;
if( _self.exists = !!obj.length )
if( _self.exists = !!Object.keys(obj).length )
{
_self.__sess = {};
for( var i = 0, l = obj.length; i < l; i += 2 )
{
_self.__sess[obj[i]] = obj[ i + 1 ];
}
for( var i in obj )
_self.__sess[i] = obj[i];
}
// Auto reset the session id if no match
else if( !noIdReset )