'use strict';

var hasValue = function(val) {
    if (val === false || val === 0) {
        return true;
    } else if (!val) {
        return false;
    }

    var condition1 = val.length !== 0;
    var condition2 = typeof(val) === 'object' && Object.keys(val).length !== 0;
    return condition1 || condition2;
};

var isDefined = function(val) {
    return val !== null && typeof(val) !== "undefined";
};

var isString = function(val) {
    return (typeof val === 'string' || val instanceof String);
};

module.exports = {
    hasValue: hasValue,

    isDefined: isDefined,

    isString: isString
};