src/js/libs/spiritual-gui.js
function(xpect, arg, index) {
		var needs = !xpect.startsWith("(");
		var split = this._xtract(xpect, !needs).split("|");
		var input = gui.Type.of(arg);
		var match = (xpect === "*" ||
			(xpect === 'node' && arg && arg.nodeType) || 
			(xpect === 'element' && arg && arg.nodeType === Node.ELEMENT_NODE) || 
			(xpect === 'spirit' && arg && arg.$instanceid && arg.element) || 
			(!needs && input === "undefined") ||
			(!needs && split.indexOf("*") > -1) ||
			split.indexOf(input) > -1);
		if (!match && this._validating) {
			if (input === "string") {
				arg = '"' + arg + '"';
			}
			this._bugsummary = [index, xpect, input, arg];
		}
		return match;
	}
function(xpect, arg, index) {
		var needs = !xpect.startsWith("(");
		var split = this._xtract(xpect, !needs).split("|");
		var input = gui.Type.of(arg);
		var match = (xpect === "*" ||
			(xpect === 'node' && arg && arg.nodeType) || 
			(xpect === 'element' && arg && arg.nodeType === Node.ELEMENT_NODE) || 
			(xpect === 'spirit' && arg && arg.$instanceid && arg.element) || 
			(!needs && input === "undefined") ||
			(!needs && split.indexOf("*") > -1) ||
			split.indexOf(input) > -1);
		if (!match && this._validating) {
			if (input === "string") {
				arg = '"' + arg + '"';
			}
			this._bugsummary = [index, xpect, input, arg];
		}
		return match;
	}
function ( xpect , arg , index ) { var needs = ! xpect . startsWith ( "(" ) ; var split = this . _xtract ( xpect , ! needs ) . split ( "|" ) ; var input = gui . Type . of ( arg ) ; var match = ( xpect === "*" || ( xpect === 'node' && arg && arg . nodeType ) || ( xpect === 'element' && arg && arg . nodeType === Node . ELEMENT_NODE ) || ( xpect === 'spirit' && arg && arg . $instanceid && arg . element ) || ( ! needs && input === "undefined" ) || ( ! needs && split . indexOf ( "*" ) > - 1 ) || split . indexOf ( input ) > - 1 ) ; if ( ! match && this . _validating ) { if ( input === "string" ) { arg = '"' + arg + '"' ; } this . _bugsummary = [ index , xpect , input , arg ] ; } return match ; }
Check if argument matches expected type.
@param {string} xpect
@param {object} arg
@param {number} index
@returns {boolean}
Check if argument matches expected type .