Comparing version 0.2.0 to 0.2.1
@@ -372,3 +372,3 @@ | ||
/** | ||
* is.function | ||
* is.fn / is.function (deprecated) | ||
* Test if `value` is a function. | ||
@@ -381,3 +381,3 @@ * | ||
is.function = function(value) { | ||
is.fn = is['function'] = function(value) { | ||
return '[object Function]' === toString.call(value); | ||
@@ -384,0 +384,0 @@ }; |
@@ -14,3 +14,8 @@ { | ||
], | ||
"contributors": [], | ||
"contributors": [ | ||
{ | ||
"name": "Jordan Harband", | ||
"url": "https://github.com/ljharb" | ||
} | ||
], | ||
"dependencies": {}, | ||
@@ -22,3 +27,3 @@ "repository": { | ||
"main": "index.js", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"scripts": { | ||
@@ -29,3 +34,3 @@ "test": "node test/index.js" | ||
"tape": "~0.3.3", | ||
"foreach": "~2.0.0" | ||
"foreach": "~2.0.2" | ||
}, | ||
@@ -32,0 +37,0 @@ "testling": { |
@@ -63,3 +63,4 @@ # is | ||
- function (value) | ||
- is.fn(value) | ||
- is.function(value) - deprecated, because in ES3 browsers, "function" is a reserved word | ||
@@ -97,2 +98,6 @@ ### number | ||
## Contributors | ||
- [Jordan Harband](https://github.com/ljharb) | ||
## License | ||
@@ -99,0 +104,0 @@ |
@@ -200,11 +200,12 @@ var test = require('tape'); | ||
test('is.function', function (t) { | ||
t.true(is.function(function () {}), 'function is function'); | ||
t.true(is.function(console.log), 'console.log is function'); | ||
test('is.fn', function (t) { | ||
t.equal(is['function'], is.fn, 'alias works'); | ||
t.true(is.fn(function () {}), 'function is function'); | ||
t.true(is.fn(console.log), 'console.log is function'); | ||
if (typeof window !== 'undefined') { | ||
// in IE7/8, typeof alert === 'object' | ||
t.true(is.function(window.alert), 'window.alert is function'); | ||
t.true(is.fn(window.alert), 'window.alert is function'); | ||
} | ||
t.false(is.function({}), 'object is not function'); | ||
t.false(is.function(null), 'null is not function'); | ||
t.false(is.fn({}), 'object is not function'); | ||
t.false(is.fn(null), 'null is not function'); | ||
t.end(); | ||
@@ -211,0 +212,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40107
1023
129