Skip to content

Commit

Permalink
Specify isPlainObject
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomek Wiszniewski committed May 23, 2015
1 parent 2c99cfc commit 329548b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/isObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ test('#isObject', () => {
ok(isObject({}));
ok(isObject([]));
ok(isObject(/anything else/));
ok(isObject(Object.create(null)));

ok(!isObject(undefined));
ok(!isObject(null));
Expand Down
23 changes: 23 additions & 0 deletions tests/isPlainObject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {ok} from 'assert';
import isPlainObject from '../isPlainObject';

test('#isPlainObject', () => {
ok(isPlainObject({}));
ok(isPlainObject(Object.create(null)));

ok(!isPlainObject(undefined));
ok(!isPlainObject(null));
ok(!isPlainObject(false));
ok(!isPlainObject(true));
ok(!isPlainObject(''));
ok(!isPlainObject('1'));
ok(!isPlainObject(0));
ok(!isPlainObject(1));
ok(!isPlainObject(NaN));
ok(!isPlainObject(Infinity));
ok(!isPlainObject('non-empty string'));
ok(!isPlainObject([]));
ok(!isPlainObject(() => {}));
ok(!isPlainObject(function named() {}));
ok(!isPlainObject(/anything else/));
});

0 comments on commit 329548b

Please sign in to comment.