summaryrefslogtreecommitdiff
path: root/packages/integrations/sitemap/src/utils/is-object-empty.ts
blob: 0d61810695a1e20e966b753910687034c0ea49b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
// @internal
export const isObjectEmpty = (o: any) => {
	if (!o) {
		return true;
	}
	if (Array.isArray(o)) {
		return o.length === 0;
	}
	return Object.keys(o).length === 0 && Object.getPrototypeOf(o) === Object.prototype;
};