modules/utils.js
function betterInstanceOf(input, constructor) {
    "use strict";
    /*eslint eqeqeq:0 */
    if (typeof input == 'undefined' || input == null) {
      return false;
    }
    var inputToTest = input;
    while (inputToTest != null) {
      if (inputToTest == constructor.prototype) {
        return true;
      }
      if (typeof inputToTest == 'xml') {
        return constructor.prototype == document.prototype;
      }
      if (typeof inputToTest == 'undefined') {
        return false;
      }
      inputToTest = inputToTest.__proto__;
    }
    return equals(input.constructor.name, constructor.name);
}
function betterInstanceOf(input, constructor) {
    "use strict";
    /*eslint eqeqeq:0 */
    if (typeof input == 'undefined' || input == null) {
      return false;
    }
    var inputToTest = input;
    while (inputToTest != null) {
      if (inputToTest == constructor.prototype) {
        return true;
      }
      if (typeof inputToTest == 'xml') {
        return constructor.prototype == document.prototype;
      }
      if (typeof inputToTest == 'undefined') {
        return false;
      }
      inputToTest = inputToTest.__proto__;
    }
    return equals(input.constructor.name, constructor.name);
}
function betterInstanceOf ( input , constructor ) { "use strict" ; /*eslint eqeqeq:0 */ if ( typeof input == 'undefined' || input == null ) { return false ; } var inputToTest = input ; while ( inputToTest != null ) { if ( inputToTest == constructor . prototype ) { return true ; } if ( typeof inputToTest == 'xml' ) { return constructor . prototype == document . prototype ; } if ( typeof inputToTest == 'undefined' ) { return false ; } inputToTest = inputToTest . __proto__ ; } return equals ( input . constructor . name , constructor . name ) ; }
Provides a better instanceof operator, capable of checking against the full object prototype hierarchy.

@param  mixed  input
@param  function constructor
@return String
@see    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Details_of_the_Object_Model
Provides a better instanceof operator capable of checking against the full object prototype hierarchy .