Easybuoy/storemanager

View on GitHub
server/validation/isEmpty.js

Summary

Maintainability
A
40 mins
Test Coverage
const isEmpty = (value) => {
  if (value === undefined || value === null || (typeof value === 'object' && Object.keys(value).length === 0) || (typeof value === 'string' && value.trim().length === 0)) {
    return true;
  }
  return false;
};

module.exports = isEmpty;