Revision 79446ca5
Added by koszko over 1 year ago
common/misc.js | ||
---|---|---|
149 | 149 |
] |
150 | 150 |
}; |
151 | 151 |
|
152 |
/* |
|
153 |
* Facilitates checking if there aren't any keys in object. This does *NOT* |
|
154 |
* account for pathological cases like redefined properties of Object prototype. |
|
155 |
*/ |
|
156 |
function is_object_empty(object) |
|
157 |
{ |
|
158 |
for (const key in object) |
|
159 |
return false; |
|
160 |
return true; |
|
161 |
} |
|
162 |
|
|
152 | 163 |
/* |
153 | 164 |
* EXPORTS_START |
154 | 165 |
* EXPORT gen_nonce |
... | ... | |
158 | 169 |
* EXPORT open_in_settings |
159 | 170 |
* EXPORT is_privileged_url |
160 | 171 |
* EXPORT matchers |
172 |
* EXPORT is_object_empty |
|
161 | 173 |
* EXPORTS_END |
162 | 174 |
*/ |
Also available in: Unified diff
add
is_object_empty
utility function