From f62378f85ec1ebfe966a66f852053147911701b2 Mon Sep 17 00:00:00 2001 From: littleguga Date: Thu, 2 Jun 2016 04:43:37 +0300 Subject: [PATCH] fix #69 --- lib/prompt.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/prompt.js b/lib/prompt.js index b76922f..933f777 100644 --- a/lib/prompt.js +++ b/lib/prompt.js @@ -761,9 +761,14 @@ function convert(schema) { } if (!newSchema || schema.validator || schema.warning || typeof schema.empty !== 'undefined') { - schema.description = schema.message; - schema.message = schema.warning; - + if(typeof schema.message !== 'undefined'){ + schema.description = schema.message; + } + + if(typeof schema.warning !== 'undefined'){ + schema.message = schema.warning; + } + if (typeof schema.validator === 'function') { schema.conform = schema.validator; } else {