cscg24-guacamole

CSCG 2024 Challenge 'Guacamole Mashup'
git clone https://git.sinitax.com/sinitax/cscg24-guacamole
Log | Files | Refs | sfeed.txt

is-object-empty.js (360B)


      1import hasOwnProp from './has-own-prop';
      2
      3export default function isObjectEmpty(obj) {
      4    if (Object.getOwnPropertyNames) {
      5        return Object.getOwnPropertyNames(obj).length === 0;
      6    } else {
      7        var k;
      8        for (k in obj) {
      9            if (hasOwnProp(obj, k)) {
     10                return false;
     11            }
     12        }
     13        return true;
     14    }
     15}