Sha256: a2798dac5494df484c3e8d24c22758b64853f21e55b90a30b068ea33969559cc

Contents?: true

Size: 360 Bytes

Versions: 19

Compression:

Stored size: 360 Bytes

Contents

import hasOwnProp from './has-own-prop';

export default function isObjectEmpty(obj) {
    if (Object.getOwnPropertyNames) {
        return Object.getOwnPropertyNames(obj).length === 0;
    } else {
        var k;
        for (k in obj) {
            if (hasOwnProp(obj, k)) {
                return false;
            }
        }
        return true;
    }
}

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
card-mod-date-0.15.6 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.15.0 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.14.2 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.14.1 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.14.0 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.13.4 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.13.3 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.13.2 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.13.1 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.13.0 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.11.7 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.12.0 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.11.6 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.11.5 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.11.4 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.11.3 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.11.2 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.11.1 vendor/moment/src/lib/utils/is-object-empty.js
card-mod-date-0.11.0 vendor/moment/src/lib/utils/is-object-empty.js