Remove unused conditions prop from revalidator test, add missing type and patternProperties fields (#34679)

This commit is contained in:
Wesley Wigham
2019-04-16 16:46:32 -07:00
committed by GitHub
parent 6930a11c96
commit 165ea4e66b
2 changed files with 3 additions and 6 deletions
+2
View File
@@ -36,7 +36,9 @@ declare module Revalidator {
}
interface JSONSchema<T> {
type?: 'object';
properties?: ISchemas<T>;
patternProperties?: ISchemas<T>;
}
interface ISchemas<T> {
+1 -6
View File
@@ -35,12 +35,7 @@ revalidator.validate(someObject, {
properties: {
title: {
type: 'string',
maxLength: 140,
conditions: {
optional: function () {
return !this.published;
}
}
maxLength: 140
},
date: { type: 'string', format: 'date', messages: { format: "must be a valid %{expected} and nothing else" } },
body: { type: 'string' },