Closed simplesmiler closed 5 years ago
When you set a falsy value (0, '', false, etc.), you will get null instead of the value.
0
''
false
null
Example:
request.yar.set('visits', 1); console.log(request.yar.get('visits')); // logs 1 request.yar.set('visits', 0); console.log(request.yar.get('visits')); // logs null
Version: 9.0.1 Happens in this line https://github.com/hapijs/yar/blob/v9.0.1/lib/index.js#L155
If this is not an expected behavior, ping me and I will make a PR.
Seems like a bug. PR would be great.
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.
When you set a falsy value (
0
,''
,false
, etc.), you will getnull
instead of the value.Example:
Version: 9.0.1 Happens in this line https://github.com/hapijs/yar/blob/v9.0.1/lib/index.js#L155
If this is not an expected behavior, ping me and I will make a PR.