INNER CODE UNIT · JavaScript

isArrayWithEmptyObjs

sisense/graphql2rest · src/common.js:9

const isArrayWithEmptyObjs = (array) => {
	if (!array || !Array.isArray(array) || !array.length) return false;
	for (let i = 0; i < array.length; i += 1) {
		if (JSON.stringify(array[i]) !== '{}') return false;
	}
	return true;
};

module.exports = { pretty, isArrayWithEmptyObjs };

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…