Skip to content

Commit

Permalink
fix check.promise throwing an exception on an array
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Ong committed Jun 2, 2015
1 parent 148b772 commit 847d7f4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# check-more-types v1.7.0
# check-more-types v1.7.1

> Additional type checks for [check-types.js](https://github.com/philbooth/check-types.js)
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "check-more-types",
"main": "check-more-types.js",
"version": "1.7.0",
"version": "1.7.1",
"homepage": "https://github.com/kensho/check-more-types",
"license": "MIT",
"ignore": [
Expand Down
3 changes: 1 addition & 2 deletions check-more-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,7 @@
@method promise
*/
function isPromise(p) {
return typeof p === 'object' &&
hasPromiseApi(p);
return check.object(p) && hasPromiseApi(p);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions check-more-types.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "check-more-types",
"description": "Additional type checks for https://github.com/philbooth/check-types.js",
"version": "1.7.0",
"version": "1.7.1",
"author": "Gleb Bahmutov <gleb.bahmutov@gmail.com>",
"bugs": {
"url": "https://github.com/kensho/check-more-types/issues"
Expand Down
3 changes: 3 additions & 0 deletions test/unit-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ describe('check-more-types', function () {
la(!check.promise());
});

it('does not throw exception when passed array', function () {
la(!check.promise([]));
});
});

describe('check/oneOf', function () {
Expand Down

0 comments on commit 847d7f4

Please sign in to comment.