julie-ng/standard-healthcheck

View on GitHub
healthcheck/util/has-uptime-props.js

Summary

Maintainability
A
0 mins
Test Coverage
B
83%
/* eslint-disable no-prototype-builtins */
module.exports = function (obj = {}) {
    const props = [
        'component_type',
        'observed_value',
        'observed_unit',
        'status',
        'time'
    ]
    for (const p of props) {
        if (!obj.hasOwnProperty(p)) {
            return false
        }
    }
    return true
}