Comparing version 3.2.23 to 3.2.24
@@ -15,2 +15,7 @@ # Changelog | ||
# v3.2.24 | ||
- **Bug Fix** | ||
- Struct extension of a refinement of a struct now use the correct displayName, fix #297 (@gcanti) | ||
# v3.2.23 | ||
@@ -17,0 +22,0 @@ |
@@ -11,6 +11,11 @@ var assert = require('./assert'); | ||
function compose(predicates, unrefinedType) { | ||
return predicates.reduce(function (type, predicate) { | ||
function compose(predicates, unrefinedType, name) { | ||
var result = predicates.reduce(function (type, predicate) { | ||
return refinement(type, predicate); | ||
}, unrefinedType); | ||
if (name) { | ||
result.displayName = name; | ||
result.meta.name = name; | ||
} | ||
return result; | ||
} | ||
@@ -52,3 +57,6 @@ | ||
options.defaultProps = mixin(defaultProps, options.defaultProps, true); | ||
var result = compose(predicates, combinator(props, options)); | ||
var result = compose(predicates, combinator(props, { | ||
strict: options.strict, | ||
defaultProps: options.defaultProps | ||
}), options.name); | ||
mixin(result.prototype, prototype); | ||
@@ -58,2 +66,2 @@ return result; | ||
module.exports = extend; | ||
module.exports = extend; |
{ | ||
"name": "tcomb", | ||
"version": "3.2.23", | ||
"version": "3.2.24", | ||
"description": "Type checking and DDD for JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
91654
1971