diff --git a/src/string.js b/src/string.js index d4eb0a7f4..7baa5e2a1 100644 --- a/src/string.js +++ b/src/string.js @@ -88,6 +88,12 @@ inherits(StringSchema, MixedSchema, { }, //-- transforms -- + ensure() { + return this + .default('') + .transform(val => val === null ? '' : val) + }, + trim(msg) { msg = msg || locale.trim