uniforms-bridge-simple-schema-2
Advanced tools
Comparing version 3.5.0 to 3.5.1
@@ -32,18 +32,10 @@ "use strict"; | ||
var _this = this; | ||
if (error) { | ||
if (Array.isArray(error.details)) { | ||
// FIXME: Correct type for `error`. | ||
return error.details.map(function (error) { | ||
// @ts-expect-error: `messageForError` has incorrect typing. | ||
return _this.schema.messageForError(error); | ||
}); | ||
} | ||
if (error.message) { | ||
return [error.message]; | ||
} | ||
if (!error) { | ||
return []; | ||
} | ||
if (error !== undefined) { | ||
return [error]; | ||
} | ||
return []; | ||
var details = error.details; | ||
return Array.isArray(details) | ||
? // @ts-expect-error: `messageForError` has incorrect typing. | ||
details.map(function (error) { return _this.schema.messageForError(error); }) | ||
: [error.message || error]; | ||
}; | ||
@@ -50,0 +42,0 @@ SimpleSchema2Bridge.prototype.getField = function (name) { |
@@ -27,17 +27,10 @@ import { __rest } from "tslib"; | ||
getErrorMessages(error) { | ||
if (error) { | ||
if (Array.isArray(error.details)) { | ||
// FIXME: Correct type for `error`. | ||
return error.details.map(error => | ||
// @ts-expect-error: `messageForError` has incorrect typing. | ||
this.schema.messageForError(error)); | ||
} | ||
if (error.message) { | ||
return [error.message]; | ||
} | ||
if (!error) { | ||
return []; | ||
} | ||
if (error !== undefined) { | ||
return [error]; | ||
} | ||
return []; | ||
const { details } = error; | ||
return Array.isArray(details) | ||
? // @ts-expect-error: `messageForError` has incorrect typing. | ||
details.map(error => this.schema.messageForError(error)) | ||
: [error.message || error]; | ||
} | ||
@@ -44,0 +37,0 @@ getField(name) { |
{ | ||
"name": "uniforms-bridge-simple-schema-2", | ||
"version": "3.5.0", | ||
"version": "3.5.1", | ||
"license": "MIT", | ||
@@ -40,5 +40,5 @@ "main": "es5/index.js", | ||
"tslib": "^2.2.0", | ||
"uniforms": "^3.5.0" | ||
"uniforms": "^3.5.1" | ||
}, | ||
"gitHead": "812a934bf416f85f0d072d415d856383f10eef8f" | ||
"gitHead": "8e813322a5bb8149e1912cd652f212135472ec76" | ||
} |
@@ -29,21 +29,11 @@ import invariant from 'invariant'; | ||
getErrorMessages(error: any) { | ||
if (error) { | ||
if (Array.isArray(error.details)) { | ||
// FIXME: Correct type for `error`. | ||
return (error.details as any[]).map(error => | ||
// @ts-expect-error: `messageForError` has incorrect typing. | ||
this.schema.messageForError(error), | ||
); | ||
} | ||
if (error.message) { | ||
return [error.message]; | ||
} | ||
if (!error) { | ||
return []; | ||
} | ||
if (error !== undefined) { | ||
return [error]; | ||
} | ||
return []; | ||
const { details } = error; | ||
return Array.isArray(details) | ||
? // @ts-expect-error: `messageForError` has incorrect typing. | ||
details.map(error => this.schema.messageForError(error)) | ||
: [error.message || error]; | ||
} | ||
@@ -50,0 +40,0 @@ |
2126
24497
569
Updateduniforms@^3.5.1