Comparing version 2.1.0 to 2.1.1
@@ -0,1 +1,7 @@ | ||
# 2.1.1 - 2018-02-07 | ||
#### 🐞 Fixed | ||
- Fixed some inheritance issues for instance of checks in loose mode. | ||
# 2.1.0 - 2018-02-06 | ||
@@ -2,0 +8,0 @@ |
@@ -10,2 +10,3 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import isObject from './isObject'; | ||
import instanceOf from './instanceOf'; | ||
@@ -50,3 +51,3 @@ var InstanceBuilder = function (_Builder) { | ||
if (refClass) { | ||
this.invariant(typeof refClass === 'function' && (value instanceof refClass || this.loose && isObject(value) && value.constructor.name === refClass.name), "Must be an instance of \"".concat(this.typeAlias(), "\"."), path); | ||
this.invariant(typeof refClass === 'function' && (value instanceof refClass || this.loose && isObject(value) && instanceOf(value, refClass)), "Must be an instance of \"".concat(this.typeAlias(), "\"."), path); | ||
} else { | ||
@@ -53,0 +54,0 @@ this.invariant(isObject(value) && value.constructor !== Object, 'Must be a class instance.', path); |
@@ -31,2 +31,4 @@ "use strict"; | ||
var _instanceOf = _interopRequireDefault(require("./instanceOf")); | ||
var InstanceBuilder = function (_Builder) { | ||
@@ -66,3 +68,3 @@ (0, _inherits2.default)(InstanceBuilder, _Builder); | ||
if (refClass) { | ||
this.invariant(typeof refClass === 'function' && (value instanceof refClass || this.loose && (0, _isObject.default)(value) && value.constructor.name === refClass.name), "Must be an instance of \"".concat(this.typeAlias(), "\"."), path); | ||
this.invariant(typeof refClass === 'function' && (value instanceof refClass || this.loose && (0, _isObject.default)(value) && (0, _instanceOf.default)(value, refClass)), "Must be an instance of \"".concat(this.typeAlias(), "\"."), path); | ||
} else { | ||
@@ -69,0 +71,0 @@ this.invariant((0, _isObject.default)(value) && value.constructor !== Object, 'Must be a class instance.', path); |
{ | ||
"name": "optimal", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "A system for building and validating defined object structures.", | ||
@@ -49,3 +49,3 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"@milesj/build-tools": "^0.24.0" | ||
"@milesj/build-tools": "^0.24.1" | ||
}, | ||
@@ -52,0 +52,0 @@ "beemo": { |
99661
46
2351