Comparing version 1.3.1 to 1.3.2
@@ -16,2 +16,7 @@ # Changelog | ||
# 1.3.2 | ||
- **Bug Fix** | ||
- dictionary type should not allow arrays, fix #218 (@gcanti) | ||
# 1.3.1 | ||
@@ -18,0 +23,0 @@ |
@@ -528,8 +528,9 @@ "use strict"; | ||
exports.DictionaryType = DictionaryType; | ||
var refinedDictionary = exports.refinement(exports.Dictionary, function (d) { return Object.prototype.toString.call(d) === '[object Object]'; }); | ||
exports.dictionary = function (domain, codomain, name) { | ||
if (name === void 0) { name = "{ [K in " + domain.name + "]: " + codomain.name + " }"; } | ||
return new DictionaryType(name, function (m) { | ||
return exports.Dictionary.is(m) && Object.keys(m).every(function (k) { return domain.is(k) && codomain.is(m[k]); }); | ||
}, function (m, c) { | ||
var dictionaryValidation = exports.Dictionary.validate(m, c); | ||
var isIndexSignatureRequired = codomain !== exports.any; | ||
var D = isIndexSignatureRequired ? refinedDictionary : exports.Dictionary; | ||
return new DictionaryType(name, function (m) { return D.is(m) && Object.keys(m).every(function (k) { return domain.is(k) && codomain.is(m[k]); }); }, function (m, c) { | ||
var dictionaryValidation = D.validate(m, c); | ||
if (dictionaryValidation.isLeft()) { | ||
@@ -536,0 +537,0 @@ return dictionaryValidation; |
{ | ||
"name": "io-ts", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "TypeScript compatible runtime type system for IO validation", | ||
@@ -47,3 +47,3 @@ "files": [ | ||
"tslint-config-standard": "7.0.0", | ||
"typescript": "^3.1.1" | ||
"typescript": "^3.1.3" | ||
}, | ||
@@ -50,0 +50,0 @@ "tags": [ |
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
83860
1344