Skip to content

Commit b0932e1

Browse files
committed
feat: Add isObjectEmpty utility function
This commit adds a new utility function called `isObjectEmpty` which checks if an object is empty by iterating over its properties and returning false if any property is found, otherwise it returns true.
1 parent 48af4cd commit b0932e1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@
114114
}
115115
}
116116

117+
function isObjectEmpty(obj) {
118+
for (var x in obj) { return false }
119+
return true;
120+
}
121+
117122
function domParser(str) {
118123
try {
119124
var mainTag = str.match(/\<(?<tag>[a-z0-9]+)(.*?)?\>/).groups.tag;
@@ -599,6 +604,7 @@
599604
checkValue,
600605
dotNotationToObject,
601606
getValueFromObject,
607+
isObjectEmpty,
602608
domParser,
603609
parseTextToHtml,
604610
escapeHtml,

0 commit comments

Comments
 (0)