Simple Utility Methods for checking information about a value.

@param  {Mixed}  value  Could be anything.
@return {Object}
160005
function does (value) {
  var arrayIndexOf = (Array.indexOf ? function (arr, obj, from) {
    return arr.indexOf(obj, from)
  } : function (arr, obj, from) {
    var l = arr.length
    var i = from ? parseInt((1 * from) + (from < 0 ? l : 0), 10) : 0
    i = i < 0 ? 0 : i
    for (; i < l; i++) if (i in arr && arr[i] === obj) return i
    return -1
  })

  return {
    startWith: function (string) {
      if (is(value).a(String)) return value.slice(0, string.length) === string
      if (is(value).a(Array)) return value[0] === string
      return false
    },

    endWith: function (string) {
      if (is(value).a(String)) return value.slice(-string.length) === string
      if (is(value).a(Array)) return value[value.length - 1] === string
      return false
    },

    contain: function (field) {
      if (is(value).a(String)) return value.indexOf(field) > -1
      if (is(value).a(Object)) return Object.prototype.hasOwnProperty.call(value, field)
      if (is(value).a(Array)) return !!~arrayIndexOf(value, field)
      return false
    }
  }
}
102767
function(value) {
        switch (typeof value) {
            case 'boolean':
                return 'Boolean';

            case 'number':
                return 'Number';

            case 'string':
                return 'String';

            case 'object':
                if (value === null) {
                    return 'Null';
                } else {
                    switch (Object.prototype.toString.call(value)) {
                        case '[object RegExp]':
                            return 'RegExp';

                        case '[object Array]':
                            return 'Array';

                        case '[object Object]':
                            switch (value.constructor) {
                                case JuttleMoment:
                                    if (value.moment) {
                                        return 'Date';
                                    }
                                    if (value.duration) {
                                        return 'Duration';
                                    }
                                    break;   // silence ESLint

                                case Filter:
                                    return 'Filter';

                                case Object:
                                    return 'Object';
                            }
                    }
                }
        }

        throw new Error('Invalid Juttle value: ' + value + '.');
    }
452834
function (value) {
  if (typeof value === 'object' && value !== null) {
    if (_.size(value) <= 2
        && _.all(value, function (v, k) {
          return typeof k === 'string' && k.substr(0, 1) === '$';
        })) {
      for (var i = 0; i < builtinConverters.length; i++) {
        var converter = builtinConverters[i];
        if (converter.matchJSONValue(value)) {
          return converter.fromJSONValue(value);
        }
      }
    }
  }
  return value;
}
1069326
function (value) {

            if (!Array.isArray(value)) {

                // null/undefined or anything else must be safely convert to string

                value = value + '';
            }

            if (Array.isArray(value)) {

                // map all values again
                value = value.map(v => this.parseValue(v));

            } else if (validator.isNumeric(value)) {

                value = value * 1; // parse as a number

            } else if (validator.isBoolean(value)) {

                value = (value === 'true');

            } else {

                // convert to JS date
                const date = validator.toDate(value);

                // date is valid, assign
                if (date !== null) {

                    value = date;
                }

                if (value === 'null') {

                    value = null;
                }

                if (value === 'undefined') {

                    value = undefined;
                }
            }

            return value;
        }
243652
function (value) {
		if (value === null) {
			return '';
		}
		if (value === undefined) {
			return '';
		}
		switch (typeof value) {
			case 'object' :
				if (value instanceof Blob) {
					return value;
				} else {
					return JSON.stringify(value);
				}
				break;
			case 'string':
				return value;
			default :
				return value;
		}
	}
866907
function(value)
			{
				switch (typeof value)
				{
					case "number":
					case "boolean":
						return value + "";
					case "string":
						return "\"" + value + "\"";
					default:
						if (value === undefined)
							return "undefined";
						if (value === null)
							return "null";
						var hash = value[_HASH_KEY];
						if (!hash)
							hash = value[_HASH_KEY] = "#" + (++_hashCount);
						return hash;
				}
			}
672612
function (value) {
        var handler = Variable.types[this.type] || Variable.types.any;
        return _.isFunction(handler) ? handler(value) : handler.in(value);
    }
103871
function(value)
	{
		if ( undefined == value || null == value )
			return 'null';	
		if ( value instanceof Date)
			return value.toISOString();
		if ( typeof(value) == 'object')
			return this.dumpObject(value);
		if ( typeof(value) == 'boolean' )
			return value ? 'true' : 'false';
		if ( /^\d+$/.test(value) )
			return typeof(value) == 'string' ? "'"+value+"'" : parseInt(value);
		if ( this.isNumeric(value) )
			return typeof(value) == 'string' ? "'"+value+"'" : parseFloat(value);
		if ( typeof(value) == 'number' )
			return value == Infinity ? '.Inf' : ( value == -Infinity ? '-.Inf' : ( isNaN(value) ? '.NAN' : value ) );
		var yaml = new YamlEscaper();
		if ( yaml.requiresDoubleQuoting(value) )
			return yaml.escapeWithDoubleQuotes(value);
		if ( yaml.requiresSingleQuoting(value) )
			return yaml.escapeWithSingleQuotes(value);
		if ( '' == value )
			return '""';
		if ( this.getTimestampRegex().test(value) )
			return "'"+value+"'";
		if ( this.inArray(value.toLowerCase(), ['null','~','true','false']) )
			return "'"+value+"'";
		// default
			return value;
	}
186762
function is (value) {
  return {
    a: function (check) {
      if (check.prototype) check = check.prototype.constructor.name
      var type = Object.prototype.toString.call(value).slice(8, -1).toLowerCase()
      return value != null && type === check.toLowerCase()
    }
  }
}
788170
function(value) {
		"use strict";

		if (!Array.isArray(value)) {
			value = [value];
		}

		return value.map(function(data) {
			if (data === "now") {
				return new Date();
			}
			if (data instanceof Date) {
				return data;
			}
			return false;
		}).filter(function(d) { return d !== false; });
	}
427619
function ignoreValue(value) {
    if (value === null || value === undefined || value.length === 0) {
        return true;
    }
    if (value.length === 0) {
        return true;
    }
    if (typeof (value) === 'object') {
        return false;
    }
    value = value.toLowerCase();
    var ignoreValues = ['not available', 'no information'];
    for (var x = 0; x < ignoreValues.length; x++) {
        if (value.indexOf(ignoreValues[x]) >= 0) {
            return true;
        }
    }
    return false;
}
659362
function(value) {
        switch (values.typeOf(value)) {
            case 'Null':
            case 'Boolean':
            case 'String':
            case 'Number':
                return value;

            case 'RegExp':
                return String(value);

            case 'Date':
            case 'Duration':
                return value.valueOf();

            case 'Filter':
                return value.source;

            case 'Array':
                return _.map(value, this.toJSONCompatible, this);

            case 'Object':
                return _.mapObject(value, this.toJSONCompatible, this);
        }
    }
419655
function parseCustomValue(value, parse) {
  try {
    let parsed = parse(value)
    if (parsed === undefined) {
      return { value: null }
    }
    return { value: parsed }
  } catch (error) {
    return { error: error.message }
  }
}
1163663
function (value) {
            if (this.slice) return;
            if (value === null || typeof value == "undefined")
                value = "";
            this.trueValue = this.formater ? this.formater.format(value) : value;
            //this.element.trueValue = this.trueValue;
            this.showValue = this.masker ? this.masker.format(this.trueValue).value : this.trueValue;
            this.setShowValue(this.showValue);

            //this.trueValue = value;
            //this.showValue = value;
            //this.setShowValue(this.showValue);
        }
924195
function(value, text) {
      text = (typeof text == 'string')
        ? text.toLowerCase()
        : text
      ;
      value = (typeof value == 'string')
        ? value.toLowerCase()
        : value
      ;
      return (value == text);
    }
745826
function( value ) {
			var error;
			try {
				if ( value.length ) {
					error = {
						'rule': 'isEmpty',
						'message': 'ERROR:provided value[' + value +'] is not empty.'
					};
					return [ error ];
				}
			} catch ( e ) {
				if ( _.isPlainObject( value ) ) {
					for ( var key in value ) {
						if ( value.hasOwnProperty( key ) ) {
							error = {
								'rule': 'isEmpty',
								'message': 'ERROR:provided value[' + value +'] is not empty.'
							};
							return [ error ];
						}
					} // end FOR key
				}
				error = {
					'rule': 'isEmpty',
					'message': 'ERROR:input data type is not compatible with this rule.'
				};
				return [ error ];
			}
		}
437711
function ( qu, value ) {
		return (sys.isNull( value ) || sys.isUndefined( value )) !== qu.operands[0];
	}