is-plain-function.js #1

  • //
  • guest/
  • jen_bottom/
  • ember/
  • tutorial/
  • testapp/
  • node_modules/
  • es5-ext/
  • object/
  • is-plain-function.js
  • View
  • Commits
  • Open Download .zip Download (350 B)
"use strict";

var isClassStr = RegExp.prototype.test.bind(/^\s*class[\s{/}]/)
  , fnToString = Function.prototype.toString;

module.exports = function (fn) {
	if (typeof fn !== "function") return false;
	if (typeof fn.call !== "function") return false;
	if (typeof fn.apply !== "function") return false;
	return !isClassStr(fnToString.call(fn));
};
# Change User Description Committed
#1 23539 jenbottom Adding the basic code for ember test appk, created with 'ember new' command