marko/helpers/notEmpty.js
Michael Rawlings 4a73060bc6 Cleanup tests (#1341)
Cleanup tests and add assertions that all deprecated tests log warnings, and all non deprecated tests don't.
2019-05-28 10:54:31 -07:00

14 lines
274 B
JavaScript

module.exports = function notEmpty(o) {
require("complain")("notEmpty is deprecated.");
if (o == null) {
return false;
} else if (Array.isArray(o)) {
return !!o.length;
} else if (o === "") {
return false;
}
return true;
};