var is = require('./is');
var typify = require('./typify');
var constructorOf = require('./constructor-of');

module.exports = function as(expected, value, ignoreCase, ...args) {
	var type = typify(expected, true);
	var fn = new RegExp('\\bFunction\\b', ignoreCase ? 'i' : undefined);
	if (constructorOf(value) === Function && !fn.test(type)) {
		value = value(...args);
	}
	return is(type, value, ignoreCase) ? value : undefined;
};

@@ -163,17 +163,8 @@
 Case
-, ...args
 ) %7B%0A
@@ -348,16 +348,61 @@
 alue
-(...args
+.apply(null, Array.prototype.slice.call(arguments, 3)
 );%0A%09

support 2 node5