Returns undefined or throws an error if invalid
544999
function validateVectorIsDtype(vector, dtype) {
  if (vector.dtype !== dtype) {
    throw new Error('expected vector dtype to be "' + dtype + '" but got "' +
      vector.dtype + '"');
  }
}
603239
function (v) {
                            return ((v === undefined) ||
                                    (v === null) ||
                                    (v === Math.NaN) ||
                                    (v === '') ||
                                    (_.isPOD (v) &&
                                        (_.isEmptyObject (v) ||
                                        (v.length === 0)))) ? undefined : v }
1339225
function decodeError(errorCode) {
    switch (errorCode) {
        case enums.ERROR_MODULE_NOT_EXIST:
            return { status: 404, error: enums.ERROR_MODULE_NOT_EXIST, message: 'This module does not exists.' };
        case enums.ERROR_MODULE_UNREACHABLE:
            return { status: 500, error: enums.ERROR_MODULE_UNREACHABLE, message: 'This module can not be reached.' };
        case enums.ERROR_MODULE_FORBIDDEN:
            return { status: 403, error: enums.ERROR_MODULE_FORBIDDEN, message: 'This module can not be accessed (forbidden).' };
    }
    return { status: 0, error: '', message: '' };
}
6539
function isEmpty(value) {
	if (Array.isArray(value)) {
		// If first item in array is undefined, we assume there are no parameters
		// This happens as a result of using the rest operator in a mixin
		return value.length === 0 || value[0] === undefined;
	}

	return value === undefined;
}
594363
function InvalidDerefInputError() {
    var instance = new Error("Deref can only be used with a non-primitive object from get, set, or call.");

    instance.name = "InvalidDerefInputError";

    if (Object.setPrototypeOf) {
        Object.setPrototypeOf(instance, Object.getPrototypeOf(this));
    }

    if (Error.captureStackTrace) {
        Error.captureStackTrace(instance, InvalidDerefInputError);
    }

    return instance;
}
28399
function remove_null_undefined(object) {
  Object.keys(object).forEach(key => {
    if (object[key] === null || typeof object[key] === "undefined") {
      delete object[key]
    }
  })

  return object
}
294638
function(rawValue) {
			// Null and undefined values first
			if (rawValue === null || typeof(rawValue) === 'undefined') {
				return NaN;
			}
			// isNaN(object) returns true, so make sure NaN is checking for a number; Discard Infinite values
			if (typeof(rawValue) === 'number' && !isFinite(rawValue)) {
				return NaN;
			}
			// If it is in fact an object, dive in one more level
			if (typeof(rawValue) === 'object') {
				if ((rawValue instanceof Date) || (rawValue.isValid)) {
					return rawValue;
				}
				return this.getRightValue(this.isHorizontal() ? rawValue.x : rawValue.y);
			}

			// Value is good, return it
			return rawValue;
		}
224245
function getError(field, value) {
	// Check we actually got a string
	if (typeof value !== "string") {
		return errorInvalidParams(field + " must be a string");
	}
	// Check value is not empty
	if (!value.trim()) {
		return errorInvalidParams(field + " must not be empty");
	}
}
926278
function checkType(type, key, value, options) {
  options = options || {};

  if (value != undefined) {
    if (options.isArray)
      return checkArray(type, key, value);

    var checker = checkType[type];
    if (checker) return checker(key, value);

    console.warn("Could not check " + key + ", unknown type " + type);
    //    throw TypeError("Could not check "+key+", unknown type "+type);
  } else if (options.required)
    throw SyntaxError(key + " param is required");

}
526026
function assertError(result, error) {
  if (typeof error === 'function') {
    if (!(result instanceof error || error(result) === true)) {
      throw result
    }
  } else if (typeof error === 'string') {
    assert(result.message.includes(error), 'Error message is incorrect')
  } else if (error instanceof RegExp) {
    assert(
      error.test(result.message),
      `Expected ${result.message} to match ${error}`,
    )
  } else {
    invariant(
      typeof error === 'boolean',
      'The given `error` must be a function, string, boolean, or RegExp',
    )
  }
}
922257
function dumpError(e) {
    if (typeof console !== "undefined" && typeof console.log !== "undefined") {
        var msg = "zebkit.err [";
        if (typeof Date !== 'undefined') {
            var date = new Date();
            msg = msg + date.getDate()   + "/" +
                  (date.getMonth() + 1) + "/" +
                  date.getFullYear() + " " +
                  date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
        }
        if (e === null || e === undefined) {
            console.log("Unknown error");
        } else {
            console.log(msg + " : " + e);
            console.log((e.stack ? e.stack : e));
        }
    }
}
610306
function toArrayOrUndefined(str) {
    if (validation.isArray(str) && str.length < 1) {
        return undefined;
    }

    try {
        let parsedArray = str;

        if (typeof str !== 'object') {
            parsedArray = JSON.parse(str);
        }

        if (validation.isArray(parsedArray) && parsedArray.length > 0) {
            return parsedArray;
        }
        else {
            return undefined;
        }
    }
    catch (e) {
        return undefined;
    }
}
978540
function valid_errors(errors) {

  /**
   *  Return false if [errors] is empty or if it isn't a non-empty array.
   */

  if (! errors) {
    return false;
  } else {
    if (! (errors instanceof Array)) {
      return false;
    } else {
      if (errors.length === 0) {
        return false;
      }
    }
  }

  return true;

}
1189711
function onError(callback) {
  var code = (arguments.length > 1) ? arguments[1] : 0;
  fire('open.error', code);
  if (typeof callback === 'function') {
    callback(code);
  }
  return code;
}
1135712
function assertAsDefined(obj, errorMsg) {
  if (_.isUndefined(obj) || _.isNull(obj)) {
    throw new Error(errorMsg);
  }
}
720894
function getError(number, countryCode) {
    try {
        var phoneUtil = i18n.phonenumbers.PhoneNumberUtil.getInstance();
        var numberObj = phoneUtil.parseAndKeepRawInput(number, countryCode);
        return phoneUtil.isPossibleNumberWithReason(numberObj);
    } catch (e) {
        //console.log(e);

        // here I convert thrown errors into ValidationResult enums (if possible)
        if (e == i18n.phonenumbers.Error.INVALID_COUNTRY_CODE) {
            return i18n.phonenumbers.PhoneNumberUtil.ValidationResult.INVALID_COUNTRY_CODE;
        }
        if (e == i18n.phonenumbers.Error.NOT_A_NUMBER) {
            return 4;
        }
        if (e == i18n.phonenumbers.Error.TOO_SHORT_AFTER_IDD || e == i18n.phonenumbers.Error.TOO_SHORT_NSN) {
            return i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_SHORT;
        }
        if (e == i18n.phonenumbers.Error.TOO_LONG) {
            return i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_LONG;
        }

        // broken
        return -99;
    }
}
212083
function(val){
   if(typeof val === "undefined" || val === null){
      return "";
   }
   else if(val === true){
      return "1";
   }
   else if(val === false){
      return "0";
   }
   else if(typeof val === "string"){
      return val;
   }
   else if(!isNaN(val)){
      return String(val) + "";
   }
   else if(typeof val === "object"){
      return JSON.stringify(val) + "";
   }
   else if(Array.isArray(val)){
      return JSON.stringify(val) + "";
   }
   return "";
}