Comparing version 0.26.0 to 0.27.0
@@ -38,3 +38,3 @@ "use strict"; | ||
try { | ||
ow(value, predicate); | ||
test_1.default(value, '', predicate); | ||
return true; | ||
@@ -41,0 +41,0 @@ } |
@@ -6,4 +6,4 @@ "use strict"; | ||
const predicate_1 = require("./predicate"); | ||
const __1 = require(".."); | ||
const match_shape_1 = require("../utils/match-shape"); | ||
const of_type_1 = require("../utils/of-type"); | ||
class ArrayPredicate extends predicate_1.Predicate { | ||
@@ -135,18 +135,6 @@ /** | ||
ofType(predicate) { | ||
let error; | ||
// TODO [typescript@>=5] If higher-kinded types are supported natively by typescript, refactor `addValidator` to use them to avoid the usage of `any`. Otherwise, bump or remove this TODO. | ||
return this.addValidator({ | ||
message: (_, label) => `(${label}) ${error}`, | ||
validator: value => { | ||
try { | ||
for (const item of value) { | ||
__1.default(item, predicate); | ||
} | ||
return true; | ||
} | ||
catch (error_) { | ||
error = error_.message; | ||
return false; | ||
} | ||
} | ||
message: (_, label, error) => `(${label}) ${error}`, | ||
validator: value => of_type_1.default(value, 'values', predicate) | ||
}); | ||
@@ -153,0 +141,0 @@ } |
{ | ||
"name": "ow", | ||
"version": "0.26.0", | ||
"version": "0.27.0", | ||
"description": "Function argument validation for humans", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
134649
3291