Permalink
Browse files

Merge 48328d7 into 3340137

  • Loading branch information...
mattbishop committed Dec 4, 2017
2 parents 3340137 + 48328d7 commit 29fb049dd700f5ae7202ad4b96273888f52c190a
Showing with 18 additions and 7 deletions.
  1. +1 −1 dist/js.spec.bundle.js
  2. +2 −2 lib/predicates.js
  3. +1 −1 package.json
  4. +11 −0 test/predicates.test.js
  5. +3 −3 yarn.lock
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,7 +1,7 @@
import set from "lodash.isset";
import number from "lodash.isnumber";
import fn from "lodash.isfunction";
import obj from "lodash.isplainobject";
import obj from "lodash.isobjectlike";
import nil from "lodash.isnil";
import bool from "lodash.isboolean";
import date from "lodash.isdate";
@@ -29,7 +29,7 @@ function isFunction(x) {
}
function isObject(x) {
return obj(x);
return obj(x) && !isArray(x);
}
function isSet(x) {
View
@@ -60,7 +60,7 @@
"lodash.isinteger": "^4.0.4",
"lodash.isnil": "^4.0.0",
"lodash.isnumber": "^3.0.3",
"lodash.isplainobject": "^4.0.6",
"lodash.isobjectlike": "^4.0.0",
"lodash.isregexp": "^4.0.1",
"lodash.isset": "^4.4.2",
"lodash.isstring": "^4.0.1",
View
@@ -2,6 +2,17 @@ import { expect } from "chai";
import * as p from "../lib/predicates";
describe("predicate", () => {
describe("object", () => {
it("accepts plain objects", () => {
expect(p.obj({ x: 1 })).to.be.true;
});
it("accepts instances of constructed objects", () => {
expect(p.obj(new Date())).to.be.true;
});
it("rejects arrays", () => {
expect(p.obj([1, 2])).to.be.false;
});
});
describe("number", () => {
[
-10,
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit 29fb049

Please sign in to comment.