1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2024-12-01 13:20:54 +00:00

Regognize null as a distinct type

This commit is contained in:
Romein van Buren 2023-01-21 10:25:19 +01:00
parent 9f095697f5
commit 46bf6b70b3
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49

View File

@ -45,7 +45,10 @@
// else if (new Date(value).toString() !== 'Invalid Date') {
// return 'date';
// }
else if ((typeof value === 'object') && (value !== null)) {
else if (value === null) {
return 'null';
}
else if (typeof value === 'object') {
const keys = Object.keys(value);
return `object (${keys.length} item${keys.length === 1 ? '' : 's'})`;
}