kjelsrud.dev/node_modules/@astrojs/sitemap/dist/utils/is-object-empty.js

13 lines
239 B
JavaScript
Raw Normal View History

2023-07-19 21:31:30 +02:00
const isObjectEmpty = (o) => {
if (!o) {
return true;
}
if (Array.isArray(o)) {
return o.length === 0;
}
return Object.keys(o).length === 0 && Object.getPrototypeOf(o) === Object.prototype;
};
export {
isObjectEmpty
};